![]() |
Telelogic DOORS (steve huntington) | ![]() |
new topic :
profile :
search :
help :
dashboard :
calendar :
home
|
||
Latest News:
|
|
Topic Title: modify Attribute Type Topic Summary: Created On: 5-Apr-2007 15:41 Status: Post and Reply |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() |
|
Hello DXLiens, Now my question is what is codes and what should I use for colors in my modules it is set to default but this function needs realcolors. If someone can give me an advice I would appreciate it. I just want to add new values to existing enumeration types. best regards, Mussie |
|
![]() |
|
![]() |
|
You need to use the function setRealColorOptionForTypes(true) before setting colors for an enumerated attribute for colors to be right.
Color codes to use in your array are(located in DXL Reference Manual): int realColor_Light_Blue2 int realColor_Light_Blue int realColor_Dark_Turquoise int realColor_Pink int realColor_Blue int realColor_Maroon int realColor_Red int realColor_Yellow int realColor_Green int realColor_Cyan int realColor_Magenta int realColor_White int realColor_Orange int realColor_Brown int realColor_Purple int realColor_Navy int realColor_Sea_Green int realColor_Lime_Green int realColor_Rosy_Brown int realColor_Peru int realColor_Red_Grey int realColor_Firebrick int realColor_Thistle int realColor_Grey82 int realColor_Grey77 int realColor_Grey66 int realColor_Grey55 int realColor_Grey44 int realColor_Grey33 int realColor_Grey22 int realColor_Grey11 int realColor_Black int realColor_NewGrey1 int realColor_NewGrey2 int realColor_NewGrey3 int realColor_NewGrey4 ------------------------- David Pechacek AAI Services Textron dpechacek@sc-aaicorp.com David.Pechacek@gmail.com |
|
![]() |
|
![]() |
|
Hello, -E- DXL: incorrect arguments for function (modify) |
|
![]() |
|
![]() |
|
What is the difference between values[] and codes[]? |
|
![]() |
|
![]() |
|
Ok, |
|
![]() |
|
![]() |
|
I modified your code to work
|
|
![]() |
|
![]() |
|
Hello Ron,
you have to consider that the creation and the modification are two seperate scripts! So there is no need to name codes, values, colors ect. differently. That was not the problem if it was I'd probably get an error! But I did not get an error I just could not modify the attribute type. Mussie |
|
![]() |
|
![]() |
|
OK I know the problem!
Any attribute type which is used by an attribute can't be modified. The attribute types which are not used by an attribute can be modified. Mussie |
|
![]() |
|
![]() |
|
The original script from what I modified had an error message that came back as you had two many colors.
I modified the script so that it could be ran as a demo to show that the process worked. That is why I renamed your variables so it could be ran as a demo. |
|
![]() |
|
![]() |
|
Ok, sorry I didn't see that!
But anyway the problem is any attribute type which is used by an attribute can't be modified. Is this correct? Or is there an easy way to manage that? I thought of changing the attribute type Releases from the attribute Release to text, modify Releases and then change the attribute type of the attribute Release from text to Releases. What do you think? |
|
![]() |
|
![]() |
|
You can modify enumerated values of attribute types that are currently being used by an attribute.
You can also change the base type of an attribute type. You can not change the type of an attribute once it is created (however there apparently is an undocumented way of doing this through DXL that I'm trying to get my hands on). ------------------------- David Pechacek AAI Services Textron dpechacek@sc-aaicorp.com David.Pechacek@gmail.com |
|
![]() |
|
![]() |
|
Hello David, |
|
![]() |
|
![]() |
|
Hello, AttrDef ad = find(current Module, "Release") |
|
![]() |
|
![]() |
|
As David said "You can not change the type of an attribute once it is created (however there apparently is an undocumented way of doing this through DXL that I'm trying to get my hands on). "
I hope this helps! To change the type of the attribute you should first delete it and create it again with a different type. |
|
![]() |
|
![]() |
|
Try to remember it 'DXAliens' Seesh.
The perm you quoted was modifying the type of an Enumerated type. There is a better undocumented perm that allows you to change the order of the enumerations, it looks like this: AttrType modify(AttrType type,string newName,string codes[ ],int values[ ],int colors[ ], order[], string &errmess) The 'order' vector has a value for each new enumeration showing which of the old enumerations this new one applies. If you change an enum type with enums "Old" and "New" and want to define a new type with enums "Recent", "Current", and "Archived" then the order vector would have values 1, -1, and 0: '1' maps Recent to New; '-1' says Current has no correspondance, and '0' maps Archived to Old. If you figure to only add enums to the bottom of an existing pile, you don't need the above perm. I don't know what color code is associated with 'no color', but you can easily find out by finding such an AttrType and running something like this: int i, Count = at.size for (i=0; i<Count; i++) print i "\t" at.colors "\n" You may need to use these: bool RealColorOpts = getRealColorOptionForTypes() // Save current value setRealColorOptionForTypes(true) first, and setRealColorOptionForTypes(RealColorOpts) // Reinstate value afterwards The 'codes' in the modify command are the Enum values themselves, 'Old', 'Saftety' or whatever. The 'values' are the numbers you may have assigned to the codes when it was created. I think those 'values' are only useful for filtering and sorting, you can, for example, filter for objects whose 'severity' is as least 3; after defining enumerations 'Catastrophy' with 4, 'Severe' with 3, 'Troublesome' with 2, 'Annoying' with 1, and 'NA' as zero. I've never actually done that; all my Enums types have zero values. Of course you can keep them zero and filter for Severity of 'Catastrophy' or 'Severe'. - Louie |
|
![]() |
|
![]() |
|
Hello Louie, I don't really know if need a new order. Just take a look at the code posted on |
|
![]() |
Telelogic DOORS
» DXL Exchange
»
modify Attribute Type
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.