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 dwOptions As UInt32 = 1
Dim ulNumModes As ULong = 6
Dim dFreqRangeLow As Double = 1.5
Dim dFreqRangeHigh As Double = 2.5
Dim strNasCmdLine As String = "Append=Y"
Dim strNasKeywordOpts As String = ""
Try
OleMessageFilter.Register()
' Connect to Solid Edge
objApplication = Marshal.GetActiveObject("SolidEdge.Application")
objPartDocument = objApplication.ActiveDocument
objStudyOwner = objPartDocument.StudyOwner
objStudyOwner.GetActiveStudy(objStudy)
objStudy.SetNastranOptions(dwOptions, _
ulNumModes, _
dFreqRangeLow, _
dFreqRangeHigh, _
strNasCmdLine, _
strNasKeywordOpts)
Catch ex As Exception
Console.WriteLine(ex.Message)
Finally
OleMessageFilter.Revoke()
End Try
End Sub
End Module