Skip to content

Problem setting the value for a numeric property via API -- ON HOLD #208

@rmcanany

Description

@rmcanany

Converted to a PR, but I didn't get the number from our VAR. On hold for now.

============================================

Problem setting the value for a numeric property via API

Running SE 2024 MP11 and having trouble setting the value of a numeric property using the API. I have a test case prepared. The relevant part is below. Note the console output says Prop.Type is Int32, but Prop.Value is 0.29 (a Double).

CODE

Dim PropertySetName As String = "MechanicalModeling"
Dim PropName As String = "Poisson's Ratio"
Dim PropValue as Double = 3.1415

PropertySets = SEDoc.Properties
PropertySet = PropertySets.Item(PropertySetName)
Prop = PropertySet.Item(PropName)

Console.WriteLine(String.Format("PropertySetName '{0}'", PropertySetName))
Console.WriteLine(String.Format("PropName '{0}'", PropName))
Console.WriteLine(String.Format("Prop.Type '{0}'", Prop.Type.GetType.Name))
Console.WriteLine(String.Format("Prop.Value '{0}'", CStr(Prop.Value)))

Prop.Value = PropValue

If Prop.Value = PropValue Then ' <---------- Throws an Exception
Console.WriteLine("Success")
End If

CONSOLE OUTPUT

PropertySetName 'MechanicalModeling'
PropName 'Poisson's Ratio'
Prop.Type 'Int32'
Prop.Value '0.29'

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions