| Article | 60000172 |
| Type | HowTo |
| Product | Engine |
| Date Added | 5/31/2007 12:00:00 AM |
| Fixed | (5/31/2007 12:00:00 AM) |
| Submitted by | Peter chanios |
Summary
How to Show grips of an entity.
Solution
//Add circle.
cir.SetUnRegisterDocument(vdFramedControl1.BaseControl.ActiveDocument);
cir.setDocumentDefaults();
cir.Center = new VectorDraw.Geometry.gPoint(0.0, 1.0, 0.0);
cir.Radius = 5.0;
cir.ShowGrips = true;
vdFramedControl1.BaseControl.ActiveDocument.ActiveLayOut.Entities.AddItem(cir);
//Find the selection where the entities have to be added in order to draw their grips and add these objects there.
VectorDraw.Professional.vdCollections.vdSelection gripset;
string selsetname = "VDGRIPSET_" + vdFramedControl1.BaseControl.ActiveDocument.ActiveLayOut.Handle.ToStringValue() + (vdFramedControl1.BaseControl.ActiveDocument.ActiveLayOut.ActiveViewPort != null ? vdFramedControl1.BaseControl.ActiveDocument.ActiveLayOut.ActiveViewPort.Handle.ToStringValue() : "");
gripset = vdFramedControl1.BaseControl.ActiveDocument.ActiveLayOut.Document.Selections.FindName(selsetname);
if (gripset == null)
{
gripset = vdFramedControl1.BaseControl.ActiveDocument.ActiveLayOut.Document.Selections.Add(selsetname);
}
gripset.AddItem(cir,true, VectorDraw.Professional.vdCollections.vdSelection.AddItemCheck.RemoveInVisibleAndLockLayer);
vdFramedControl1.BaseControl.ActiveDocument.Redraw(true);
