Message 1 of 8

Not applicable
01-29-2019
04:13 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi everyone,
I try to create a button to add a virtual component in an assembly and set the quantity.
I found some information but nothing that really helps me. And I need some help.
Here is what I started :
Private Sub VirtualComponents_OnExecute(Context As NameValueMap) Handles VirtualComponents.OnExecute
Dim oApplication As Inventor.Application = GetObject(, "Inventor.Application") Dim oAssDoc As AssemblyDocument oAssDoc = oApplication.ActiveDocument Dim oAssDef As AssemblyComponentDefinition oAssDef = oAssDoc.ComponentDefinition Dim oMatrix As Matrix oMatrix = oApplication.TransientGeometry.CreateMatrix Dim oNewOcc As ComponentOccurrence oNewOcc = oAssDef.Occurrences.AddVirtual("MyVirtual", oMatrix) Dim oCVirtualCompDef As VirtualComponentDefinition oCVirtualCompDef = oNewOcc.Definition Dim oQuantity As Double = InputBox("Quantity") oCVirtualCompDef.BOMQuantity.SetBaseQuantit(BOMQuantityTypeEnum.kEachBOMQuantity, oQuantity) End Sub
Thanks
Solved! Go to Solution.