Imports System.IO
Imports System.Runtime.InteropServices
Module Example
<STAThread()> _
Sub Main()
Dim objApplication As SolidEdgeFramework.Application = Nothing
Dim objSolidEdgeDocument As SolidEdgeFramework.SolidEdgeDocument = Nothing
Dim objModels As SolidEdgePart.Models = Nothing
Dim objModel As SolidEdgePart.Model = Nothing
Dim objFeatures As SolidEdgePart.Features = Nothing
Dim objFeature As Object = Nothing
Try
OleMessageFilter.Register()
objApplication = Marshal.GetActiveObject("SolidEdge.Application")
objSolidEdgeDocument = objApplication.ActiveDocument
Select Case objSolidEdgeDocument.Type
Case SolidEdgeFramework.DocumentTypeConstants.igPartDocument
objModels = objSolidEdgeDocument.Models
Case SolidEdgeFramework.DocumentTypeConstants.igSheetMetalDocument
objModels = objSolidEdgeDocument.Models
End Select
If Not objModels Is Nothing Then
objModel = objModels.Item(1)
objFeatures = objModel.Features
' Loop through all the features of the model.
For Each objFeature In objFeatures
Select Case objFeature.ModelingModeType
Case SolidEdgePart.ModelingModeConstants.seModelingModeOrdered
' Ordered feature.
Case SolidEdgePart.ModelingModeConstants.seModelingModeSynchronous
' Synchronous feature.
End Select
Next
End If
Catch ex As Exception
Console.WriteLine(ex.Message)
Finally
OleMessageFilter.Revoke()
End Try
End Sub
End Module