What's new

Create and modify global parameters

Cator

Senior Member

This script, included in the official Alibre documentation, does not work correctly even after replacing the corresponding lines. Does anyone have a way to test this before submitting the report to QA?
Thank you

Francesco

Demonstrates creating and modifying global parameters

*Edit lines 6 and 10 in the script to show your own directory paths.

# create a new global parameters set
Params = GlobalParameters('Test')
# add a distance parameter in millimeters
Params.AddParameter('Width', ParameterTypes.Distance, 4.56)
# save and close, replace with your own path
Params.Save(r'C:\Users\<username>\Downloads\temp')
Params.Close()

# open global parameters, replace with your own path
Params2 = GlobalParameters(r'C:\Users\<username>\Downloads\temp', 'Test')
# get access to a parameter and display the current value
Width = Params2.GetParameter('Width')
print Width.Value
# change the value of the parameter
Width.Value = 12.34
 
Top