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 objModel As SolidEdgePart.Model = Nothing
Dim objFaceRotates As SolidEdgePart.FaceRotates = Nothing
Dim objFaceRotate As SolidEdgePart.FaceRotate = Nothing
Dim objFace As SolidEdgeGeometry.Face = Nothing
Dim objEdges As SolidEdgeGeometry.Edges = Nothing
Dim objEdge As SolidEdgeGeometry.Edge = Nothing
Dim objPoint1 As SolidEdgeGeometry.Vertex = Nothing
Dim objPoint2 As SolidEdgeGeometry.Vertex = Nothing
Dim faceRotateType As SolidEdgeConstants.FaceRotateConstants = Nothing
Dim blendCreation As SolidEdgeConstants.FaceRotateConstants = Nothing
Try
objApplication = Marshal.GetActiveObject("SolidEdge.Application")
objPartDocument = objApplication.ActiveDocument
objModel = objPartDocument.Models(1)
objFaceRotates = objModel.FaceRotates
objFace = objModel.Body.Faces(SolidEdgeConstants.FeatureTopologyQueryTypeConstants.igQueryAll).Item(5)
objEdges = objFace.Edges
objPoint1 = objFace.Vertices.Item(1)
objPoint2 = objFace.Vertices.Item(2)
blendCreation = SolidEdgeConstants.FaceRotateConstants.igFaceRotateRecreateBlends
faceRotateType = SolidEdgeConstants.FaceRotateConstants.igFaceRotateByPoints
objFaceRotate = objFaceRotates.Add(objFace, faceRotateType, blendCreation, objPoint1, objPoint2, Nothing, SolidEdgePart.FaceRotateConstants.igFaceRotateNone, 0.0872664625997165)
If objFaceRotate Is Nothing Then
MsgBox("Failed to create FaceRotate using igFaceRotateByPoints.")
End If
faceRotateType = SolidEdgeConstants.FaceRotateConstants.igFaceRotateByGeometry
objFace = objModel.Body.Faces(SolidEdgeConstants.FeatureTopologyQueryTypeConstants.igQueryAll).Item(5)
objEdges = objModel.Body.Edges(SolidEdgeConstants.FeatureTopologyQueryTypeConstants.igQueryAll)
objEdge = objEdges.Item(1)
objFaceRotate = objFaceRotates.Add(objFace, faceRotateType, blendCreation, Nothing, Nothing, objEdge, SolidEdgePart.FaceRotateConstants.igFaceRotateAxisStart, 0.0872664625997165)
If objFaceRotate Is Nothing Then
MsgBox("Failed to create FaceRotate using igFaceRotateByGeometry.")
End If
Catch ex As Exception
Console.WriteLine(ex.Message)
End Try
End Sub
End Module