60000299 Group object

Article 60000299
Type Wish
Product Engine
Version 6014
Date Added 11/1/2007 12:00:00 AM
Fixed (1/27/2009 12:00:00 AM)
Submitted by stavros meimaroglou

Summary

Group object collection of vdFigures. In order to add all items of the collection in a selectionset when one of them is added in the selection.

Solution

From version 6015 vdGroup and vdGroups objects have been added.
vdGroup object is a collection of figures that belong to a group. Grouped objects when added in a selectionset then all the object's of the group are also added. This behaviour results into clicking one entity to enable the grips then all entities of the group (if the entity belongs to a group) are being selected.

vdGroups is a collection of groups. Groups property has been added to the vdDocument object in order to have all the Document's groups. The Document's groups are being serialised and saved in vdml format.

Examples C# for the .NET libraries:

Call the vdGroups form : VectorDraw.Professional.Dialogs.frmGroups.Show(vdFramedControl1.BaseControl.ActiveDocument);
Create a vdgroup object by code:
VectorDraw.Professional.vdPrimaries.vdGroup group = new VectorDraw.Professional.vdPrimaries.vdGroup();
group.Name =
"MyGroup";
group.Description =
"Description";
group.Selectable =
true;
group.AddItem(vdFramedControl1.BaseControl.ActiveDocument.Model.Entities[vdFramedControl1.BaseControl.ActiveDocument.Model.Entities.Count -1]);
group.AddItem(vdFramedControl1.BaseControl.ActiveDocument.Model.Entities[vdFramedControl1.BaseControl.ActiveDocument.Model.Entities.Count - 2]);
vdFramedControl1.BaseControl.ActiveDocument.Groups.AddItem(group);


Examples vb6 using the wrapper component:
Call the vdGroups form :
After adding the VectorDraw.Professional.tlb reference you can call the following :

Dim dialogs As New VectorDraw_Professional.VdrawDialogs
dialogs.InitializeVdrawDialogs VDraw1.ActiveDocument.WrapperObject
dialogs.GetGroupsDialog

Create a vdgroup object by code:
Dim group As New VectorDraw_Professional.vdGroup
group.Name = "mygroup"
group.Description = "Description"
group.Selectable = True
group.AddItem VDraw1.ActiveDocument.Model.entities.Item(VDraw1.ActiveDocument.Model.entities.Count - 1).WrapperObject
group.AddItem VDraw1.ActiveDocument.Model.entities.Item(VDraw1.ActiveDocument.Model.entities.Count - 2).WrapperObject

Dim doc As VectorDraw_Professional.vdDocument
Set doc = VDraw1.ActiveDocument.WrapperObject
doc.Groups.AddItem group

 


Send comments on this topic.