Lisp or Program to find and replace part of attribute/prompt value

Lisp or Program to find and replace part of attribute/prompt value

reb0265
Contributor Contributor
462 Views
5 Replies
Message 1 of 6

Lisp or Program to find and replace part of attribute/prompt value

reb0265
Contributor
Contributor

Still learning with these lisp routines and been trying to figure out how to do a batch find and replace for only part of a block tag value.

The goal is to take "~UI=FCC ~EI=PIPE GO ~CI=GO030" from PCMS-ID Point ID value and replace it with "~UI=FCC ~EI=PIPE GO-002 ~CI=GO-002"

And if I can automate this to pull from an excel document that would be even better!

I cant seem to get any find and replace tools to go into this attribute value... Any suggestions of where to look? Been playing with a Lee Mac batch attribute editor but I don't think these attributes are the same.


reb0265_1-1721149949140.png

 

 

 

 

0 Likes
463 Views
5 Replies
Replies (5)
Message 2 of 6

pendean
Community Legend
Community Legend
I don't have access to your drawings but does FIND command help do that?
0 Likes
Message 3 of 6

reb0265
Contributor
Contributor

I am officially an idiot... I had "ignore hidden items checked the first 3 or 4 times I tried this. Let me play with it a bit and see if I can work in pulling the find/replace functions with an excel spreadsheet. @vladimir_michl 
Any chance your lookupXLS will work with this? Tried that first but couldn't get it to look at the hidden items.

0 Likes
Message 4 of 6

Sea-Haven
Mentor
Mentor

You can read an Excel cell no problems, so could do something like Blockname Att-tagname new-value old-value

 

The issue is how to select the correct block if its inserted multiple times. Using old-value may be the way to go.

 

Need a dwg and a Excel, Please post.

0 Likes
Message 5 of 6

reb0265
Contributor
Contributor

They are all on a single layer, but they should be unique enough to be able to search all attributes and be able to find them. I tried doing the find function with the "include hidden items" and these attributes will show up, but only when I click on include wildcards.


I white washed a dwg for you to get an idea of what I am working with. The excel document has the only pair relevant for this specific document, but goal would be to run this on hundreds of DWG's and only have to populate the excel sheet.

As a note I am trying to replace part of the value not the entire thing.

0 Likes
Message 6 of 6

vladimir_michl
Advisor
Advisor

The existing srxText utility (its SRXTEXTCSV command) can perform this type of replacements driven by an Excel table. Id doesn't matter if the attribute is visible or not.

 

Vladimir Michl, www.arkance.world  -  www.cadforum.cz

 

 

0 Likes