Persisting User-Specified Values
It is possible to save custom values for many types in the MASTA API. They can be accessed via scripted properties or standalone scripts.
User specified values are persisted in the design file and can be retrieved when loading the design file.
Values are stored using the class UserSpecifiedData
Example - storing strings on a shaft
var shaft = design.RootAssembly.Shafts[0]; bool hasCompanyRef = shaft.UserSpecifiedData.HasString("Company Ref."); shaft.UserSpecifiedData.SetString("Company Ref.", "P0989767"); string companyRef; hasCompanyRef = shaft.UserSpecifiedData.TryGetString("Company Ref.", out companyRef); companyRef = shaft.UserSpecifiedData.GetString("Company Ref.");
Any class that inherits from DesignEntity, GearImplementationDetail, GearSetImplementationDetail or FlankMicroGeometry can store user specified values. This includes parts such as Shaft, assemblies such as RootAssembly and connections such as CylindricalGearMesh.
The types double, string and bool are supported. Other types can be converted to / from a string and persisted using the methods for strings.