Jump to content

Find and Select blocks that have certain attributes via command line


liamdonnelly0209

Recommended Posts

Hi All.

 

I am trying to achieve the following:

for example... in 100 floor plans there are blocks that have certain attribute values. i want to be able to create a script/lisp that will find all blocks that include a certain piece of text ie "window" in the attribute value and change the block to a certain colour.

 

Essentially it is the same way that the "FIND" command works but via command line/lisp/script etc instead. This will be so i can apply this specific task without user input on the 100 floor plans.

 

Is there a way to do this as ive searched hundreds of terms/forums/ideas etc and came up with only find and replace tools or change all text in a drawing to certain colour.

 

Your help is greatly appreciated =]

Link to comment
Share on other sites

Lee you are an absolute Genius. And thank you for your very quick response, i didnt expect anyone to get this one in one go either =]

 

Thank you so much =]

Link to comment
Share on other sites

Now that it selects the blocks of the attribute i wanted, how would i change the colour of those blocks if i was to create a script to run on the drawings? as i am trying to essentially set up 100 drawings so when i reopen them i dont have to search for the blocks to change/work on as they have already been coloured. Thats the aim. So each week it could vary and the colour could change, so thats why i was hoping to vary them with different scripts per week. if that makes sense

Link to comment
Share on other sites

Your probably looking for a line like this

 

(vla-put-Layer obj "0") ; this is layer to "0"
;make it this 
(vla-put-Color obj "3") ; turn object to color "3"
;
;
(setq x ("\nEnter new color number:))
(vla-put-Color obj x)

Link to comment
Share on other sites

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