Jump to content

Count the number of times a text is repeated


Recommended Posts

Posted

Hello everybody, i would like to know if there is a way to create a kind of dynamic table where i can have counted a certain number of objects or text repeated on my drawing. For instance, if i had the text "GE1", i would like to know without count or run the command find, the number of times i have that text on my drawing, and of course to have that information up to date would be important, which means the information would change anytime i would copied or erased it.

thank you very much for your future answers 8)

Posted

You could use Qselect > Object type > Content; this will return the number of text entities with with the content you specify. It's not dynamic, you'd need to run it each time you want to know.

 

If you want to do a lisp program here's a start

(setq ss1 (ssget "X" '((0 . "*text") (1 . "GE1"))))
(princ (rtos (sslength ss1)2 0))

Posted

yeah, i knew that, and i could use the command find in order to count the number of times a specific text was on the drawing. Although i wanna know if there's a way to make it dynamic, i thought about attributes, creating a field, but i've never tested not even explored that to much.

thank you anyway

Posted

Maybe...

If you make a variable from the (sslength function, you could make a Field using LispVariable as the Field name. That would make it kinda dynamic, after an update. You'd still need to run the lisp every time though.

Maybe a Reactor...

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