PPT_LOGO_4b
‹#›
Autodesk Confidential Information January 2010
Sheet Metal Features
•The SheetMetalComponentDefinition.Features property returns the SheetMetalFeatures collection object. It Derives from PartFeatures.
•
•It provides support for the various sheet metal features.
•
•Complete query is available for all of the sheet metal features. Creation is supported for most of them.
•
•All sheet metal features use the “definition” concept where there’s an associated definition object that defines the information specific to that type of feature.
sheet.png
Have full query access to all sheet metal features.  Even though this is limited to query it’s still possible to perform some limited edits because the query functions provide access to the associated parameters and their values can be edited.

Support for the creation of Face and Cut features.  Because Face features will create automatic bends where the face butts up to an existing model, it’s possible to get some bends as a side effect. This is demonstrated with the sample FaceAndCutFeatureCreation

    '/////////////////////////////////////////////////////////////////////////////////////////////////////////////
    '// Use:
    '// This sample demonstrates the creation of sheet metal face and cut features.
    '// It creates a new sheet metal document, create a face feature, a cut feature
    '// and another face feature.  The second face feature butts up to the first
    '// face feature so it automatically creates a bend between them.
    '//
    '/////////////////////////////////////////////////////////////////////////////////////////////////////////////
    Public Sub FaceAndCutFeatureCreation()

        ' Create a new sheet metal document, using the default sheet metal template.
        Dim oSheetMetalDoc As PartDocument
        oSheetMetalDoc = _InvApplication.Documents.Add(DocumentTypeEnum.kPartDocumentObject, _
                     _InvApplication.FileManager.GetTemplateFile(DocumentTypeEnum.kPartDocumentObject, _
                                                                 SystemOfMeasureEnum.kDefaultSystemOfMeasure, _
                                                                 DraftingStandardEnum.kDefault_DraftingStandard, _
                                                                 "{9C464203-9BAE-11D3-8BAD-0060B0CE6BB4}"))

        ' Set a reference to the component definition.
        Dim oCompDef As SheetMetalComponentDefinition
        oCompDef = oSheetMetalDoc.ComponentDefinition

        ' Set a reference to the sheet metal features collection.
        Dim oSheetMetalFeatures As SheetMetalFeatures
        oSheetMetalFeatures = oCompDef.Features

        ' Create a new sketch on the X-Y work plane.
        Dim oSketch As PlanarSketch
        oSketch = oCompDef.Sketches.Add(oCompDef.WorkPlanes.Item(3))

        ' Set a reference to the transient geometry object.
        Dim oTransGeom As TransientGeometry
        oTransGeom = _InvApplication.TransientGeometry

        ' Draw a 20cm x 15cm rectangle with the corner at (0,0)
        Call oSketch.SketchLines.AddAsTwoPointRectangle( _
                                    oTransGeom.CreatePoint2d(0, 0), _
                                    oTransGeom.CreatePoint2d(20, 15))

        ' Create a profile.
        Dim oProfile As Profile
        oProfile = oSketch.Profiles.AddForSolid

        Dim oFaceFeatureDefinition As FaceFeatureDefinition
        oFaceFeatureDefinition = oSheetMetalFeatures.FaceFeatures.CreateFaceFeatureDefinition(oProfile)

        ' Create a face feature.
        Dim oFaceFeature As FaceFeature
        oFaceFeature = oSheetMetalFeatures.FaceFeatures.Add(oFaceFeatureDefinition)

        ' Get the top face for creating the new sketch.
        Dim aSelectTypes(0) As SelectionFilterEnum
        aSelectTypes(0) = SelectionFilterEnum.kPartFaceFilter
        Dim oFoundFaces As ObjectsEnumerator
        oFoundFaces = oCompDef.FindUsingPoint(oTransGeom.CreatePoint(1, 1, oCompDef.Thickness.Value), aSelectTypes, 0.001)
        Dim oFrontFace As Face
        oFrontFace = oFoundFaces.Item(1)

        ' Create a new sketch on this face, but use the method that allows you to
        ' control the orientation and orgin of the new sketch.
        oSketch = oCompDef.Sketches.Add(oFrontFace)

        ' Create the interior 3cm x 2cm rectangle for the cut.
        Call oSketch.SketchLines.AddAsTwoPointRectangle( _
                    oTransGeom.CreatePoint2d(2, 5.5), _
                    oTransGeom.CreatePoint2d(5, 11))

        ' Create a profile.
        oProfile = oSketch.Profiles.AddForSolid

        ' Create a cut definition object
        Dim oCutDefinition As CutDefinition
        oCutDefinition = oSheetMetalFeatures.CutFeatures.CreateCutDefinition(oProfile)

        ' Set extents to 'Through All'
        Call oCutDefinition.SetThroughAllExtent(PartFeatureExtentDirectionEnum.kNegativeExtentDirection)

        ' Create the cut feature
        Dim oCutFeature As CutFeature
        oCutFeature = oSheetMetalFeatures.CutFeatures.Add(oCutDefinition)

        ' Create a new sketch on the X-Z work plane.
        oSketch = oCompDef.Sketches.Add(oCompDef.WorkPlanes.Item(2))

        ' Draw a 15cm x 10cm rectangle with the corner at (0,0)
        Call oSketch.SketchLines.AddAsTwoPointRectangle( _
                                    oTransGeom.CreatePoint2d(0, 0), _
                                    oTransGeom.CreatePoint2d(-15, 10))

        ' Create a profile.oBendEdgesoBendEdges
        oProfile = oSketch.Profiles.AddForSolid

        oFaceFeatureDefinition = oSheetMetalFeatures.FaceFeatures.CreateFaceFeatureDefinition(oProfile)

        ' Create a face feature.
        oFaceFeature = oSheetMetalFeatures.FaceFeatures.Add(oFaceFeatureDefinition)

    End Sub