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

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.