p7q Posted April 4 Posted April 4 Hello everybody, I need a selection set for flatten command. but ı have a list what include entity. So ı think to convert list to selection set. (setq objList '()) (while .... (if ... (setq objList (append (list obj) objList)) ) ) (setq selSet (ssadd)) (foreach ent objList (ssadd ent selSet) ) I used to this code but now not working. Where ı make a mistake? Can u help me? Quote
GLAVCVS Posted April 4 Posted April 4 Hi Without first knowing what's in 'objlist', it's difficult to know why its entities aren't included in the set. It's essential to know what the previous 'while' process is. In principle, if 'objlist' is a list of entity names, the code should work. Quote
p7q Posted April 7 Author Posted April 7 On 4/4/2025 at 3:36 PM, GLAVCVS said: Hi Without first knowing what's in 'objlist', it's difficult to know why its entities aren't included in the set. It's essential to know what the previous 'while' process is. In principle, if 'objlist' is a list of entity names, the code should work. here it is. Quote
GLAVCVS Posted April 7 Posted April 7 Then it should work. The only explanation should be in the part of your code that isn't visible from the 'while' loop. Quote
p7q Posted April 7 Author Posted April 7 I solved it now. The problem is that you do not use (sssetfirst nil ss) after (setq ss (ssget)) . Thank you for your interest @GLAVCVS Quote
p7q Posted April 8 Author Posted April 8 On 4/7/2025 at 11:16 AM, GLAVCVS said: I saw that it happened but it didn't happen again today and I can't find it. Could you please look again? (foreach ennt inBlock (setq entType (cdr (assoc 0 (entget ennt)))) (setq entName (cdr (assoc -1 (entget ennt)))) (if (member entType '("CIRCLE" "ARC" "ELLIPSE" "REGION")) (progn (ssadd ennt ssel) (ssadd entName ssel) ) (SetZZero ennt) ) ) Quote
GLAVCVS Posted April 8 Posted April 8 Assuming 'inBlock' is a list of non-VLA objects, it seems like it should work. The only thing is: 'ennt' and 'entName' are redundant. That is, you're trying to include the same object twice in the set. Quote
p7q Posted April 8 Author Posted April 8 (edited) I wanted to try both versions because I wanted to see the real version but neither one works Edited April 9 by p7q 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.