How to add and read some extra definitions to line object with VBA?

How to add and read some extra definitions to line object with VBA?

mucip
Collaborator Collaborator
978 Views
2 Replies
Message 1 of 3

How to add and read some extra definitions to line object with VBA?

mucip
Collaborator
Collaborator

Hi,

We may add extra definitions to part or assembly in the Inventor like price or strength values.

Is there like this posibility in AutoCAD to attach extra information to line objects?

I have lines on the drawing and I want to add diameter definitions on the line objects. For instance one line must have "Ø100 mm pipe" definitions and other must have "Ø250 mm pipe" definition.

In this case I can calculate all the diameters and length of the pipes from drawing. Because I draw only one line from point to another point in 2D. But I need to know specifications of the pipe.

 

Is this possible with VBA?

 

Regards,

Mucip:)

0 Likes
Accepted solutions (1)
979 Views
2 Replies
Replies (2)
Message 2 of 3

norman.yuan
Mentor
Mentor
Accepted solution

Extra data can be attached/associated to any AutoCAD entity, be it Line, or Circle, or whatever.... If you use plain AutoCAD, you can use ExtensionDictionary, or XData. If you use AutoCAD verticals, such as Acad Arch/MEP/C3D/Map, besides ExtensionDIctionary/XData, there are also other ways to link extra data attributes to an entity: PropertyDataSet, ObjectData, Classification... (some of them, like PropertyDataSet, is not accessible via VBA, though). 

 

For simplicity, XData might be easiest with VBA. You can look up VBA document for GetXData()/SetXData() methods.

 

Norman Yuan

Drive CAD With Code

EESignature

0 Likes
Message 3 of 3

mucip
Collaborator
Collaborator

Hi Mr. @norman.yuan 

Yes, That's what I want sure.

I use plain AutoCAD. I will fallow XDATA then. May I assign XDATA attributes to any kind of entitiy like line or circle inner AutoCAD session also?

 

I will search on this.

 

Kind regards,

Mucip:)

0 Likes