<< Click to Display Table of Contents >> Edit Node Texts |
This chapter describes how you can define the node texts for the Structure Tree.
By default, the tree shows the Tags with the Class Display Name or the PnPID with the Display Name in case an object has no Tag property.
Here you see the example from the PSD ISO Metric project from Test Projects where Fasteners have a Tag as well.
If you want different information for your tree nodes you select a class and then click on the Edit button under Expression for tree node text.
This opens the Expression Editor.
Here you can define your own expression. This example uses the Tag and the Part Family Long Description property.
After closing the Expression Editor you see the expression below the Edit button.
Now the valves and the tee (which is also under the Hand Valves class in the test projects) show the Tag and the Long Description.
We use the same expression also for the Piping Fittings and Piping Specialty Items classes. In this example, the Fasteners are under the Piping Fittings class as well. This class also has a Tag property in the test projects.
Now everything shows Tag and Long Description.
In the test projects the Reducers have a Tag property as well. If we have this example:
The tree looks like this:
In case you would like to see the two sizes in the node text you can do this as well. And maybe you want to have the larger size always first.
The sizes of a reducer are filled out by Plant 3D depending on the flow direction and orientation of the reducer. So Size can be smaller than Size 2. In this case you might want to see Size 2 first.
The challenge is, that Size and Size 2 are string properties and not integers. With imperial units you have the additional challenge that you have the " marks.
With the PTNominalDiameterOperater function you can compare metric or imperial sizes. The expression you see here check if Size is greater than Size 2. And if so, you will later see for example 100/80 or 6"/4". And if Size 2 is greater than Size you will see the same result.
This is how it look like after closing the Expression Editor.
In the tree you now see 100/80 for both reducers although the second reducer on the right has 80/100 for Size and Size 2.
For Nozzles you may want to see the Size.
Then you could use this expression.
Now you see the Size in addition of the Tag.
Next Chapter: Filter Nodes