Extract from text string to attribute values.

Extract from text string to attribute values.

Anonymous
Not applicable
3,998 Views
23 Replies
Message 1 of 24

Extract from text string to attribute values.

Anonymous
Not applicable

I am trying to search a single text string and extract values to "paste" into attribute values in a block.

 

Text string example: "PoleNumber=3-146592$Owner=APCO$Attachment1=57'-4"

 

Is it possible to search out PoleNumber=, retrieve the 3-146592 and populate an attribute value for PoleNumber based on each search criteria? As in, then search for Owner= and populate attribute Owner with APCO?

 

I feel like this is possible but have no idea how to begin to achieve this. Any help would be greatly appreciated.

0 Likes
Accepted solutions (2)
3,999 Views
23 Replies
Replies (23)
Message 21 of 24

Moshe-A
Mentor
Mentor

@Anonymous ,

 

you must be doing something wrong, if you made changes to code reverse it back 

it's working perfect here

 

 

0 Likes
Message 22 of 24

Anonymous
Not applicable

That worked perfectly. Thank you.

 

I guess now I'm going to be greedy and ask... If I now have "Attachment1=57'-4"$Attachment2=$Attachment3=54'-2" " is there a way to bypass empty "fields" an continue extracting the rest of the text? If I'm asking too much, I'm sorry and do appreciate what you've given already.

0 Likes
Message 23 of 24

dlanorh
Advisor
Advisor
Accepted solution

Attached is an updated lisp to handle no field => Attachment1=57'-4"$Attachment2=$Attachment3=54'-2" 

 

where the is nothing between the "=" and the following "$". This would have returned a sub list of length 1 which is now filtered out.

 

Again I have not tested on your drawing as I can only open drawing in AutoCAD 2010 or earlier.

 

Hope this meets your need.

 

I am not one of the robots you're looking for

0 Likes
Message 24 of 24

Anonymous
Not applicable

Works fabulously. Thank you so much.

0 Likes