Saving a Diagram to a dgr file using the SaveToFile command saves the objects and groups however the group structure includes reference to the saving application. If the file is opened with a different application using Diagram Studio, the reference in the group structure is not recognised and so ignored.
The Group structure is stored as:
Members = <
item
DControl = dmMyUnit.Obj1
end
item
DControl = dmMyUnit.Obj2
end>
Where dmMyUnit is the name of the Unit in my application. If I use the simple DiagramDemo app to open the file, the objects are displayed but are not grouped. If I then group them in DiagramDemo and save the file, a new group is added with a members list:
Members = <
item
DControl = __DSOwner___.Obj1
end
item
DControl = __DSOwner___.Obj2
end>
If you create the objects on the same form as the Diagram resides on then yes, it works. But if the objects are created an a different form it does not. TestDiagramGroupSave2.zip (25.8 KB)
Well, actually I can do it, I have been doing it for months. You are just saying I shouldn't do it if I want to save and load the diagram.
I must say it sounds like an odd limitation if the only reason is to ensure the prefix is always __DSOwner___ - in which case, why include it at all?