Strange behaviour of OpenDCL in ZWCAD2023

Started by JustCurious, June 03, 2023, 02:37:19 AM

Previous topic - Next topic


Hi there,

I have installed a trial version of ZWCAD2023 an I am running the latest OpenDCL ZRX runtime extension as well.
During this trial period I try to find out if my programs will run in ZWCAD.

My OpenDCL project contains a slide image, when I click on it I want something to happen.

This piece of code works:
(defun c:Test/Form1/SlideView1#OnClicked (/)
(dcl-MessageBox "To Do: code must be added to event handler\r\nc:Test/Form1/SlideView1#OnClicked" "To do")

I do get the Alert dialog which tells me the slide-on-clicked does work.

Now if I replace that code with this, then nothing happens:
(defun c:Test/Form1/SlideView1#OnClicked (/)
(command "_.linetype" "_load" "myLinetypeName" "myCustomLinetypeFile.lin" "")

If I just copy the line of actual code into the commandbar it works:
(command "_.linetype" "_load" "myLinetypeName" "myCustomLinetypeFile.lin" "")
The variables "myLinetypeName" and "myCustomLinetypeFile.lin" are set properly.

Why does ObjectDCL not invoke the command?
Any ideas on this one? Thanks in advance.

Fred Tomke

Hi, is it a modal form? Then it will not work within an event. If it is a modeless form or a palette, it will only work when in the control the property event invoke is set to allow command.
AutoCAD needs full access to the database. And that is not the case in a modal form or a modeless form with keep focus in event invoke.
With regards, fred
Fred Tomke
Dipl.-Ing. (FH) Landespflege

[ landscaper - landscape developer - digital landscape and urban design]


Hi Fred,

Thanks for the reply.

It is a palette, the event is checked therefore the (dcl-MessageBox "To do: .... is working. Just not the command inside the defun. I have decided to part from Odcl, at least for this part of my journey.

Have a great weekend!