TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Lastknownuser on May 19, 2022, 07:24:21 AM
-
Hi! Maybe its a stupid question, but I can't figure it out. Can I draw rectangle for example, and get entity list of it right after drawing it? Instead of first drawing rectangle and then using LISP functions (entget (car (entsel))), is it possible to do all in LISP, first be asked to draw something and then right after drawning it, get and store its entity list? Thanks for any help
-
-
I treied, it's not working for me at least not how I run it. Here is the simple code, it saves "ent" the last entity I drew before starting the TEST command
(defun c:test ()
(command "_.RECTANG")
(setq ent (entlast))
)
-
I treied, it's not working for me at least not how I run it. Here is the simple code, it saves "ent" the last entity I drew before starting the TEST command
(defun c:test ()
(command "_.RECTANG")
(setq ent (entlast))
)
Your rectangle command isn't completed and so isn't created yet.
use the following
(command "_.RECTANGLE" pt1 pt2
) ;with defined points (command "_.RECTANGLE" pause pause
) ;user selects points (command "_.RECTANGLE" "0,0" "4,6") ;create a rectangle in defined location
(command "_.RECTANGLE" pause pause
) )
-
I treied, it's not working for me at least not how I run it. Here is the simple code, it saves "ent" the last entity I drew before starting the TEST command
(defun c:test ()
(command "_.RECTANG")
(setq ent (entlast))
)
Your rectangle command isn't completed and so isn't created yet.
use the following
(command "_.RECTANGLE" pt1 pt2
) ;with defined points (command "_.RECTANGLE" pause pause
) ;user selects points (command "_.RECTANGLE" "0,0" "4,6") ;create a rectangle in defined location
(command "_.RECTANGLE" pause pause
) )
Oh right, I understand...thanks!