Determine if a document is sheet metal

By Augusto Goncalves

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


Comments

3 responses to “Determine if a document is sheet metal”

  1. This is a great guide to determine whether or not a document is sheet metal. I’ll have to follow this next time I work with sheet metal. How did you find your information? http://www.metalfab.com

  2. cadman Avatar
    cadman

    Guys:
    I realize this is way past the due date for comments, but I have a question about doc types, if you would be so kind to answer.
    Is a part file that’s been Converted to sheetmetal a valid sheetmetal file?
    Reason I ask is b/c I have an Inventor macro that dxf’s-out the flat patterns, but it never finds the FrameGenerator parts that I manually Converted into sheetmetal parts (yeah, I realize that’s a lotta manual labor on a big project!).
    Thanx … Chris

  3. Easy Steel China is a leading China Hastelloy alloy supplier .
    We believe in credit and quality first. we offer in a variety of formats including pipe
    fittings, bar, sheet, expansion joints. wire, plate, forgings, and more.Easy Steel China

Leave a Reply

Discover more from Autodesk Developer Blog

Subscribe now to keep reading and get access to the full archive.

Continue reading