on 06-19-2019 7:20 PM
Hello,
I try without result, to list all the extended attributes of any object (and specificity EnterpriseApplication object) in PowerDesigner, in VBScript.
I use PowerAMC V16.5 (french version of Power designer), to EA modeling.
if I know the name of each extended attribute, I can do it, like this :
for each App in M.EnterpriseApplications
App.getExtendedAttribute ("DEf_etendu_Carto_URBA_PAMC_V16.5.ProjetAnneeDebut")
next
where : "DEf_etendu_Carto_URBA_PAMC_V16.5" is my extension file;
and "ProjetAnneeDebut" one of the Extended Attribute
But how know, all the extended attributes ?
I try to do like this :
for each App in M.EnterpriseApplications
for each ExtAttrib In .....
text = ExtAttrib.name & " = " & App.getExtendedAttribute ("DEf_etendu_Carto_URBA_PAMC_V16.5." & ExtAttrib)
next
next
Thank for all help...
André
Also confirm that the original code works on 16.6 SP7
For Each ModelExtension In ActiveModel.ExtendedModelDefinitions
output "extension : " & ModelExtension.name
For Each ExtAttr in ModelExtension.GetMetaExtensionsForClass(PdEAM.cls_EnterpriseApplication, Cls_ExtendedAttributeTargetItem)
output "Nom de l'attribut : " + ExtAttr.Name
output "Identification de l'objet : " + ExtAttr.ObjectID
output "Nom du modele : " + ExtAttr.Model
Next
Next
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The code can find all items in all extensions in a model. So I add two if statements to restrain the output
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The code fails if the extension is not embedded in the model, as shortcuts don't have any collections. This version of the code ignores non-embedded extensions:
Set model = ActiveModel
'1st loop finds how many Extension in the model
for each ExtendedDefinition in model.ExtendedModelDefinitions
'2nd loop finds all folders in the ExtendedDefintion.
'Generation
'Settings
'Profile
if not ExtendedDefinition.IsShortcut() then
for each foldername in ExtendedDefinition.Categories
'3rd loop go through each folder. All extended attributes are defined in
'Profile
'if foldername.name = "Profile" then
for each metaClass in foldername.Categories
'4th loop go through each metaClass in all folders.
'Only Profile folder contains metaClass
for each ExtendedAttributeFolder in metaClass.Categories
'5th loop go through Extended Attributes folder
'Find all extended attributes
if ExtendedAttributeFolder.name ="Extended Attributes" then
for each extendedAttribute in ExtendedAttributeFolder.Categories
output ExtendedDefinition.name & "\" & extendedAttribute.itemPath & "\" & extendedAttribute.name
next
end if
next
next
'end if
next
end if ' IsShortcut
next
Set model = ActiveModel
'1st loop finds how many Extension in the model
for each ExtendedDefinition in model.ExtendedModelDefinitions
'2nd loop finds all folders in the ExtendedDefintion.
'Generation
'Settings
'Profile
for each foldername in ExtendedDefinition.Categories
'3rd loop go through each folder. All extended attributes are defined in
'Profile
if foldername.name = "Profile" then
for each metaClass in foldername.Categories
'4th loop go through each metaClass in all folders.
'Only Profile folder contains metaClass
for each ExtendedAttributeFolder in metaClass.Categories
'5th loop go through Extended Attributes folder
'Find all extended attributes
if ExtendedAttributeFolder.name ="Extended Attributes" then
for each extendedAttribute in ExtendedAttributeFolder.Categories
output ExtendedDefinition.name & "\" & extendedAttribute.itemPath & "\" & extendedAttribute.name
next
end if
next
next
end if
next
next
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
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.