Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations IDS on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding Attributes data to drawings - VBA

Status
Not open for further replies.

zimGirl

Geotechnical
Jul 22, 2004
30
I have several text files that I have been using to draw in AutoCAD(Programmatically - VBA). They have several other attributes that I would like to include with the drawings from these files.

I have been reading up on using blocks to attach attributes, but this does not seem to be what I want. There are for e.g. several lines with diffirent attributes like road name, location, nearest intersection, etc, that need to be attached to different lines through out the drawing.
Are there ways to do this? Please help and thanks in advance.
 
Replies continue below

Recommended for you

Probably, the two most accessible ways are attributes(like you mentioned) or extended entity data (xdata). Xdata actually becomes part of the entity definition but is only accessible programmatically for the most part.

"Everybody is ignorant, only on different subjects." — Will Rogers
 
is there a way then to make the attributes accessible as that is what I need.
 
Attributes are created "inside" blocks. To attach an attribute, you create an Attribute Definition, place it somewhere and then create a block (using your line(s), or other entities) and including the Attribute Definitions along with the block. When you insert the block, the attributes can be prompted for or you can access them by double-clicking on the block. You can also access them through vb code. Keep in mind, the entities need to become blocks for this to work. The other method I mentioned is to "add" information to the line(s), by way of extended data. You have to create routines to access this data.

These links may help...




"Everybody is ignorant, only on different subjects." — Will Rogers
 
thanks borgunit , i will check that out.
 
You might be interested in the solution I found on how to easily insert object data.
In you VB editor on a form( or Module) go to Tool and add the AutoCAD Map reference(Depending on the version, Mine was Map 6 - AutoCAD Map 2000i Realease 4.5).
This gives you all the object data tools necessary to create attached data.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor