Imports System.Runtime.InteropServices
Public Class IsocliveCurvesAdd
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
Dim objApplication As SolidEdgeFramework.Application
Dim objIsoclineCurves As SolidEdgePart.IsoclineCurves
Dim objIsoclineCurve As SolidEdgePart.IsoclineCurve
Dim objPartDoc As SolidEdgePart.PartDocument
Dim objIsoclinePlane As SolidEdgePart.RefPlane
Dim objConstructions As SolidEdgePart.Constructions
Dim objSurfArray As System.Array
Dim objEditArray As System.Array = Nothing
Dim objFaces As SolidEdgeGeometry.Faces
Dim dIsoclineAngle As Double
Dim Exsurface As SolidEdgePart.ExtrudedSurface
Dim objType As Type = Nothing
Try
' Create/get the application with specific settings
objApplication = Marshal.GetActiveObject("SolidEdge.Application")
If objApplication Is Nothing Then
' Get the type from the Solid Edge ProgID
objType = Type.GetTypeFromProgID("SolidEdge.Application")
' Start Solid Edge
objApplication = Activator.CreateInstance(objType)
' Make Solid Edge visible
objApplication.Visible = True
End If
'Get reference to active document
objPartDoc = objApplication.ActiveDocument
' Get the construction object
objConstructions = objPartDoc.Constructions
' Get the isoclineCurves as collection object.
objIsoclineCurves = objConstructions.IsoclineCurves
Exsurface = objConstructions.ExtrudedSurfaces.Item(1)
' Get all the faces of extruded surface
objFaces = Exsurface.Faces(SolidEdgeGeometry.FeatureTopologyQueryTypeConstants.igQueryAll)
objSurfArray = Array.CreateInstance(GetType(System.Object), 4)
For value = 1 To objFaces.Count()
objSurfArray(value - 1) = objFaces.Item(value)
Next
dIsoclineAngle = 0.0349
' Get the reference plane
objIsoclinePlane = objPartDoc.RefPlanes.Item(2)
' Creates the isocline curve
objIsoclineCurve = objIsoclineCurves.Add(1, objSurfArray, objIsoclinePlane, SolidEdgePart.IsoclineDirectionConstants.igIsoclineRight, dIsoclineAngle)
Catch ex As Exception
MsgBox(ex.ToString)
End Try
End Sub
End Class