Article | 60000208 |
Type | HowTo |
Product | Engine |
Version | 6 |
Date Added | 7/26/2007 |
Submitted by | Florian Rappel |
Keywords |
void ActiveDocument_OnActionDraw(object sender, object action, bool isHideMode, ref bool cancel)
{
if (!(action is VectorDraw.Actions.ActionGetRefPoint)) return;
VectorDraw.Actions.BaseAction act = action as VectorDraw.Actions.BaseAction;
VectorDraw.Geometry.gPoint refpoint = act.ReferencePoint;
VectorDraw.Geometry.gPoint currentpoint = act.OrthoPoint;// Draw the circle using vdCircle object
VectorDraw.Professional.vdFigures.vdCircle circle = new VectorDraw.Professional.vdFigures.vdCircle();
circle.SetUnRegisterDocument(vdSC.BaseControl.ActiveDocument);
circle.setDocumentDefaults();
circle.LineType = vdSC.BaseControl.ActiveDocument.LineTypes.DPIDashDotDot; // The Linetype here
circle.Center = VectorDraw.Geometry.gPoint.MidPoint(refpoint, currentpoint);
circle.Radius = circle.Center.Distance3D(refpoint);
circle.Draw(act.Render);// OR you can use the Render.Draw....
act.Render.PushPenstyle(Color.Red, 0.1d, vdSC.BaseControl.ActiveDocument.LineTypes.FindName("CENTER").GetgrLineType());
act.Render.DrawLine(sender, new VectorDraw.Geometry.gPoint(0, 0, 0), currentpoint);
act.Render.PopPenstyle(); // THIS IS NECESSARY after every push
}