Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
ppolcynBNVFN
in reply to: A.Acheson

That worked! I just had to add in an extra "else if" statement for the assemblies. Here is what I added below in case this helps someone in the future:

 

If refDoc.DocumentType = DocumentTypeEnum.kPartDocumentObject Then
		Try
	   		oPartsList = oSheet.PartsLists(1)
		Catch
			oPartsList = oSheet.PartsLists.Add(baseView, placementPoint)
		End Try
	Else If refDoc.DocumentType = DocumentTypeEnum.kAssemblyDocumentObject Then
		Try
			oPartsList = oSheet.PartsLists(1)
		Catch
			Try
			oPartsList = oSheet.PartsLists.Add(baseView, placementPoint, kFirstLevelComponents)
			Catch
			oPartsList = oSheet.PartsLists.Add(baseView, placementPoint, kPartsOnly)
			End Try
		End Try
	End  If