Imports System.IO
Imports System.Runtime.InteropServices
Module Example
<STAThread()> _
Sub Main()
Dim objApplication As SolidEdgeFramework.Application = Nothing
Dim objPartDocument As SolidEdgePart.PartDocument = Nothing
Dim objModels As SolidEdgePart.Models = Nothing
Dim objModel As SolidEdgePart.Model = Nothing
Dim objIntersecs As SolidEdgePart.Intersects = Nothing
Dim objIntersect As SolidEdgePart.Intersect = Nothing
Dim objTargetBodyIntersect(5) As Object
Dim objToolBodyIntersect(5) As Object
Try
OleMessageFilter.Register()
objApplication = Marshal.GetActiveObject("SolidEdge.Application")
objPartDocument = objApplication.ActiveDocument
objModels = objPartDocument.Models
objTargetBodyIntersect(0) = objModels.Item(1).Body
objToolBodyIntersect(0) = objModels.Item(2).Body
objModel = objModels.Item(1)
objIntersecs = objModel.Intersects
objIntersect = objIntersecs.Add(1, objTargetBodyIntersect, 1, objToolBodyIntersect,
SolidEdgePart.SETargetDesignBodyOption.igCreateMultipleDesignBodiesOnNonManifoldOption,
SolidEdgePart.SETargetConstructionBodyOption.igCreateMultipleConstructionBodiesOnNonManifoldOption)
objModel.ExtrudedProtrusions.Item(2).RollToFeature()
objTargetBodyIntersect(0) = objModels.Item(1).Body
objToolBodyIntersect(0) = objModels.Item(2).Body
objIntersect.Edit(1, objTargetBodyIntersect, 1, objToolBodyIntersect,
SolidEdgePart.SETargetDesignBodyOption.igCreateMultipleDesignBodiesOnNonManifoldOption,
SolidEdgePart.SETargetConstructionBodyOption.igCreateMultipleConstructionBodiesOnNonManifoldOption)
objIntersect.RollToFeature()
Catch ex As Exception
Console.WriteLine(ex.Message)
Finally
OleMessageFilter.Revoke()
End Try
End Sub
End Module