keep the ODCL box open while working on dwg?

Started by andrew, December 02, 2009, 11:07:39 AM

Previous topic - Next topic

andrew

is it possible to keep the ODCL box open and still work on a dwg?

BazzaCAD

a.k.a.
Barry Ralphs
barryDOTralphsATgmailDOTcom

andrew

ok i tried a palette form, the next question is
does it not like the use of (command "line") in the code?

example:


(defun c:Hello ()

(dcl_Project_Load "od-newpalette" T)

(dcl_Form_Show od-newpalette_Form1)
(princ)
)

(defun c:Untitled_Form1_TextButton1_OnClicked (/)

(command "line")
)


yields:
Loading...OPENDCL
Command: C:UNTITLED_FORM1_TEXTBUTTON1_ONCLICKED
Command: HELLO
Command:
Command: ; error: invalid AutoCAD command: nil

BazzaCAD

Set "Event Invoke" on the button to 1.

Quote
This property controls whether event handlers are called synchronously or asynchronously. A synchronous call causes the dialog code to wait until the event handler returns before resuming; an asynchronous event call allows the dialog code to continue running, and the event handler is not executed until AutoCAD is ready to process commands. This property is hidden and ignored for controls on modal forms.

Value Meaning
0 Synchronous
1 Asynchronous

Event handlers that are called synchronously are limited in what they can safely do, because they run while the dialog code is in a suspended state and AutoCAD is unable to process commands. For example, it is not possible to call the AutoLISP (command) function from a synchronous event handler.

Asynchronous event handlers in most cases will not execute until after the event that triggered it has passed, however an asynchronous event handler can safely call the AutoLISP (command) function to process AutoCAD commands. When a modeless dialog control's event handlers need to use the AutoLISP (command) function, the Event Invoke property for the control must be set to 1.

Any events that have return values are always called synchronously (otherwise the return value would be lost). Events called from modal forms are always called synchronously, since modal forms by their nature prevent AutoCAD from executing commands while they are active. Event handlers in these cases must conform to the requirements for synchronous events regardless of the Event Invoke property setting.

a.k.a.
Barry Ralphs
barryDOTralphsATgmailDOTcom