Skip to Content
0

PowerDesigner - ShowObjMultiSelection

Mar 23 at 04:46 PM

37

avatar image

Hi,

I am trying to find the properties of ShowObjMultiSelection. Do you know how I can catch the Cancel event?

Looking for something like selObj.ShowObjMultiSelection.Cancel ...

Thank you so much,

Michal Skoda

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Michal Škoda Mar 26 at 07:31 AM
0

Hi George,

not really. On ShowObjMultiSelection is button Cancel. I am trying to catch the moment when user clicks on Cancel button. Problem is that I cannot find the property. Do you know where I could find that?

Thank you,

M.

Show 3 Share
10 |10000 characters needed characters left characters exceeded

Try this in a PDM. When I tried it, after pressing 'Cancel' the selection count was zero

' Create a selection object
dim Selected
set Selected = ActiveModel.CreateSelection()
output Selected.Objects.Count & " BEFORE"
Selected.AddObjects Selected.Model, PdPDM.cls_Table, False, True
Selected.ShowObjMultiSelection Selected, "Objects"
output Selected.Objects.Count & " AFTER"
0

I've done a little more experimenting today, and extended yesterday's script to include an example of the more advanced selection dialogue

' Create a selection object
dim Selected, Selected2
set Selected = ActiveModel.CreateSelection()
set Selected2 = ActiveModel.CreateSelection() output Selected.Objects.Count & " BEFORE" Selected.AddObjects Selected.Model, PdPDM.cls_Table, False, True
Selected.ShowObjMultiSelection Selected, "Objects" output Selected.Objects.Count & " AFTER" output "Now listing the tables that weren't selected before"
output " - note that this dialogue gives more selection and filtering options in the dialogue"
output Selected2.Objects.Count & " BEFORE" 'ActiveModel.ShowObjMultiSelection ActiveModel, "Tables" selected2.ShowAdvancedObjMultiSelection activemodel, cls_Table, "", Selected.Objects
'show all tables in ActiveModel, any stereotype,
'if they were excluded from the original selection output Selected2.Objects.Count & " AFTER"
0

Hello Michal,

I tried to figure this out by myself in the past too. According to the description in the documentation, you cannot treat this ShowObjMultiSelection method in the same way as ShowDialog function for example. ShowDialog returns TRUE, if you click OK button and it returns FALSE if you click Cancel button, but ShowObjMultiSelection doesn`t return such value. So unfortunately the only way how to deal with it was described by George. You have to count members of the final selection. Which means, that in fact you won`t know, whether the user pressed Cancel button or selected 0 objects in the multiselection window and pressed OK button.

Regards,

Ondřej Diviš

0
George McGeachie Mar 23 at 04:54 PM
0

According to the metamodel help, there is a RemoveObjects method on cls_ObjectSelection. Is that what you need?

Share
10 |10000 characters needed characters left characters exceeded
Phillip Lam
Apr 11 at 08:45 PM
0

You can try this

Assume you have table and column selected.

result = selObj.ShowObjMultiSelection ( table, "Columns")

Click Cancel button, result is false.

Click OK button, result is true.

Share
10 |10000 characters needed characters left characters exceeded