Parametrized modelling

Hi, guys!

I have a 3D model with parameters. Where can I find methods to get table of parameters and to set parameters?

Thanks.

 

 

Posted by: Vladimir Krivov
Post date: 10/9/2011 7:27:41 PM

1 REPLY

RE: Parametrized modelling

Try This SUB in VB.net or it can be converted to the langauge of your chioce.

 

Public Sub AssignParamValues(ByVal NewParameter As Double, ByVal ConversionValue As Double)

'' ConversionValue is necesary due to SE library handles everything in meters so depending on the model what units is using

'' it needs to be converted

'' MyParameterName is the variable name in the variable table and it must be exposed

'' This Example works with assembly if it needs to be aplied to a different document change the declaratiion

Dim ObjApp As SolidEdgeFramework.Application = Nothing

Dim ObjDoc As SolidEdgeAssembly.AssemblyDocument = Nothing

 

Try

ObjApp = Marshal.GetActiveObject("SolidEdge.Application")

ObjDoc = ObjApp.ActiveDocument

 

 

ObjDoc.Variables("MyParameterName").value() = NewParameter * ConversionValue

 

 

Catch ex As Exception

ObjApp = Nothing

If Err.Number 0 Then

Err.Clear()

MsgBox("Solid Edge is not running. Open SE first")

End If

Finally

If Not (ObjApp Is Nothing) Then

Marshal.ReleaseComObject(ObjApp)

ObjApp = Nothing

End If

If Not (ObjDoc Is Nothing) Then

Marshal.ReleaseComObject(ObjDoc)

ObjDoc = Nothing

End If

 

End Try

 

End Sub

 

Sergio

 

 

Posted by: Sergio Vallejo
Post date: 10/10/2011 2:50:23 AM