Author Topic: SetFunHelp Not Working  (Read 2723 times)

0 Members and 1 Guest are viewing this topic.

BlackBox

  • King Gator
  • Posts: 3770
SetFunHelp Not Working
« on: July 26, 2012, 11:49:24 AM »
Following the developer documentation for SetFunHelp, and an RSS feed on the topic, I am unable to get the function to successfully open either .HTM/.HTML or URL... Can anyone else get this to work?

Example:

Code - Auto/Visual Lisp: [Select]
  1. (defun c:FOO () (command "._line") (princ))
  2.  
  3. (setfunhelp "c:FOO" "www.theswamp.org/index.php")
  4.  

... Which just results in the attached images.

Using Civil 3D 2011, TIA

"How we think determines what we do, and what we do determines what we get."

owenwengerd

  • Bull Frog
  • Posts: 451
Re: SetFunHelp Not Working
« Reply #1 on: July 26, 2012, 01:09:17 PM »
It looks like you forgot the "http://" prefix in your URL.

BlackBox

  • King Gator
  • Posts: 3770
Re: SetFunHelp Not Working
« Reply #2 on: July 26, 2012, 01:25:09 PM »
Actually, I did forget to type that when I copied the URL for the pseudo code I posted... Adding it however, has no effect.

Here's what Lee Ambrosius posted at Hyperpics (from the link above):

Quote

Hooking Up Custom Help for Your Commands

<snip>

Now that you have seen how to call help with the HELP function, the SETFUNHELP function is very similar with the exception of needing to provide the name of the function.  The function name must include the 'c:' (command) prefix.

The syntax for the SETFUNHELP function is:

Code - Auto/Visual Lisp: [Select]
  1. (setfunhelp c:function_name [help_file [chm_hlp_topic [chm_help_window_command]]])

The following examples demonstrate how to set up contextual/F1 help for custom commands:

Code - Auto/Visual Lisp: [Select]
  1. ;; Displays the topic for the LINE command from the default AutoCAD help
  2. (defun c:CMD1 () (getstring "\nEnter some text: "))
  3. (setfunhelp "c:CMD1" "" "LINE")
  4.  
  5. ;; Displays a Web page
  6. (defun c:CMD2 () (getstring "\nEnter some text: "))
  7. (setfunhelp "c:CMD2" "http://www.hyperpics.com/")
  8.  
  9. ;; Displays a local HTML file
  10. (defun c:CMD3 () (getstring "\nEnter some text: "))
  11. (setfunhelp "c:CMD3" "C:\\Program Files\\Autodesk\\AutoCAD 2013 Help\\English\\Help\\index.html")
  12.  
  13. ;; Displays a CHM file
  14. (defun c:CMD4 () (getstring "\nEnter some text: "))
  15. (setfunhelp "c:CMD4" "acet.chm" "html/BLOCKREPLACE")
  16.  

Each of the HTML and URL function that Lee posted, also fail, when I substitute for either a local HTML file (which FINDFILE returns a valid path for), or a URL that I can navigate to. Each return the errors posted above.
"How we think determines what we do, and what we do determines what we get."

HYPERPICS

  • Guest
Re: SetFunHelp Not Working
« Reply #3 on: July 26, 2012, 01:46:51 PM »
Do you know if Civial 3D 2011 uses a CHM file for its main help or Web Based Help?

I will track down the Civil 3D 2011 install, and see what is happening.

Thanks,
  Lee

BlackBox

  • King Gator
  • Posts: 3770
Re: SetFunHelp Not Working
« Reply #4 on: July 26, 2012, 02:00:27 PM »
Hi Lee; glad to see you here at TheSwamp!  :-)

Do you know if Civial 3D 2011 uses a CHM file for its main help or Web Based Help?

Yes, Civil 3D 2011 still uses .CMH help files, located:

<InstallFolder>\Help\civil_2011.chm

All calls to a valid .CHM using HELP, SETFUNHELP, and ACET-HELP functions work fine... I am only experiencing the undesired behavior when attempting to direct the F1 to HTML & URL.

I will track down the Civil 3D 2011 install, and see what is happening.

I greatly appreciate your time and effort, Lee. :beer:
"How we think determines what we do, and what we do determines what we get."

57gmc

  • Bull Frog
  • Posts: 366
Re: SetFunHelp Not Working
« Reply #5 on: July 26, 2012, 04:45:49 PM »
Is the chm not on the local pc? i.e. on the lan or www? Opening chm's from other locations other than local violates html security and gets blocked by ie. Because you're running a command from C3D, it could be masking the real problem. You said findfile locates the chm, but when you open it can you see content. Usually you can select topics from the TOC, but you get 404 errors in the content window.

BlackBox

  • King Gator
  • Posts: 3770
Re: SetFunHelp Not Working
« Reply #6 on: July 26, 2012, 04:49:07 PM »
Thanks for the reply 57gmc, but actually all is well when working with .CHM files.

To reiterate my earlier post(s), _only_ when attempting to work with an HTML file or a URL is there any issue.

Cheers! :beer:
"How we think determines what we do, and what we do determines what we get."

HYPERPICS

  • Guest
Re: SetFunHelp Not Working
« Reply #7 on: July 27, 2012, 03:12:08 PM »
I did some research on this.

As you mentioned, calling a HTML help does not seem to work with AutoCAD Civil 3D 2011 and I have verified that this is what I see as well.

The behavior that I mentioned in my posting does work with AutoCAD 2011 and later, and AutoCAD Civil 3D 2012 and later.

The one workaround that I can think of is to use an auto-redirect as part of a HTML page in the CHM file as soon below if you want to display a Website from the Help facility in AutoCAD Civil 3D 2011.

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<HTML>
<HEAD>
<meta HTTP-EQUIV="REFRESH" content="0; url=http://www.hyperpics.com">
<meta name="GENERATOR" content="Microsoft&reg; HTML Help Workshop 4.1">
<Title>Topic2</Title>
</HEAD>
<BODY>
&nbsp;

</BODY>
</HTML>