Define pseudo UDA for expression evaluation using C#

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.

uda

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

1

  • 2. Create word type pseudo UDA (:uResultTest) . Here system will output calculated value.

2.png

  • 3. Modify IsodraftAddins.xml and DesignAddins.xml that’s located in Pdms root folder to include addin ‘UDATestAddin.dll’

6.png

  • 4. Enter Design and input expression into attribute :uExpTest that need to be calculated

3.png

  • 5. Modify option file, to mark INST with UDA attribute

4

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

5.png

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

Advertisements

3 thoughts on “Define pseudo UDA for expression evaluation using C#”

  1. 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…

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.