Jakub Posted September 24, 2015 Share Posted September 24, 2015 Hi, I'm searching a lisp that selecting layers by them name. As an example I give some names: AAA_BBB_xxx AAA_BBB_xxy AAA_BBB_xyz I need to select all layers that names start as AAA_BBB. The third part of name is changing. In this case I'd like to select only this layers that name has AAA_BBB. How can I do this? Thank you for any suggestions in advance. Jakub Quote Link to comment Share on other sites More sharing options...
Tharwat Posted September 24, 2015 Share Posted September 24, 2015 Try. (setq sel (ssget "_:L" '((8 . "AAA_BBB*")))) Quote Link to comment Share on other sites More sharing options...
BIGAL Posted September 25, 2015 Share Posted September 25, 2015 Do you need a lisp ? FILTER, select object, edit layer name, AAA_BBB* selects all layers that start with AAA_BBB Quote Link to comment Share on other sites More sharing options...
BIGAL Posted September 25, 2015 Share Posted September 25, 2015 2nd suggestion pick object then "how many characters to match" for above its 7 then substr and use Tharwats suggestion. ; bit rough but for testing (setq obj (vlax-ename->vla-object (car (entsel)))) (setq lay (vla-get-layer obj) ) (alert (strcat "You have picked layer " lay "Enter number of characters next step")) (setq num ("Enter number of characters")) (setq str (strcat (substr lay 1 num) "*" )) (setq sel (ssget "_:L" (list (cons 8 str)))) Quote Link to comment Share on other sites More sharing options...
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.