Hi, everyone!
I will post for the first time.
I'm not good at English. sorry.
Please teach me your skills.
InsertBomTable4:swBomType
swBomType_Indented:⇒OK
swBomType_PartsOnly:⇒OK
swBomType_TopLevelOnly:⇒NG!!! It does not display well
Hi, everyone!
I will post for the first time.
I'm not good at English. sorry.
Please teach me your skills.
InsertBomTable4:swBomType
swBomType_Indented:⇒OK
swBomType_PartsOnly:⇒OK
swBomType_TopLevelOnly:⇒NG!!! It does not display well
Hi Kato,
If you read the remarks for IView::InsertBomTable4 method, you don't specify the configuration, instead use IBomFeature::SetConfigurations method to work with the configuration.
Below is a code snippet for the macro I use to create BOM table for the active configuration in the drawing view:
'Inserts the BOM table at 0,-25 location on drawing origin. Set swBOMTableAnn = swView.InsertBomTable4(False, 0, -0.025, swBOMConfigurationAnchorType_e.swBOMConfigurationAnchor_TopLeft, swBomType_e.swBomType_TopLevelOnly, Empty, _ sBOMTempPath, False, swNumberingType_e.swNumberingType_None, False) 'Warning message if failes to insert the BOM table. If swBOMTableAnn Is Nothing Then swApp.SendMsgToUser2 "Error: Failed to insert the BOM table for the selected view '" & swView.Name & "'.", swMessageBoxIcon_e.swMbStop, swMessageBoxBtn_e.swMbOk Exit Sub Else 'Gets the BOM feature data and Table annotation objects. 'BOM feature data is used to set the referenced configuration in the view. Set swBOMFeat = swBOMTableAnn.BomFeature Set swTableAnn = swBOMTableAnn End If 'Gets the name of the referenced configuration in the selected drawing view. sConfigNames(0) = swView.ReferencedConfiguration bVisible(0) = True 'Sets the BOM table configuration to referenced configuration in the selected drawing view. 'Warning message if failed. If False = swBOMFeat.SetConfigurations(True, bVisible, sConfigNames) Then swApp.SendMsgToUser2 "Error: Failed to set BOM configuration to '" & swView.ReferencedConfiguration & "'.", swMessageBoxIcon_e.swMbStop, swMessageBoxBtn_e.swMbOk Exit Sub End If
Hope it helps.
Regards,
Nilesh
Nilesh, Thank you for your early reply!!
Thanks to you I solved it safely!
As you mentioned, using the IBomFeature :: SetConfigurations method worked.
You are wonderful!!
Thank you very much!!