ahyin Posted July 29, 2010 Share Posted July 29, 2010 Hi All, I'm new in autolisp I don't know how to select all visible objects by lisp. If I use ssget "x", it will select all objects included all invisible objects. forgive me bad English. Quote Link to comment Share on other sites More sharing options...
MSasu Posted July 29, 2010 Share Posted July 29, 2010 The undocumented "A" filter will allow you to all entities that aren’t placed in frozen layers. (ssget "_A") Regards, Quote Link to comment Share on other sites More sharing options...
ahyin Posted July 29, 2010 Author Share Posted July 29, 2010 Thank you for your reply, but if I have already turn off all layer except the entities I need to select by lisp Can you teach me how to do that ? The undocumented "A" filter will allow you to all entities that aren’t placed in frozen layers. (ssget "_A") Regards, Quote Link to comment Share on other sites More sharing options...
MSasu Posted July 29, 2010 Share Posted July 29, 2010 Try to run the above code on Console - it will return a selection set with all entities stored in layers that are thawed. The on/off status is ignored. To filter out also entities that are stored in layers turned off you may have to parse the selection set and check the state of their layer. To do that, take a look on ENTGET function. Regards, Quote Link to comment Share on other sites More sharing options...
ahyin Posted July 30, 2010 Author Share Posted July 30, 2010 Thank you ! I will try. Try to run the above code on Console - it will return a selection set with all entities stored in layers that are thawed. The on/off status is ignored. To filter out also entities that are stored in layers turned off you may have to parse the selection set and check the state of their layer. To do that, take a look on ENTGET function. Regards, Quote Link to comment Share on other sites More sharing options...
hunszab Posted July 30, 2010 Share Posted July 30, 2010 Hi all! How can I select every object that is in a specific point? To be more specific... I have blocks, so they have just one point. And I want to select a block that point is i.e. (0,0) or (x,y). So how can I do that? Thanks any help Quote Link to comment Share on other sites More sharing options...
MSasu Posted July 30, 2010 Share Posted July 30, 2010 This will select all block type entities that are inserted in a given point: (ssget "_X" (list '(0 . "INSERT") (cons 10 thePointCoords))) Regards, Quote Link to comment Share on other sites More sharing options...
hunszab Posted July 30, 2010 Share Posted July 30, 2010 (edited) I've tried, but doesnt work... Always returns NIL. Edited July 30, 2010 by hunszab Quote Link to comment Share on other sites More sharing options...
hunszab Posted July 30, 2010 Share Posted July 30, 2010 I've tried, but doesnt work... Always returns NIL. Any help?! Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted July 30, 2010 Share Posted July 30, 2010 I've tried, but doesnt work...Always returns NIL. Any help?! Which means that the item you are trying to select does not fit the filter list - you may need to include a tolerance. I'm also getting seriously fed up of your double posts. Quote Link to comment Share on other sites More sharing options...
ahyin Posted August 2, 2010 Author Share Posted August 2, 2010 Hi msasu, I try to use (ssget "_a") to select the objects but it will select all objects included objects in others layer which if already off. Because I just want to select all in current and visible objets. Is there any others method to select it ? Thank you for your help ! Try to run the above code on Console - it will return a selection set with all entities stored in layers that are thawed. The on/off status is ignored. To filter out also entities that are stored in layers turned off you may have to parse the selection set and check the state of their layer. To do that, take a look on ENTGET function. Regards, Quote Link to comment Share on other sites More sharing options...
MSasu Posted August 2, 2010 Share Posted August 2, 2010 As already told you, there is now selection method for SSGET function to filter out automatically entities if off state layers – at least I don’t know one. The only solution I can suggest to accomplish that is the one that already suggested above – filter out entities in frozen layer by using "_A" method instead of "_X" and after parse the selection set (SSLENGTH & SSNAME), get the layer name for each entity (ENTGET), check the state of that layer (TBLOBJNAME & ENTGET) and remove from selection set (SSDEL) those items that reside in layers that are set off. Regards, Quote Link to comment Share on other sites More sharing options...
ahyin Posted August 3, 2010 Author Share Posted August 3, 2010 Thank you so much for your help, I will try to use the above function to get any entities I want. As already told you, there is now selection method for SSGET function to filter out automatically entities if off state layers – at least I don’t know one.The only solution I can suggest to accomplish that is the one that already suggested above – filter out entities in frozen layer by using "_A" method instead of "_X" and after parse the selection set (SSLENGTH & SSNAME), get the layer name for each entity (ENTGET), check the state of that layer (TBLOBJNAME & ENTGET) and remove from selection set (SSDEL) those items that reside in layers that are set off. Regards, Quote Link to comment Share on other sites More sharing options...
ahyin Posted August 3, 2010 Author Share Posted August 3, 2010 Hi msasu, I want to select all circle in current layer, is there any method to do that ? (setq sset (ssget "_a" (LIST '(0 . "CIRCLE") (cons 410 (getvar "CTAB"))))) Thanks ! As already told you, there is now selection method for SSGET function to filter out automatically entities if off state layers – at least I don’t know one.The only solution I can suggest to accomplish that is the one that already suggested above – filter out entities in frozen layer by using "_A" method instead of "_X" and after parse the selection set (SSLENGTH & SSNAME), get the layer name for each entity (ENTGET), check the state of that layer (TBLOBJNAME & ENTGET) and remove from selection set (SSDEL) those items that reside in layers that are set off. Regards, Quote Link to comment Share on other sites More sharing options...
MSasu Posted August 3, 2010 Share Posted August 3, 2010 The current layer is stored in CLAYER system variable: (ssget "_A" (LIST '(0 . "CIRCLE") (cons 8 (getvar "CLAYER")))) Regards, Quote Link to comment Share on other sites More sharing options...
ahyin Posted August 3, 2010 Author Share Posted August 3, 2010 Thank you so much, I can select all objects right now ! The current layer is stored in CLAYER system variable: (ssget "_A" (LIST '(0 . "CIRCLE") (cons 8 (getvar "CLAYER")))) Regards, Quote Link to comment Share on other sites More sharing options...
MSasu Posted August 3, 2010 Share Posted August 3, 2010 You're welcome! Glad to help you. Regards, 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.