×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Adding Attributes data to drawings - VBA

Adding Attributes data to drawings - VBA

Adding Attributes data to drawings - VBA

(OP)
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.

RE: Adding Attributes data to drawings - VBA

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

RE: Adding Attributes data to drawings - VBA

(OP)
is there a way then to make the attributes accessible as that is what I need.

RE: Adding Attributes data to drawings - VBA

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...

http://www.afralisp.com/vba/attabvba.htm

http://www.afralisp.com/lisp/dict.htm

http://www.afralisp.com/lispa/lisp21.htm

"Everybody is ignorant, only on different subjects." — Will Rogers

RE: Adding Attributes data to drawings - VBA

(OP)
thanks borgunit , i will check that out.

RE: Adding Attributes data to drawings - VBA

(OP)
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.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources