General command for tools to wait for cursor input?
Let say I want to draw a red revcloud (red is not color of bylayer)
Then I can change command for that tool to be
^c^c-color;red;revcloud;r
Works just fine but after drawing that cloud, I want color to be BYLAYER.
How can I set that in the command for this button?
Then I can change command for that tool to be
^c^c-color;red;revcloud;r
Works just fine but after drawing that cloud, I want color to be BYLAYER.
How can I set that in the command for this button?
0
Comments
-
I don't use those command macros, but it looks like they can include lisp functions. This one pauses for user input:
(while (> (getvar "cmdactive") 0) (command pause))
0 -
Yes lisp functions works but I think there must be just that, not a combo.0
-
Rather than set the default color to red before creating the revcloud, I suggest create the revcloud first. Then use the Chprop command and the "L" or "Last" to select the last object that was created.
I have not tested this as a macro, but here is how I suspect it would be written.
^c^cRevcloud;;Chprop;Last;;Color;Red;;
-Joe0 -
Thanks but I still need to wait while I draw a rectangle
Specify first corner point or [Arc length(Arc)/Entity/Rectangular/Polygonal/Freehand/Style] :Chprop:Last
Unable to recognize entry. Please try again.
0 -
The other things you want to include are easy in Lisp. For example,Mikael63 said:Yes lisp functions works but I think there must be just that, not a combo.
(command "revcloud")
.
You can test any lisp function by typing it on the command line. Or copy and paste it in.0 -
LISP to draw a red revision cloud.
(defun C:REDCLOUD ( / odoc) (setq odoc (vla-get-activedocument (vlax-get-acad-object))) ; retrieve active document (vla-endundomark odoc) (vla-startundomark odoc) ; set undo mark (acet-error-init '(("CECOLOR" "1" ) nil nil)) ; set error handler and set colour to red (command "._REVCLOUD") (while (> (getvar "CMDACTIVE") 0) (command pause)) (acet-error-restore) ; restore error (vla-endundomark odoc) ; close undo mark (prin1) )
Regards,
Jason Bourhill
BricsCAD V22 Ultimate
CAD Concepts0 -
Works perfect!Jason Bourhill said:LISP to draw a red revision cloud.
(defun C:REDCLOUD ( / odoc) (setq odoc (vla-get-activedocument (vlax-get-acad-object))) ; retrieve active document (vla-endundomark odoc) (vla-startundomark odoc) ; set undo mark (acet-error-init '(("CECOLOR" "1" ) nil nil)) ; set error handler and set colour to red (command "._REVCLOUD") (while (> (getvar "CMDACTIVE") 0) (command pause)) (acet-error-restore) ; restore error (vla-endundomark odoc) ; close undo mark (prin1) )
Regards,
Jason Bourhill
BricsCAD V22 Ultimate
CAD Concepts
Thanks!0