A sheet metal document is a kind of part document, but how to determine whether a part document is sheet metal or part document?
The part document object has a property SubType, which is nothing but a GUID . This GUID is defined in DocCLSIDs.h in Inventor’s Include directory. The sample code shown below demonstrates how to use the same.
Const CLSID_InventorSheetMetalPart_RegGUID = _
"{9C464203-9BAE-11D3-8BAD-0060B0CE6BB4}"
Public Sub CheckPartFile()
‘ is a Part Document
If (m_inventorApplication.ActiveDocumentType <> _
DocumentTypeEnum.kPartDocumentObject) Then Exit Sub
Dim opDoc As PartDocument = _
m_inventorApplication.ActiveDocument
‘ check the subtype
If opDoc.SubType = _
CLSID_InventorSheetMetalPart_RegGUID Then
MsgBox("Sheet metal part file")
Else
MsgBox("The part document is not a sheet metal")
End If
End Sub

Leave a Reply