//-------------------------------------------------------------------------------------------------- public override void EnrichContextMenu(ContextMenuItems itemList) { void __AddIfExecutable(IActionCommand command, object param) { if (command.CanExecute(param)) { itemList.AddCommand(command, param); } } //-------------------------------------------------------------------------------------------------- itemList.AddCommand(SketchCommands.CloseSketchEditor, null); itemList.AddGroup("Create Segment"); itemList.AddCommand(SketchCommands.CreateSegment, SketchCommands.Segments.Line); itemList.AddCommand(SketchCommands.CreateSegment, SketchCommands.Segments.PolyLine); itemList.AddCommand(SketchCommands.CreateSegment, SketchCommands.Segments.Bezier2); itemList.AddCommand(SketchCommands.CreateSegment, SketchCommands.Segments.Bezier3); itemList.AddCommand(SketchCommands.CreateSegment, SketchCommands.Segments.Circle); itemList.AddCommand(SketchCommands.CreateSegment, SketchCommands.Segments.ArcCenter); itemList.AddCommand(SketchCommands.CreateSegment, SketchCommands.Segments.ArcRim); itemList.AddCommand(SketchCommands.CreateSegment, SketchCommands.Segments.EllipseCenter); itemList.AddCommand(SketchCommands.CreateSegment, SketchCommands.Segments.EllipticalArcCenter); itemList.AddCommand(SketchCommands.CreateSegment, SketchCommands.Segments.Rectangle); itemList.CloseGroup(); itemList.AddGroup("Create Constraint"); __AddIfExecutable(SketchCommands.CreateConstraint, SketchCommands.Constraints.Fixed); __AddIfExecutable(SketchCommands.CreateConstraint, SketchCommands.Constraints.LineLength); __AddIfExecutable(SketchCommands.CreateConstraint, SketchCommands.Constraints.Angle); __AddIfExecutable(SketchCommands.CreateConstraint, SketchCommands.Constraints.CircleRadius); __AddIfExecutable(SketchCommands.CreateConstraint, SketchCommands.Constraints.Equal); __AddIfExecutable(SketchCommands.CreateConstraint, SketchCommands.Constraints.Perpendicular); __AddIfExecutable(SketchCommands.CreateConstraint, SketchCommands.Constraints.Parallel); __AddIfExecutable(SketchCommands.CreateConstraint, SketchCommands.Constraints.Concentric); __AddIfExecutable(SketchCommands.CreateConstraint, SketchCommands.Constraints.Horizontal); __AddIfExecutable(SketchCommands.CreateConstraint, SketchCommands.Constraints.Vertical); __AddIfExecutable(SketchCommands.CreateConstraint, SketchCommands.Constraints.HorizontalDistance); __AddIfExecutable(SketchCommands.CreateConstraint, SketchCommands.Constraints.VerticalDistance); __AddIfExecutable(SketchCommands.CreateConstraint, SketchCommands.Constraints.Tangent); __AddIfExecutable(SketchCommands.CreateConstraint, SketchCommands.Constraints.PointOnSegment); __AddIfExecutable(SketchCommands.CreateConstraint, SketchCommands.Constraints.PointOnMidpoint); __AddIfExecutable(SketchCommands.CreateConstraint, SketchCommands.Constraints.SmoothCorner); itemList.CloseGroup(); itemList.AddCommand(SketchCommands.SplitElement); itemList.AddCommand(SketchCommands.WeldElements); itemList.AddGroup("Convert Segment"); __AddIfExecutable(SketchCommands.ConvertSegment, SketchCommands.Segments.Line); __AddIfExecutable(SketchCommands.ConvertSegment, SketchCommands.Segments.Bezier); __AddIfExecutable(SketchCommands.ConvertSegment, SketchCommands.Segments.Arc); __AddIfExecutable(SketchCommands.ConvertSegment, SketchCommands.Segments.EllipticalArc); itemList.CloseGroup(); itemList.AddCommand(SketchCommands.RecenterGrid); }