Announcements

The Autodesk Community Forums has a new look. Read more about what's changed on the Community Announcements board.

Assign block attribute value from text near the block

ionita_traian81
Participant

Assign block attribute value from text near the block

ionita_traian81
Participant
Participant

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?

0 Likes
Reply
Accepted solutions (2)
460 Views
3 Replies
Replies (3)

АлексЮстасу
Advisor
Advisor
Accepted solution

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

0 Likes

АлексЮстасу
Advisor
Advisor
Accepted solution

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

0 Likes

ionita_traian81
Participant
Participant

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.

0 Likes