In this post I will explain how is possible to create Pseudo attribute, that will be evaluated, from expression you entered into other attribute.
Pseudo attribute allow for dynamic values to be returned as needed rather than having static values stored in the database.
The code required to return a pseudo attribute value must be plugged in through the use of the C# API.
I will create UDA attribute (:uExpTest), where I will enter expression and system will output result to :uResultTest.
I will show you, how this UDA can be printed in Isometric.
- 1. Create word type UDA (:uExpTest) in Lexicon
- 2. Create word type pseudo UDA (:uResultTest) . Here system will output calculated value.
- 3. Modify IsodraftAddins.xml and DesignAddins.xml that’s located in Pdms root folder to include addin ‘UDATestAddin.dll’
- 4. Enter Design and input expression into attribute :uExpTest that need to be calculated
- 5. Modify option file, to mark INST with UDA attribute
Result:
We have isometric with UDA, that was calculated based on expression we entered. In my case it evaluated ‘NAME OF PIPE‘ and printed /4″-B-1
This is possible because we wrote Addin created with C#.
You can download example from here.
Now you can learn source C# code from my public GitHub
Well, thanks for such a great work. This was exactly what I was looking for. Now I need your kind help. This works for me in both PDMS and E3D. I need to modify it to use in Aveva Diagram. After updating all relevant APIs from diagram into it and running the .dll in diagram, the program gives me fatal error and exits. Before that when building the solution in visual studio, it gives me a warning as “IAddins is obsolete, please use IAddinsinject instead”-maybe this is the problem. I was hoping maybe you could help me…
Hi friend!! Which version of Diagrams you use, I will check and post result?!
Hi… It’s Aveva Diagrams 14.1
Can you create an UDA that is the result of a sum of other attributions?
Technically it is possible