Jump to content

Recommended Posts

Posted

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.

Posted

The undocumented "A" filter will allow you to all entities that aren’t placed in frozen layers.

 

(ssget "_A")

 

 

Regards,

Posted

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,

Posted

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,

Posted

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,

Posted

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

Posted

This will select all block type entities that are inserted in a given point:

 

(ssget "_X" (list '(0 . "INSERT") (cons 10 thePointCoords)))

 

Regards,

Posted (edited)

I've tried, but doesnt work...

Always returns NIL.

Edited by hunszab
Posted

I've tried, but doesnt work...

Always returns NIL.

 

Any help?!

Posted
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.

Posted

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,

Posted

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,

Posted

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,

Posted

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,

Posted

The current layer is stored in CLAYER system variable:

 

(ssget "_A" (LIST '(0 . "CIRCLE")
                  (cons 8 (getvar "CLAYER"))))

 

 

Regards,

Posted

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,

Posted

You're welcome! Glad to help you.

 

Regards,

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...