Reply

Add flange

[ Edited ]

Hello, sorry all but I am desesperate.

 

This is my code, now I'm trying to load a flie that is only a tab. I am trying to make the flange but the problem is the same.

The flange in created but with problems, unsuccesfully.

 

Tihs is my code. Please somebody knows how to create a flange? Can someboy help me, please?

 

Thanks and sorry if disturb.

 

Imports SolidEdgeConstants

Imports System.Runtime.InteropServices

Module Module1

    Sub Main()

        Dim objApplication As SolidEdgeFramework.Application = Nothing

        Dim objDocuments As SolidEdgeFramework.Documents = Nothing

        Dim objSheetM As SolidEdgePart.SheetMetalDocument = Nothing

        Dim objModels As SolidEdgePart.Models = Nothing

        Dim objModel As SolidEdgePart.Model = Nothing

        Dim objPliegues As SolidEdgePart.Flanges = Nothing

        Dim objPliegue As SolidEdgePart.Flange = Nothing

        Dim objcaraplegados As SolidEdgePart.Tabs = Nothing

        Dim objcaraplegado As SolidEdgePart.Tab = Nothing

        Dim objLineaPlegados As SolidEdgeGeometry.Edges = Nothing

        Dim objLineaPlegado As SolidEdgeGeometry.Edge = Nothing

 

        Try

            objApplication = Marshal.GetActiveObject("SolidEdge.Application") 'conecta con SE

            objDocuments = objApplication.Documents 'referencia a documentos

            objSheetM = objDocuments.Open("d:\sheetmetal2.psm")

            objModels = objSheetM.Models

            objModel = objModels.Item(1)

 

   'MAKE THE FLANGE

            objcaraplegados = objModel.Tabs

            objcaraplegado = objcaraplegados.Item(1)

 

            objLineaPlegados = objcaraplegado.Edges(SolidEdgeGeometry.FeatureTopologyQueryTypeConstants.igQueryAll)

            objLineaPlegado = objLineaPlegados.Item(5)

 

            objPliegues = objModel.Flanges

            objPliegue = objPliegues.Add(objLineaPlegado, SolidEdgePart.FeaturePropertyConstants.igLeft, 0.02)

            objPliegue.BendRadius = 0.005

            objPliegue.FlangeMaterialSide = SolidEdgePart.FlangeFeatureConstants.seFlangeMaterialOutside

 

        Catch ex As Exception

            Console.WriteLine(ex.Message)

        Finally

            If Not (objModel Is Nothing) Then

                Marshal.ReleaseComObject(objModel)

                objModel = Nothing

            End If

            If Not (objModels Is Nothing) Then

                Marshal.ReleaseComObject(objModels)

                objModels = Nothing

            End If

            If Not (objSheetM Is Nothing) Then

                Marshal.ReleaseComObject(objSheetM)

                objSheetM = Nothing

            End If

            If Not (objDocuments Is Nothing) Then

                Marshal.ReleaseComObject(objDocuments)

                objDocuments = Nothing

            End If

            If Not (objApplication Is Nothing) Then

                Marshal.ReleaseComObject(objApplication)

                objApplication = Nothing

            End If

            If Not (objPliegues Is Nothing) Then

                Marshal.ReleaseComObject(objPliegues)

                objPliegues = Nothing

            End If

            If Not (objPliegue Is Nothing) Then

                Marshal.ReleaseComObject(objPliegue)

                objPliegue = Nothing

            End If

        End Try

    End Sub

End Module

 

 

Posted by: Javier C
Post date: 10/29/2011 6:42:43 AM

1 REPLY

Add flange

[ Edited ]

You need to specify an offset value for the flange.

 

    objPliegues = objModel.Flanges
    objPliegue = objPliegues.Add(objLineaPlegado, SolidEdgePart.FeaturePropertyConstants.igLeft,.02)
    objPliegue.BendRadius = 0.005
    objPliegue.FlangeMaterialSide = SolidEdgePart.FlangeFeatureConstants.seFlangeMaterialOutside
    objPliegue.OffsetType = SolidEdgePart.FeaturePropertyConstants.igNone

 

Posted by: Daniel Sheets
Post date: 10/23/2012 7:20:08 AM