Example #1
0
    protected override void OnMouseDown(Vector3 pos, ICADObject sko)
    {
        if (current != null)
        {
            if (!canCreate)
            {
                return;
            }
            current.c.isSelectable = true;
            current.isSelectable   = true;
            for (double t = 0.0; t < 1.0; t += 0.25)
            {
                var p = new PointEntity(editor.currentSketch.GetSketch());
                current.AddChild(p);
                var pc = new PointOn(editor.currentSketch.GetSketch(), p, current);
                pc.reference = false;
                pc.SetValue(t);
                pc.isVisible = false;
                p.pos        = current.PointOn(t).Eval();
            }
            current = null;
            return;
        }

        if (DetailEditor.instance.currentSketch == null)
        {
            return;
        }
        editor.PushUndo();
        current            = new EllipseEntity(DetailEditor.instance.currentSketch.GetSketch());
        current.center.pos = pos;
        AutoConstrainCoincident(current.center, sko as IEntity);

        current.isSelectable   = false;
        current.c.isSelectable = false;
    }