Inventor iLogic to edit existing Autocad Block Attributes

Inventor iLogic to edit existing Autocad Block Attributes

xenocatalyst
Advocate Advocate
718 Views
2 Replies
Message 1 of 3

Inventor iLogic to edit existing Autocad Block Attributes

xenocatalyst
Advocate
Advocate

Hi Everyone, Its been a while.

 

Lately we've been required to supply drawings to a major costumer in Autocad dwg format and comply with their drawing standards. This has become part of the job.

I am trying to automate this process and I'm caught up with editing the attribute values of the autocad blocks using inventor ilogic.

 

I can insert an autocad block and edit its attributes at the same time but that requires that every attribute value is defined within the code. For a view label this is OK, there are only 2 attributes, but for a titleblock there are just too many (this one in particular has 111). 

 

So to my question is how do i select the last placed block and 

1. open up the attribute editor? (as if i were to place it manually or right lock on the autocad block and select edit attributes) 

 

and

2. select a single attribute and write a value to it?

 

here is the code I have so far

' Set a reference to the drawing document.
' This assumes a drawing document is active.
Dim oDrawDoc As DrawingDocument : oDrawDoc = ThisApplication.ActiveDocument
Dim oSheet As Sheet : oSheet = oDrawDoc.ActiveSheet


Dim oTG As TransientGeometry: oTG = ThisApplication.TransientGeometry
Dim oBlockDef As AutoCADBlockDefinition : oBlockDef = oDrawDoc.AutoCADBlockDefinitions.Item("700-900-DC-TEM-0004_4 (A1)")
Dim oAutoCADBlock As AutoCADBlock : oAutoCADBlock = oSheet.AutoCADBlocks.Add(oBlockDef, oTG.CreatePoint2d(0, 0), 0, 1)

0 Likes
719 Views
2 Replies
Replies (2)
Message 2 of 3

chandra.shekar.g
Autodesk Support
Autodesk Support

@xenocatalyst 

 

Can you please provide non confidential model data to test the feasibility?

 

Thanks and regards,


CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network



0 Likes
Message 3 of 3

xenocatalyst
Advocate
Advocate

Thankyou for offering your help Chandra, however I have found a just now found a solution.

 

If there is anyone else who would also like to do this I used the inventor api code from https://adndevblog.typepad.com/manufacturing/2015/05/use-autocad-api-in-dwg-file.html

0 Likes