How to disassemble a master shape to a list of original (grouped) shapes with original settings?

Good day, community!

I have the following task.

I prepared and saved as a stencil a complex shape which portrays a telecom switch device. It consists of one big rectangle portraying a chassis and 32 small rectangles attached to the big one. Small rectangles portray ethernet ports. All shapes have several properties in fields filled with important information. This information (link ID, link category, etc.) is needed to link (connect) these ports to ports on a “port” shape on another device shape created with the same manner.

I successfully capture this complex shape from the stencil.

 int _masterId = diagram.AddMaster(_folderPath + "FullSwitchStencils.vssx", "SwitchShape");
 long _testSwitchId = diagram.AddShape(1, 1, "SwitchShape", 0);

And I can see the original complex shape in the created and saved visio file. In all rectangle shapes all field information is transfered successfully.

But programmatically I can not access any single rectangle shape. I can access only one complex shape taken from the master.
Then I tried to ungroup the complex shape.

diagram.Pages[0].Shapes[0].Ungroup();

And - yes - now there are not 1 but 34 shapes on the diagram (the master shape, the chassis shape and 32 port shapes). The problem is all new 33 shapes are just default blank rectangles. All settings (text, color, line type, property fields) have been erased. When a open the visio document I see these blank rectangles in correct layout but they are completely empty.
When I do not ungroup the created shape programmatically and do it manually it proceedes successfully with the warning message that the set of final shapes will be disconnected from the original master shape.

Is there any chance to move a complex shape object from a stencil to a visio document and then correctly disassemble it saving all original settings of the master shape programmatically?

@Viktor1983

We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): DIAGRAMNET-53122

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

@Viktor1983
Can you please share the sample file “FullSwitchStencils.vssx” and which shape showing the issue? It would help us in the process of resolving the ticket.
Thanks.

FullSwitchStencils.zip (12.4 KB)
@philip.zhou
Good day! I have uploaded the .vssx file. It contains the only shape.

@Viktor1983
We found the issue of losing text and styles when ungroup shape.
We will investigate further and update you as soon as we have any new information.
Thanks.

@philip.zhou
Thank you for quick reaction!
I will be waiting for issue resolution.

@Viktor1983
You are welcome.
Please feel free to contact us any time if you find any issue.
Thanks.

The issues you have found earlier (filed as DIAGRAMNET-53122) have been fixed in this update. This message was posted using Bugs notification tool by philip.zhou

Hi, @philip.zhou!

Using 23.4.0 I see that shape’s styles (text, filling) persist after ungrouping. But shape data (metadata properties) is still erased. Can this be fixed?

@Viktor1983
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): DIAGRAMNET-53134

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

The issues you have found earlier (filed as DIAGRAMNET-53134) have been fixed in this update. This message was posted using Bugs notification tool by philip.zhou

@philip.zhou
Yes, now it seems to be alright. Thank you for help!

@Viktor1983
Good to know that your issue is sorted out now. Please feel free to contact us any time if you have further queries or comments, we will be happy to assist you soon.

Hi, @philip.zhou!


It seems I found some more data not transferred to the new diagram from an ungrouped stencil shape.
It is about connection point. Connections themselves are successfully transferred and I can read correct coordinates from their “X.Value” and “Y.Value” properties. The erased property values are “Name” and “ID”. On the erased value of “Name” I see an empty string, on the erased value of “ID” I see “-2147483648”. Possibly other manually assigned properties get erased as well.


Can this be resolved? Or should I rely only on coordinate values to detect a certain connection point?


PS: I see that the order of Connection objects in ConnectionCollection retains. So I can address to the required connection by its known indexer of the connection in the original shape. This seems to be alright to me. Anyway it is interesting if it is possible to transfer string parameters in connection class object properties. Thank you.

@Viktor1983
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): DIAGRAMNET-53160

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

The issues you have found earlier (filed as DIAGRAMNET-53160) have been fixed in this update. This message was posted using Bugs notification tool by philip.zhou