60000172 How to Show grips of an entity

Article 60000172
Type HowTo
Product Engine
Version 6
Date Added 5/31/2007
Fixed (5/31/2007)
Submitted by Peter chanios

Summary

How to Show grips of an entity.

Solution

//Add circle.
VectorDraw.Professional.vdFigures.vdCircle cir = new VectorDraw.Professional.vdFigures.vdCircle();
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);

Send comments on this topic.