Nikon Posted 2 hours ago Posted 2 hours ago (edited) I would like to see the frame when drawing the rectangle, as in the standard autocad command. If you only call the RECTANGLE command without passing points to it, then AutoCAD will enable the standard interactive construction. If you remove from the line (command "_.RECTANGLE" p1 p2) p1 and p2 (command "_.RECTANGLE"), then the code does not work further, that is, the cloud is not drawn. (defun c:RectRevClCol (/ p1 p2 ssRect ssCloud) (prompt "Specify the first point of the rectangle: ") (setq p1 (getpoint)) (prompt "Specify the opposite point of the rectangle: ") (setq p2 (getpoint p1)) (command "_.RECTANGLE" p1 p2) (setq ssRect (ssget "_L")) (if ssRect (progn (command "_REVCLOUD" "_Object" ssRect "" "_ArcLength" "500" "") (setq ssCloud (ssget "_L")) (if ssCloud (command "_.CHPROP" ssCloud "" "_Color" "2" "") ) ) ) (princ) ) Edited 2 hours ago by Nikon Quote
rlx Posted 1 hour ago Posted 1 hour ago or instead of using (setq p2 (getpoint p1)) try (setq p2 (getcorner p1)) 1 Quote
Nikon Posted 37 minutes ago Author Posted 37 minutes ago (edited) 26 minutes ago, rlx said: or instead of using (setq p2 (getpoint p1)) try (setq p2 (getcorner p1)) Super! Right in the bull's-eye! Thanks! **** (defun c:RectRevClCol (/ p1 p2 ssRect ssCloud) (prompt "Specify the first point of the rectangle: ") (setq p1 (getpoint)) (prompt "Specify the opposite point of the rectangle: ") (setq p2 (getcorner p1)) ; *** rlx (command "_.RECTANGLE" p1 p2) (setq ssRect (ssget "_L")) (if ssRect (progn (command "_REVCLOUD" "_Object" ssRect "" "_ArcLength" "500" "") (setq ssCloud (ssget "_L")) (if ssCloud (command "_.CHPROP" ssCloud "" "_Color" "2" "") ) ) ) (princ) ) Edited 36 minutes ago by Nikon Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.