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 objStudyOwner As SolidEdgePart.StudyOwner = Nothing
Dim objStudy As SolidEdgePart.Study = Nothing
Dim eStudyType As SolidEdgePart.FEAStudyTypeEnum_Auto = SolidEdgePart.FEAStudyTypeEnum_Auto.eStudyTypeLinearStatic_Auto
Dim eMeshType As SolidEdgePart.FEAMeshTypeEnum_Auto = SolidEdgePart.FEAMeshTypeEnum_Auto.eMeshTypeTetrahedral_Auto
Dim dThickness As Double = 0.1 ' Surface Thickness
Dim dwOptions As Int32 ' Result Options
Dim ulNumModes As ULong = 4 ' Number of modes
Dim dFreqRangeLow As Double = 0.0 ' Minimum frequency value
Dim dFreqRangeHigh As Double = 1.0 ' Maximum frequenct value
Dim bstrNasCmdLine As String = "" ' Nastran Command line options
Dim bstrNasKeywordOpts As String = "" ' Nastran keywords
Dim dwResOptions As Int32 = 0 ' Result options.
Try
OleMessageFilter.Register()
' Connect to Solid Edge
objApplication = Marshal.GetActiveObject("SolidEdge.Application")
objPartDocument = objApplication.ActiveDocument
objStudyOwner = objPartDocument.StudyOwner
objStudyOwner.AddStudy(eStudyType, _
eMeshType, _
dThickness, _
dwOptions, _
ulNumModes, _
dFreqRangeLow, _
dFreqRangeHigh, _
bstrNasCmdLine, _
bstrNasKeywordOpts, _
dwResOptions, _
objStudy)
Catch ex As Exception
Console.WriteLine(ex.Message)
Finally
OleMessageFilter.Revoke()
End Try
End Sub
End Module