Views added via API lose BOM information

Views added via API lose BOM information

c_hoppen
Advocate Advocate
264 Views
2 Replies
Message 1 of 3

Views added via API lose BOM information

c_hoppen
Advocate
Advocate

Hello.

As the title says, views lose their connection to the BOM when I create views with the API.

DrawingView iso1View = sheet.DrawingViews.AddBaseView(modelDoc as _Document,
    centerIso1, scale,
    ViewOrientationTypeEnum.kIsoTopRightViewOrientation,
    DrawingViewStyleEnum.kHiddenLineRemovedDrawingViewStyle,
    "", null, options);

As a result, I cannot place a BOM. The line 

PartsList partsList = sheet.PartsLists.Add(iso1View, tg.CreatePoint2d(0, 0));

throws an exception.
Very strange: When I try to manually place a balloon after creating the views, Inventor asks me for the BOM. See video. I have never seen this dialog before. 

This only happens with a specific customer data set. It works with other example assemblies. This does not occur when I create the views manually. This is independent of the drawing template.

Inventor 2024.3.3

 

Regards

Christoph

 

 

0 Likes
Accepted solutions (1)
265 Views
2 Replies
Replies (2)
Message 2 of 3

JMGunnar
Collaborator
Collaborator
Accepted solution

Check BOM in Assembly 

 

JMGunnar_0-1734695789117.png

 

 

Best Regards Johan 

 

 

		oPlacementPoint = ThisApplication.TransientGeometry.CreatePoint2d(postionX, postionY)	
		
		Dim partsListBomType As PartsListLevelEnum = 46593
	
		'''Name					Value	Description
		'kFirstLevelComponents	46593	First level components.
		'kPartsOnly				46594	Parts only.
		'kStructured			46593	Structured first level components.
		'kStructuredAllLevels	46595	Structured all components.
	
		Dim oPartsList As PartsList = oSheet.PartsLists.Add(oDrawingView, oPlacementPoint,partsListBomType)

 

 

0 Likes
Message 3 of 3

c_hoppen
Advocate
Advocate

Thanks for the hint.

Strangely, it worked with all other test assemblies without the optional parameter.

kFirstLevelComponents appears to be deprecated. It's not exposed through the API.

c_hoppen_0-1734721599814.png

Have a great holiday!

 

 

0 Likes