AutoCAD Map 3D Forum
Welcome to Autodesk’s AutoCAD Map 3D Forums. Share your knowledge, ask questions, and explore popular AutoCAD Map 3D topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Assign block attribute value from text near the block

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
ionita_traian81
288 Views, 3 Replies

Assign block attribute value from text near the block

The attached example is a small portion of a map with tens of thousands of such connections; the connection block is the yellow circle and it has attributes attached to it. Is it possible to have the blocks automatically update the H_NUMBER attribute within the block from the nearest DTEXT Content field, assuming it's always the house number?

3 REPLIES 3
Message 2 of 4

ODEDIT (through 2019) will do that:
1. Create Object Data for house numbers. Let's say OD "home" with the character field "num". ADEDEFDATA.
2. Attach these ODs to the "conn" blocks. ADEATTACHDATA or ODEDIT_ADEATTACHDATA
3. Load the content of the nearest Texts into OD - Set from text, ODEDIT_SETTEXT.
set_from_text.png

4. Make txt of block-attribute --> OD-field correspondences - see home_num.txt.
5. Assign avalue from the OD field to an attribute - Upload to attributes, ODEDIT_STORE_ATTRS.

upload_to_attributes.png

(For illustration purposes, I made the H_NUMBER attribute visible)


-- Alexander, private person, pacifist, english only with translator 🙂 --

Object-modeling _ odclass-odedit.com _ Help

Message 3 of 4

For any AutoCAD, can use XDLabel and XDTOOLS - not on OD, but on XData.
Similarly:
1. Create an XData definition - XDTOOLS_MDEFINE.
2. Attach these XData to the desired objects - XDTOOLS_ADD.
3. Link inscriptions and objects - XDLABEL_LINK. The content of the inscriptions located within the specified tolerance will be loaded into the XData field.
2. Transfer the content of the XData field to the attribute - XDTOOLS_2ATTR.

 

XDLabel has advantages:
1. Not only Text, but also MText, Leader, MLeader can be linked to objects.
2. Can link inscriptions to objects of many types. For example, can associate the nearest MLeader with _facade_cable polylines. Etc.
3. The created connection is maintained - when moving an object, when changing its shape, the inscriptions after XDLABEL_UPDATE will be moved accordingly.

 

XData can be converted to OD if necessary - CADaSchtroumpf had programs for this. Or XData can be uploaded to csv. And from csv can load it to OD.

 


-- Alexander, private person, pacifist, english only with translator 🙂 --

Object-modeling _ odclass-odedit.com _ Help

Message 4 of 4

You're a saint; I've yet to try the solutions since we're in holiday (1st of May and now Easter) but you're giving me high hopes it can be done. As soon as I return to the computer I'll give both solutions a try and let you know how it goes.

Thanks!!

 

EDIT: It works! XDTOOLS does it for me, ODEDIT does not work on my version of Autocad.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Technology Administrators


Autodesk Design & Make Report