AutoCAD Visual LISP / AutoLISP :: Multiple Ncopy From Xrefs.AutoCAD Visual LISP / AutoLISP :: Join Multiple Lines Together?.AutoCAD Visual LISP / AutoLISP :: Lengthen Multiple Polylines.AutoCAD Visual LISP / AutoLISP :: Area Of Multiple Objects.AutoCAD Visual LISP / AutoLISP :: Selecting Multiple Objects.AutoCAD Visual LISP / AutoLISP :: Scale Multiple 3D Polylines.AutoCAD Visual LISP / AutoLISP :: Add Multiple Hyperlinks On Objects.AutoCAD Visual LISP / AutoLISP :: Multiple Mirroring Lines.
Autocad lisp entsel nil update#
Autocad lisp entsel nil code#
The minimum amount of code to achieve what you want, could be something like this: You can also add things in the (and) function to check for other characteristics, such as whether it's on a locked Layer, and add appropriately to the prompt. Whether that's an advantage may depend on what else you need to do with it. The same could be done with (vla.) functions instead, but doing it this way eliminates the need to convert the Block to a vla object. Omit the (/= (logand). line if you don't need it limited to ordinary Blocks - your example would "pass" Xref's as well as ordinary Blocks, so maybe you don't need to make the distinction. (prompt "\nNothing selected, or it is not a Block - ") (/= (logand 4 (cdr (assoc 70 (tblsearch "block" (cdr (assoc 2 bdata)))))) 4) Not "better" necessarily, but another way to do it, with a combined try-again message: (princ "The object you selected is not a block.") (if (/= (vla-get-objectname csw-b1) "AcDbBlockReference") (setq csw-b1 (vlax-ename->vla-object (car csw-b1))) (setq CSW-B1 (entsel "\nSelect Block Instance: ")) I saw an old post and one looked way too simple and one looked way to complicated. Is there a better way to do this? I just want entsel to loop until the user selects a block and not error out if nothing is selected.