Communicating with the AutoCAD session?

Started by nwgeo, October 17, 2007, 02:09:00 PM

Previous topic - Next topic

nwgeo

I am almost there using the DCL code.  What I am curious about is the communication between the DCL LISP code and the AutoCAD session.  I have a coordinate pair that I want to zoom to when the user presses the "ZoomTo" button.  However, when I press the button I get:

"error: invalid AutoCAD command: nil"



In my DCL code I have this in the "OnClicked" event for a command button:

(setq zoompt (list xval yval))
(command "zoom" "c" zoompt "")


I have tried sending this value to the Zoom command at the "Command" line, sending !zoompt as the coordinate pair, so I know that the value is correct.  Can I not send instructions to the AutoCAD while in "dialog box" mode?  Do I need to do some sort of special "SendCommand" request like when you try and execute a LISP command in a Visual Basic environment?

Very confusing :(



BazzaCAD

With a Model form No, with a Modeless form Yes. Also have a look at the "EventInvoke" property.
And take a look at the "Modeless" project in the "examples" folder for a demo of what you're trying to do.
a.k.a.
Barry Ralphs
barryDOTralphsATgmailDOTcom

nwgeo

#2
That did it!  Had to set EVERY command button's EventInvoke property to 1 though.  Now I just need to trap for all of the possible things a user might do when clicking on the dialog box.  Of course the machine might reboot, but I don't have any control over that...

Update: Okay, i finally posted something in the "Show and Tell" section under "Address based Zoom-To"  It's my first attempt at this.  I'm ready to install it tomorrow....