OpenDCL Forums

OpenDCL => Runtime/AutoLISP => Topic started by: jromkes on March 27, 2015, 01:00:51 PM

Title: dcl-Form-Close problem
Post by: jromkes on March 27, 2015, 01:00:51 PM
dcl-Form-Close gives me an error. It doesn't seems to close the Form.
See attachments for a simple lsp, odcl and dwg I try to insert in the drawing.

Regards Jaco Romkes
Title: Re: dcl-Form-Close problem
Post by: owenwengerd on March 27, 2015, 02:34:34 PM
Calling (command) from your button event handler fails because at that point the form is not yet closed and the command processor is not available. Move the (command) call to the main function immediately after (dcl-Form-Show) and it should work as you expect.
Title: Re: dcl-Form-Close problem
Post by: jromkes on March 28, 2015, 02:56:32 AM
Thanks for your answer.

It worked like this in AutoCAD 2014, the latest version I have been using. I have a few routines where I call the (command) right after the dcl-Form-Close and they all work fine in 2014 and before. There seems to be a change in this for AutoCAD 2015 and 2016.

I have to change a little bit of code.

Jaco

Title: Re: dcl-Form-Close problem
Post by: owenwengerd on March 28, 2015, 08:13:59 AM
AutoCAD 2015 eliminated fibers, so everything must now execute on the same fiber. In previous releases you could usually get away with this, but even then it is not guaranteed to work.