help button & lisp

Discussion in 'AutoCAD' started by M_Dobek, Oct 12, 2004.

  1. M_Dobek

    M_Dobek Guest

    Hi everyone,

    I wrote a lisp and I want to add help to some windows in DCL.
    I've got help file created with HTML.
    And my question is:
    How I can trigger help file (html) with specific site from LISP ?
    I there any way to choose html help file from lisp?

    Which program can convert html help file to CHM file?

    any help will be greatfull.
    Marcin_D
     
    M_Dobek, Oct 12, 2004
    #1
  2. I recently tested the program DocToHelp from componentone.com
    I think it allows html or .doc as source.
    It seems to be a great program.

    As far as running things you normally double click on in explorer, use this:

    (DEFUN C:WINRUN (NAME / FILENAME)
    (IF (NOT (SETQ FILENAME (FINDFILE NAME)))
    (PROGN
    (ALERT (STRCAT "File " NAME " cannot be found."))
    (VL-EXIT-WITH-VALUE 1)
    )
    )
    (IF (NOT (FINDFILE (STRCAT (GETENV "SYSTEMROOT") "\\EXPLORER.EXE")))
    (PROGN
    (ALERT (STRCAT "Explorer cannot be found so file cannot be run."))
    (VL-EXIT-WITH-VALUE 1)
    )
    )
    (STARTAPP (STRCAT (GETENV "SYSTEMROOT") "\\EXPLORER.EXE") FILENAME)
    )

    so you might issu an (WINRUN "C:\\test\\whatever.html") to run the html in that location.

    "M_Dobek" <>
    |>Hi everyone,
    |>
    |>I wrote a lisp and I want to add help to some windows in DCL.
    |>I've got help file created with HTML.
    |>And my question is:
    |>How I can trigger help file (html) with specific site from LISP ?
    |>I there any way to choose html help file from lisp?
    |>
    |>Which program can convert html help file to CHM file?
    |>
    |>any help will be greatfull.
    |>Marcin_D
    |>

    James Maeding
    jmaeding at hunsaker dot com
    Civil Engineer/Programmer
     
    James Maeding, Oct 12, 2004
    #2
  3. Here is a cut and paste from an existing program.
    The program builds a dialog box on the fly that is the size of a .txt file

    ;===============================================
    ; program to launch help
    (defun SHOW_HELP ()
    (setq PROGRAM_NAME "Help for program")
    (setq HELP_FILE "HELP.txt")
    (load "help.lsp")
    )


    ; help.lsp file -
    ;===============================================
    ;--close help file------------------------------------------------------
    (defun HELP_CLOSE ()
    (done_dialog 0)
    (setq HELP_VALUES_OK T)
    )
    ;--get help file name----------------------------------------------------
    (setq FH1 nil)
    (if (findfile HELP_FILE)
    (setq FH1 (open HELP_FILE "r"))
    )
    ;--read help file--------------------------------------------------------
    (if FH1
    (progn
    (setq LIST_HELP_TEXT nil HT_WIDTH 0 HT_HEIGHT 1)
    (setq RL (read-line FH1))
    (while RL
    (setq LIST_HELP_TEXT (append LIST_HELP_TEXT (list RL)))
    (if (< HT_WIDTH (strlen RL)) (setq HT_WIDTH (strlen RL)))
    (setq HT_HEIGHT (1+ HT_HEIGHT))
    (setq RL (read-line FH1))
    )
    (close FH1)

    ;--write temporary DCL file---------------------------------------------
    (setq C34 (chr 34))
    (setq FD1 (open "temp.dcl" "w"))
    (if FD1
    (progn
    (write-line "temp :dialog{" FD1)
    (write-line (strcat " label=" C34 "Help File" C34 ";") FD1)
    (write-line (strcat " :text{key=" C34 "PROGRAM_NAME" C34 ";}") FD1)
    (write-line (strcat " :list_box{") FD1)
    (write-line (strcat " key=" C34 "HELP_TEXT" C34 ";") FD1)
    (write-line (strcat " width=" (itoa HT_WIDTH) ";") FD1)
    (if (< 30 HT_HEIGHT)
    (write-line (strcat " height=30;") FD1)
    (write-line (strcat " height=" (itoa HT_HEIGHT) ";") FD1)
    )
    (write-line (strcat " }") FD1)
    (write-line (strcat " ok_only;") FD1)
    (write-line (strcat "}") FD1)
    (close FD1)
    )
    (progn
    (alert "\nERROR - Problems creating temp.dcl File")
    (exit)
    )
    )
    ;--initialize dialog box------------------------------------------------
    (setq HELP_VALUES_OK nil)
    (while (not HELP_VALUES_OK)
    (setq DCL_ID_HELP (load_dialog "temp.dcl"))
    (if (not (new_dialog "temp" DCL_ID_HELP))
    (exit)
    (progn
    (set_tile "PROGRAM_NAME" PROGRAM_NAME)
    (start_list "HELP_TEXT")
    (mapcar 'add_list LIST_HELP_TEXT)
    (end_list)

    (action_tile "accept" "(HELP_CLOSE)")
    ;--start dialog
    box-----------------------------------------------------
    (setq DCL_EXIT_HELP (start_dialog))
    )
    )
    ;--Unload DCL from
    memory-----------------------------------------------
    (unload_dialog DCL_ID_HELP)
    )
    (setq FH1 nil)
    )

    ;--error opening help file----------------------------------------------
    (progn
    (alert (strcat "\nERROR - \n \n There is a problem opening ["
    HELP_FILE "]."))
    )
    )
    (princ)
     
    Alan Henderson @ A'cad Solutions, Oct 12, 2004
    #3
  4. M_Dobek

    M_Dobek Guest

    thans for help

    marcin_D




    U¿ytkownik "Alan Henderson @ A'cad Solutions"
     
    M_Dobek, Oct 13, 2004
    #4
  5. M_Dobek

    liftedaxis Guest

    The Microsoft Help Workshop can convert HTML to CHM, and is a free download. The HTML has to be formatted rather perfectly however. On the high end, you might want to look into a program such as WebWorks for Word, which lets you just have all your documentation in MS Word, and then convert straight to CHM.
    using the Autolisp (help) command, you can easily pull up the help file like so:
    (help "<chmfilename.chm>" "<pagename>" "HH_DISPLAY_TOPIC")
    note that your pages need to be .html, not .htm.

    --Jeremiah
     
    liftedaxis, Oct 13, 2004
    #5
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.