Hi, I have a problem with AutoCAD commands. On the TextButton1 OnClicked event I want to get a point from AutoCAD, for using it into a cylinder command. (setq p1 (getpoint)). After that I define a new point p2, which has the same X and Y coordinates, and the Z coordinate is with 20.0 smaller than the Z coordinate of p1. (setq p2 (list (nth 0 p1) (nth 1 p1) (- (nth 2 p1) 20.0))) . Next, I define a real value for the diameter of cylinder (setq d_val 10.0) , and then I write the CYLINDER command, which should generate a cylinder with this defined values and points.
(defun c:aaa_Form1_TextButton1_OnClicked (/)
(setq p1 (getpoint))
(setq p2 (list (nth 0 p1) (nth 1 p1) (- (nth 2 p1) 20.0)))
(setq d_val 10.0)
(command "cylinder" "D" d_val "a" p2)
)
At this moment a problem appears, saying that an AutoCAD command is wrong. If I run this LISP text without OpenDCL tools, it works.
How can I solve this?
Thanks.
Set your "Event Invoke" property on your button to = 1-Asynchronous
http://www.opendcl.com/HelpFiles/ENU/Reference/Property/EventInvoke.htm (http://www.opendcl.com/HelpFiles/ENU/Reference/Property/EventInvoke.htm)
Also, check out the "Selections" project in the Samples folder.
Thanks Barry.now it works.