Details
How to transform sheet metal part in VB
Solution
Imports System
Imports System.Runtime.InteropServices
Imports ConsoleApplication1.MessageFilter
Imports System.IO
ModuleModule1
Sub Main()
Dim application As SolidEdgeFramework.Application = Nothing
Dim partDocument As SolidEdgePart.PartDocument = Nothing
Dim models As SolidEdgePart.Models = Nothing
Dim model As SolidEdgePart.Model = Nothing
Dim body As SolidEdgeGeometry.Body = Nothing
Dim faces As SolidEdgeGeometry.Faces = Nothing
Dim face As SolidEdgeGeometry.Face = Nothing
Try
' See "Handling 'Application is Busy' and 'Call was Rejected By Callee' errors" topic.
'OleMessageFilter.Register()
' Attempt to connect to a running instance of Solid Edge.
application = DirectCast(Marshal.GetActiveObject("SolidEdge.Application"), SolidEdgeFramework.Application)
' C:\Program Files\Solid Edge STX\Training\base.par
partDocument = CType(application.ActiveDocument, SolidEdgePart.PartDocument)
models = partDocument.Models
model = models.Item(1)
body = CType(model.Body, SolidEdgeGeometry.Body)
faces = CType(body.Faces(SolidEdgeGeometry.FeatureTopologyQueryTypeConstants.igQueryAll), SolidEdgeGeometry.Faces)
face = CType(faces.Item(6), SolidEdgeGeometry.Face)
Dim EdgesArray = Array.CreateInstance(GetType(Object), 0)
Dim BrType = SolidEdgeConstants.FeaturePropertyConstants.igNone
Dim dBRWidth AsDouble = 0.001
Dim dBRLength AsDouble = 0.0
Dim dBendRadius AsDouble = 0.001
Dim dNeutralFactor AsDouble = 0.0
partDocument.TransformToSynchronousSheetmetal(face, 0, EdgesArray, BrType, dBRWidth, dBRLength, dBendRadius, dNeutralFactor)
Catch ex As System.Exception
Console.WriteLine(ex)
Finally
'OleMessageFilter.Unregister()
Console.WriteLine("Inside Finally")
EndTry
EndSub
EndModule
Hardware/Software Configuration
Platform: INTL64
OS: window
OS Version: 764
Product: SOLID_EDGE
Application: AUTOMATION
Version: V109.0
Function: CUSTOM_SAMPLES
Ref: 002-8008571