Code Red > AutoLISP (Vanilla / Visual)

Make (entlast) work like (entsel)

<< < (2/2)

roy_043:
@GDF:
Why don't you use:

--- Code: ---(list (entlast) pt1)
--- End code ---
instead of:

--- Code: ---(list (lastline) mid)
--- End code ---
?

--- Code - Auto/Visual Lisp: ---(defun C:WW2 ( / entselLst pt1 pt2 pt3)  (ARCH:F_S-VAR)  (setq pt1 (getpoint "\n* Pick beginning point *"))  (setq pt2 (getpoint pt1 "\n* Pick the end point *"))  (command "_.line" pt1 pt2 "")  (setq entselLst (list (entlast) pt1))  (setq pt3 (getpoint "\n* Specify offset direction --> "))  (command "_.offset" "3.5" entselLst pt3 "")  (ARCH:LYR "A-WALL-FULL")  (command "_.chprop" "_last" "" "_layer" "A-WALL-FULL" "")  (command "_.offset" "9.0" entselLst pt3 "")  (ARCH:LYR "A-WALL-EXT")  (command "_.chprop" "_last" "" "_layer" "A-WALL-EXT" "")  (ARCH:F_R-VAR)  (princ))

GDF:

--- Quote from: roy_043 on April 29, 2017, 04:53:33 AM ---@GDF:
Why don't you use:

--- Code: ---(list (entlast) pt1)
--- End code ---
instead of:

--- Code: ---(list (lastline) mid)
--- End code ---
?

--- Code - Auto/Visual Lisp: ---(defun C:WW2 ( / entselLst pt1 pt2 pt3)  (ARCH:F_S-VAR)  (setq pt1 (getpoint "\n* Pick beginning point *"))  (setq pt2 (getpoint pt1 "\n* Pick the end point *"))  (command "_.line" pt1 pt2 "")  (setq entselLst (list (entlast) pt1))  (setq pt3 (getpoint "\n* Specify offset direction --> "))  (command "_.offset" "3.5" entselLst pt3 "")  (ARCH:LYR "A-WALL-FULL")  (command "_.chprop" "_last" "" "_layer" "A-WALL-FULL" "")  (command "_.offset" "9.0" entselLst pt3 "")  (ARCH:LYR "A-WALL-EXT")  (command "_.chprop" "_last" "" "_layer" "A-WALL-EXT" "")  (ARCH:F_R-VAR)  (princ))
--- End quote ---

GDF:
Thanks Roy

BIGAL:
GDF for future reference (entget (entlast)) will get the last entity but you did not save it to a variable so you can use it, (setq lline (entget (entlast))). But like Lee its the last entity created so you must remember to do it straight after making an entity that you know what type it is.

GDF:
Thanks

Navigation

[0] Message Index

[*] Previous page

Go to full version