OpenDCL Forums

OpenDCL => Runtime/AutoLISP => Topic started by: Ingo P on September 12, 2013, 05:06:51 AM

Title: OnDocActivated causes "no function definition"
Post by: Ingo P on September 12, 2013, 05:06:51 AM
It's me and my screenmenu again.

This time I stumbled upon a problem with the OnDocActivated Event of the non-modal dialog.
Whenever I open a new DWG-file while my screenmenu is active (I leave it visible all the time) The first message in the textscreen is
; Fehler: no function definition: C:SCREENMENU_SCREENMENU2_ONDOCACTIVATED
I'd guess this is cause because the screenmenu calls the event before AutoCAD has loaded the acad.lsp.

Is there a way to prevent this behavior?
Like postponing the event until Lisp has finished loading or something like that.

Kind regards

Ingo P
Title: Re: OnDocActivated causes "no function definition"
Post by: owenwengerd on September 12, 2013, 07:16:36 AM
Which version of AutoCAD?
Title: Re: OnDocActivated causes "no function definition"
Post by: Ingo P on September 12, 2013, 08:19:43 AM
Sorry

I forgot to mention it.

This behavior occurs in:

BricsCAD seems to be fine on this matter. (At least 13.2.9, which is the latest, I am currently running)

I'll try to find some time this weekend to review my code and then I will upload the menu to this board for all to use.
Title: Re: OnDocActivated causes "no function definition"
Post by: owenwengerd on September 12, 2013, 11:35:51 AM
After thinking about this, I vaguely recall that it was expected behavior that the OnDocActivated handler would only be called when existing documents are reactivated (hence acaddoc.lsp would need to handle the case of a newly created document). It gets a little tricky to ensure that the handler is not executed before acaddoc.lsp is finished loading, but I will investigate to see if the situation can be improved. At the very least it should be consistent between AutoCAD, Bricscad, and ZWCAD.