Set Object Properties Without Scripting

 

There is a special type of local variable you can use in your displays that has this syntax:

 

localsim:property:propertyPath

 

where "propertyPath" is the name of a property, or a "path" to a property (i.e. a property of the value of a property).

 

The root of the propertyPath starts are the current GraphWorX64 Viewer (i.e. equivalent of scripting "ThisWindow").

 

Here are some examples to illustrate:

 

localsim:property:Source (the filename of the currently loaded display)

localsim:property:Document.ZoomEnabled (the ZoomEnabled property of the currently loaded display)

localsim:property:MyRect1.Opacity (the Opacity property of the object named "MyRect1" in the current display)

localsim:property:Document.RootVisual.Children[2].Opacity (the opacity of the third child object in the current display)

 

The GENESIS64 API Reference Help (scripting documentation) can be consulted to determine what properties are available to be used in localsim:property values.

 

Put more generally, the propertyPath format can:

Some examples:

 

PropertyName1

PropertyName1.PropertyName2

PropertyName1.ListProperty[0].PropertyName2

PropertyName1.DictionaryProperty["Key"].PropertyName2

PropertyName1.ObjectName1.PropertyName2

 

The DataType of these "property" localsims is automatically determined by the underlying property type. Writing to localsim:property variables may internally require automatic datatype conversions, so writing values will typically only work for properties that are numbers, booleans, strings, or enums.

 

More complex datatypes cannot be written to, but it might be possible to display their current value if the complex datatype provides an appropriate ToString conversion. The underlying property must be read/write in order to be modifiable by the localsim (if the underlying property is read-only, the write will fail).

 

The localsim UpdateRate determines how frequently the simulation variable checks to see if the current property value has changed. The high and low limits for the localsim can be specified if needed for numeric datatypes.

 

PropertyPath configuration errors are shown in the tooltip of the GraphWorX dynamic at runtime, and are also logged to TraceWorX.