Update Computed Fields in Data Standard

You can create and monitor Data Standard fields that are in certain relation to others or to defined functions by using events in the code. Fields can be updated not just when Data Standard starts, but each time the user changes selected fields.

Some functions get called exactly one time when the UI is built the first time (we will use the InitializeWindow function as an example). But let's say we want to refresh a control bound to a PowerShell function. Tis can be done by :

Example Code for Creating and Monitoring Data Standard Fields

In the following example, we add some lines of code to the existing function InitializeWindow.
Note: For the purposes of this example, we are using the 1 file located at C:\ProgramData\Autodesk\Vault 2014\Extensions\DataStandard\CAD\addins.
function InitializeWindow {

     $dsWindow.Width = 600

     $dsWindow.Height = 400

     $Prop["State"].add_PropertyChanged({

      param( $parameter)

      StateChanged

      })

}

Here we catch the event and call the function StateChanged. The property "State" is bound to a textfield (testtextfield). Now each time the user inserts some new text in this field, the function StateChanged is called. We also use another simple function (SayHello) to write a result ("Hello"+ string entered) in another field (testtextfield2). These two functions can be written like this:

The xaml file has two text-fields with the name "testtextfield" and "testtextfield2". The first one is bound by a property called "State" as you can see.

Now when we start Data Standard and write something in the "testtextfield", Data Standard shows as hello+ the text that we wrote. This is just a simple example but it hopefully provides some ideas for adding new features to the Data Standard dialog or helps you address any problems.

1 Default.ps1