Registers a user-defined command with the Help facility so the appropriate Help file and topic are called when the user requests help on that command
(setfunhelp c:fname [helpfile [topic [command]]])
- c:fname
- helpfile
-
A string naming the Help file. The file extension is not required with the helpfile argument. If a file extension is provided, AutoCAD looks only for a file with the exact name specified.
If no file extension is provided, AutoCAD looks for helpfile with an extension of .chm. If no file of that name is found, AutoCAD looks for a file with an extension of .hlp.
- topic
- command
-
A string that specifies the initial state of the Help window. The command argument is a string used by the uCommand (in HTML Help) or the fuCommand (in WinHelp) argument of the HtmlHelp() and WinHelp() functions as defined in the Microsoft Windows SDK.
For HTML Help files, the command parameter can be HH_ALINK_LOOKUP or HH_DISPLAY_TOPIC. For Windows Help files, the command parameter can be HELP_CONTENTS, HELP_HELPONHELP, or HELP_PARTIALKEY.
The string passed as c:fname, if successful; otherwise, nil.
This function verifies only that the c:fname argument has the c: prefix. It does not verify that the c:fname function exists, nor does it verify the correctness of the other arguments supplied.
The following example illustrates the use of setfunhelp by defining a simple function and issuing setfunhelp to associate the function with the circle topic in the AutoCAD Help file (acad.chm):
(defun c:foo ()
(getstring "Press F1 for help on the foo command:")
)
(setfunhelp "c:foo" "acad.chm" "circle")
After this code is loaded, issuing the foo command and then pressing F1 displays the circle topic.
This example works, but serves no real purpose. In the real world, you would create your own Help file and associate that Help file and topic with your function.
Command: (defun c:test()(getstring "\nTEST: " )(princ))
C:TEST
Associate the function with a call to Help with the string “line”:
Command: (setfunhelp "c:test" "acad.chm" "line")
"c:test"
Run the test command and at the prompt, press F1; you should see the Help topic for the AutoCAD LINE command.