Jump to content

Recommended Posts

Posted

Is this the code to collect TEXT entities on the "0" layer with a text height of 1?

 

(ssget "_X" '((0 . "Text")(8 . "0")(40 . 1)))

 

I don't think it's right because I am not getting anything when something really is there.

 

Greg

Posted

Worked perfect for me tetsing on a real dwg different layer and height found 29 objects. Is it mtext ?

Posted
Worked perfect for me tetsing on a real dwg different layer and height found 29 objects. Is it mtext ?

 

 

in which case he could try :

(setq ss (ssget "_X" '((0 . "*text")(8 . "0")(40 . 1))))

 

 

Gr. Rlx

Posted

or maybe the value is 1-ish

 

using a range

 

(ssget '((0 . "*text")(8 . "0") (-4 . ">=") (40 . [b]1.0[/b]) (-4 . "<") (40 . [b]1.2[/b])))

Posted
or maybe the value is 1-ish

 

using a range

 

(ssget '((0 . "*text")(8 . "0") (-4 . ">=") (40 . [b]1.0[/b]) (-4 . "<") (40 . [b]1.2[/b])))

 

 

even better :geek:

 

 

Think it boils down that if someone has a question , post an example drawing along with your shopping list , oh I'm so sorry , I meant your own sample code :P

 

 

gr. Rlx

  • 2 weeks later...
Posted (edited)

I kept looking at this and couldn't see why it was not getting anything. The clue to me was that others of you were getting results on your tests, whereas I was getting "nil".

 

As it turned out it wasn't a TEXT entity at all. I looked at the entity closer and it was an ATTDEF entity.

 

So .... when I revised the code to ...

 

(setq ss (ssget "_X" '((0 . "AttDef")(8 . "0")(40 . 1))))

voila, I now get data.

 

Thanks everyone!

 

Greg

Edited by GregGleason
Posted

Now that you have explained it would be best to do

 

(setq ss (ssget "_X" '((0 . "AttDef,*text")(8 . "0")(40 . 1))))

Posted

Thank you BIGAL for the improvement. It helps me learn.

 

Greg

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