Prod.: Engine, ver.: 6, ID: 60000172, HowTo : How to Show grips of an entity

HowTo : How to Show grips of an entity

Article60000172
TypeHowTo
ProductEngine
Version6
Date Added5/31/2007
Submitted byPeter chanios
Keywords

Subject

How to Show grips of an entity

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);