Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Column referenced to assembly item nr.

1 REPLY 1
Reply
Message 1 of 2
JaapKooter1106
383 Views, 1 Reply

Column referenced to assembly item nr.

Hello,

 

Is it possible to make the column 'REV' automatically equal to the 'Item' column in attached BOM view? I manually added the values 1 to 5 in the REV column for example.

Maybe with some help of an ilogic rule? I don't know if it's possible and/or where to start.

When i place a mono-part-detail on a assembly drawing i want to be able to place a leader referenced to the REV value. When this is possible there is a link between assembly item nr and the mono-part leader.

 

Gr. Nick

1 REPLY 1
Message 2 of 2

Please copy this iLogic rule to assembly document.
It makes revision number equal to item number in each BOM row
(for normal parts and virtual components).

' Makes Revision Number equal to ItemNumber in every BOM row

Dim oBOM As BOM = ThisDoc.Document.ComponentDefinition.BOM

'enable BOM view "Structured"
oBOM.StructuredViewEnabled = True

'reference to BOM view "Structured"
Dim oBOMView As BOMView = oBOM.BOMViews.Item(2)

For Each oBomRow As BOMRow In oBOMView.BOMRows
    Dim oDef As ComponentDefinition _
        = oBomRow.ComponentDefinitions.Item(1)

    Dim oProps As Inventor.PropertySet
    If oDef.Type = ObjectTypeEnum.kVirtualComponentDefinitionObject Then
      oProps = oDef.PropertySets.Item("Summary Information")
    Else
      oProps = oDef.Document.PropertySets.Item("Summary Information")
    End If
	
    'set new Revision number value equal to ItemNumber
    Dim oProp As Inventor.Property
    oProp = oProps.Item("Revision Number")
    oProp.Value = oBomRow.ItemNumber
Next

Vladimir Ananyev
Developer Technical Services
Autodesk Developer Network

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report