on 2024 Aug 12 1:49 PM
Hello,
I have a script I run in powerdesigner that loops through all entity symbols and colours bases on a fundamental area, assigned in the extended attributes.
I have now started to use packages, I use entities from the main Enterprise data model to construct specific business area models, with very few specific business area entities. However, these entities are shortcuts, and they are called 'Shortcut of entity' when outputting the symbol class.
The issue I am facing is that the shortcut symbols do not house the Extended attributes and as such the script cannot colour appropriately. However they do have the same GUID as the 'non-shortcut' symbols.
I was thinking I can loop though on the GUID to find the symbol with a value extended attribute value and use this variable to color the shortcut symbols. Is there a search function I can use to pull entitys/symbols with a specific GUID ? I could loop through the whole model looking for the GUID's but this seems a big unessassery workaround.
Any help would be very much appriciated.
Many thanks
Hi,
If I understood it correctly, you need to colour the symbol of entity shortcut and you need to colour it according to the extended attribute values of its original entity. In that case you can just use the TargetObject property of a Shortcut, which will lead you to the "original" entity object and then you can access its extended attribute. So no looping necessary. Does this answer your question?
Regards,
Ondrej Divis
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have tried but can seem to get it to work Below is a portion of the script in the formatting:
sub FormatEntity(s)
dim ExAttName
dim FundamentalSA
dim EntityClass
dim FillColour
dim boolFormatEntity
dim o
set o = s.Object
output "############## FormatEntity ##############"
output o
output o.ClassKind
output o.ClassName
dim test1
dim test1object
dim test2
test1 = o.TargetObject
output "test1 " & test1
test1object = test1.object
test2 = test1object.GetExtendedAttributeText(ExAttName)
output "test2 " & test2
Output statements:
### Symbol : Agreement of ClassKind= -2044982537 ClassName= Entity Symbol
############## FormatEntity ##############
Shortcut of entity 'Agreement'
908935660
Shortcut of entity
test1 Entity 'Agreement'
I get an error:
Hi, two things. You should use Set command to assign objects to your variables: Set test1 = s.Object (instead of wrong test1 = s.Object). And second, make sure, that the model containing original entity object is opened. Otherwise PD cannot access it to read the values of your extended attributes. Regards, Ondrej
User | Count |
---|---|
67 | |
11 | |
10 | |
10 | |
9 | |
8 | |
6 | |
4 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.