- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I tried to create a lisp to select a block and extract their name, but is annoying change osmode constantly and I can not find another selection method like this:
(defun getblockname ()
(setvar "osmode" 64) ;set osnap to insert
(setq pt1 (getpoint "\nPick text to edit: ")) ;get point on text
(Setvar "osmode" 0) ;set osnap back to zero
(setq entsspt1 (entget (ssname (ssget pt1) 0) )) ;get entity zero from prop.
(setq strname (assoc 1 entsspt1 )) ;get list containing string
(cdr strname ) ;extract string from prop.
)
Anyone could help me to edit the code to only select the object like:
1 click in the object
2 press enter
3 return name
Solved! Go to Solution.
Link copied