lastknownuser Posted July 9 Posted July 9 1 hour ago, lastknownuser said: I don't understand why this VERTEX entmake, and it probably adds it in selection set but doesn't create it, so can't copy it therefore it gives error Oh you are creating a polyline that way...still the same problem and probably the solution. For example and what I tested only is this polyline creation part, lets say you have 6 pntucssort points, you are creating vertices and then you create polyline. The way you are creating your selection set of all created objects after profile_lastEnt, profile_ss has length of 7 (6 vertices and polyline). But you want to copy only polyline, can't copy vertices therefore the error. So you need to make selection set only with objects that are actually created and can be copied. So after creating each object (polyline, and later blocks and texts if I saw correctly) add that (entlast) to selection set. Or you could filter the selection set before ctd function to remove vertices, but I would filter them as objects are created, so after each object created put this: (setq obj (entlast)) (ssadd obj profile_ss) 1 Quote
Tomislav Posted July 9 Author Posted July 9 to lega! that really worked, didn't know it adds vertices+poly in ss, so in other part in lisp where i have more objects created after poly it iterates normally , but when it's just poly you have to account for vertices, thank you 1 Quote
Tomislav Posted July 9 Author Posted July 9 now i'm not sure how to delete poly in original drawing after copying , tried (entdel (entlast)), (entdel obj), even used this function and called it (entdel(lastent)) but nothing works (defun lastent (/ a b) (if (setq a (entlast)) ;Gets last main entity (while (setq b (entnext a)) ;If subentities follow, loopsuntil there are no more (setq a b) ;subentities ) ) a ;Returns last main entity ) ;or subentity Quote
Tomislav Posted July 9 Author Posted July 9 solved it with (command "._erase" (entlast) "") once again the easiest thing is the solution thank you all for contributing! 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.