Parts List File Type Symbol API

Parts List File Type Symbol API

evan.wondra
Enthusiast Enthusiast
286 Views
4 Replies
Message 1 of 5

Parts List File Type Symbol API

evan.wondra
Enthusiast
Enthusiast

I am trying to create an iLogic rule that edits a parts list in a drawing document based on what type of file each row is. The parts list knows the difference between assembly, sheet metal, standard part, and content center files because the file type symbol shows in the parts list (see image). Is there any API that allows me to access each of those symbols, basically saying "If that symbol is a content center symbol, then put "CONTENT CENTER" in the description".

evanwondra_0-1736282754115.png


Thanks for any help on this. 

0 Likes
Accepted solutions (1)
287 Views
4 Replies
Replies (4)
Message 2 of 5

C_Haines_ENG
Collaborator
Collaborator

If its a parts list than you can just check what kind of file it is. I can throw together some code if you need. 

0 Likes
Message 3 of 5

evan.wondra
Enthusiast
Enthusiast

If you could provide what that API would look like that would be great! It sounds like what I have been looking for.

0 Likes
Message 4 of 5

C_Haines_ENG
Collaborator
Collaborator
Accepted solution

This should work:

Sub Main
	
	Dim oDoc As DrawingDocument = ThisDoc.Document
	
	Dim oList As PartsList = oDoc.ActiveSheet.PartsLists.Item(1)
	
	For Each oRow As PartsListRow In oList.PartsListRows
		
		For Each oBOMRow As DrawingBOMRow In oRow.ReferencedRows
			For Each oCompDef As ComponentDefinition In oBOMRow.BOMRow.ComponentDefinitions
				
				Select Case oCompDef.Document.DocumentType
					Case kPartDocumentObject
						
						If oCompDef.IsContentMember
							
							oRow.Item("DESCRIPTION").Value = "CONTENT CENTER"
							
						Else
							
							oRow.Item("DESCRIPTION").Value = "PART"
							
						End If
		
					Case kAssemblyDocumentObject
						
						oRow.Item("DESCRIPTION").Value = "ASSEMBLY"
					
				End Select
	
			Next
		Next
	Next
	
End Sub
0 Likes
Message 5 of 5

evan.wondra
Enthusiast
Enthusiast

Awesome, that worked! Thank you