on 02-14-2015 5:50 PM
Hi
Can you please share any code sample you may have on how to color code a attribute in an entity using vb script?
thank you
Hi,
I'm not sure what do you mean by "color code a attribute"...
Here is an example on seting color on the entity base on an extended attribute value
Function %Validate%(obj, ByRef message)
' Implement your object validation rule on <parent> here
' and return True in case of success, False otherwise with a message
Dim sym
If obj.GetExtendedAttributeText("Inherited Risk Classification/Rating") = "5 - High" Then
For Each sym In obj.Symbols
sym.FillColor = RGB(255,51,51)
Next
ElseIf obj.GetExtendedAttributeText("Inherited Risk Classification/Rating") = "4 - Moderate-High" Then
For Each sym In obj.Symbols
sym.FillColor = RGB(255,153,51)
Next
ElseIf obj.GetExtendedAttributeText("Inherited Risk Classification/Rating") = "3 - Moderate" Then
For Each sym In obj.Symbols
sym.FillColor = RGB(255,255,102)
Next
ElseIf obj.GetExtendedAttributeText("Inherited Risk Classification/Rating") = "2 - Moderate-Low" Then
For Each sym In obj.Symbols
sym.FillColor = RGB(102,178,255)
Next
ElseIf obj.GetExtendedAttributeText("Inherited Risk Classification/Rating") = "1 - Low" Then
For Each sym In obj.Symbols
sym.FillColor = RGB(102,204,0)
Next
Else
For Each sym In obj.Symbols
sym.FillColor = RGB(192,192,192)
Next
End If
%Validate% = True
End Function
Rafal
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Rafal,
Unfortunately do not have sample code that I can share, but the formating of things like attributes are are kept in the SubObject attribute of the Symbol. See this section of the metamodel help.
PdCommon . ObjectCompositeSymbol : | |
---|---|
SubObjects As String | Get or set Sub-objects Blob. The SubObject is an attribute to specify the |
Message was edited by: Jay Stevens Beware, we have experienced issues when returning models to the repository, because of the differences between these subObjects, the merge screen displays a lot of unexpected differences. Jay
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
91 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.