Message 1 of 3
editing attribute set of an imported AutoCAD Block
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi
I imported the company Title Block to my Drawing file inside Inventor. It is an AutoCAD title Block that contains Attributes to be filled as shown. I can easily fill those attributes in inventor just by clicking the right click and select " Edit Attribute Set" command. There are tons of Drawings to fill their title block.
I want to add these values automatically by inventor API. Unfortunately. When I tried to do it by my self, my code shows me that it counted 0 Attribute set for this block .
Sub TitleBlockAttributes() ' Set a reference to the drawing document. ' This assumes a drawing document is active. Dim oDrawDoc As DrawingDocument Set oDrawDoc = ThisApplication.ActiveDocument ' ' Set a reference to the drawing Sheet NO.1 Dim oSheet As Sheet Set oSheet = oDrawDoc.Sheets.Item(1) ' Obtain a reference to the desired AutoCAD block definition. Dim oBlockDef As AutoCADBlockDefinition Set oBlockDef = oDrawDoc.AutoCADBlockDefinitions.Item("REDECAM-TITOLO-TAVOLA") MsgBox (oBlockDef.AttributeSets.Count) End Sub