Imports System.Runtime.InteropServices
Public Class IsoclinecurveEdit
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 objEditPlane 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 Name As String
Dim dIsoclineAngle As Double
Dim dEditAngle As Double
Dim IsolclineDirection As SolidEdgePart.IsoclineDirectionConstants
Dim Exsurface As SolidEdgePart.ExtrudedSurface
Dim featureType As SolidEdgePart.FeatureTypeConstants
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.7853
dEditAngle = 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)
Name = objIsoclineCurve.Name()
featureType = objIsoclineCurve.Type
' Edit the isocline Curve.
' Change the direction to igisoclineRight
objIsoclineCurve.IsoclineDirection = SolidEdgePart.IsoclineDirectionConstants.igIsoclineRight
' Getting the current direction
IsolclineDirection = objIsoclineCurve.IsoclineDirection
' Get the current plane
objEditPlane = objIsoclineCurve.IsoclinePlane
' Set the plane
objIsoclineCurve.IsoclinePlane = objIsoclinePlane
'Set the angle
objIsoclineCurve.IsoclineAngle = dEditAngle
' Get the isocline angle
dIsoclineAngle = objIsoclineCurve.IsoclineAngle
' Set the new faces
objIsoclineCurve.SetIsoclineFaces(1, objEditArray)
' get the current faces
objIsoclineCurve.GetIsoclineFaces(1, objEditArray)
Call objIsoclineCurve.Delete()
Catch ex As Exception
MsgBox(ex.ToString)
End Try
End Sub
End Class