(car (entsel)) Posted October 14, 2016 Posted October 14, 2016 Hi, This thread is not about (nentsel), but for similair functionality. I try to use this: (cdr (assoc 0 (entget (ssname (ssget "_+.:E:S:L:N") 0)))) Which should mean: "select single entity, on unlocked layer, nested" So I select a nested LWPOLYLINE inside of a block, and it returned "INSERT". How come? Quote
Roy_043 Posted October 15, 2016 Posted October 15, 2016 RTM: the main entity is also added to the set. Quote
Grrr Posted October 15, 2016 Posted October 15, 2016 ssnamex is the answer: ; Alternative of (nentsel) (defun C:test ( / SS Lst ) (while (not (setq SS (ssget "_+.:E:S:L:N"))) SS) (setq Lst (vl-remove-if-not '(lambda (x) (= 'ENAME (type x))) (apply 'append (ssnamex SS)))) (mapcar '(lambda (x) (cdr (assoc 0 (entget x)))) Lst) ) Example: ("LWPOLYLINE" "INSERT") ; prints after selecting nested LWpolyline ("LINE" "INSERT" "INSERT") ; prints after selecting nested line within a nested block 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.