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; }
protected override void OnMouseDown(Vector3 pos, ICADObject ico) { IEntity entity = ico as IEntity; if (entity == null) { return; } if (p0 != null) { if (entity.type != IEntityType.Point) { editor.PushUndo(); var pOn = new PointOn(DetailEditor.instance.currentSketch.GetSketch(), p0, entity); pOn.reference = false; pOn.SetValue(0.5); } p0 = null; } else if (entity.type == IEntityType.Point) { p0 = entity; } }