//-------------------------------------------------------------------------------------------------- public override void EnrichContextMenu(ContextMenuItems itemList) { if (Entity.Predecessor is Sketch sketch) { itemList.AddCommand(SketchCommands.StartSketchEditor, sketch); } if (Entity.Profile == Pipe.ProfileType.Custom && Entity.Operands.Count > 1 && Entity.Operands[1] is Sketch profile) { itemList.AddCommand(SketchCommands.StartSketchEditor, profile, "Edit Profile"); } }
//-------------------------------------------------------------------------------------------------- public override void EnrichContextMenu(ContextMenuItems itemList) { if (Entity.Sketch != null) { itemList.AddCommand(SketchCommands.StartSketchEditor, Entity.Sketch); } }
//-------------------------------------------------------------------------------------------------- public override void EnrichContextMenu(ContextMenuItems itemList) { itemList.AddCommand(SketchCommands.StartSketchEditor, Entity); itemList.AddCommand(ModelCommands.CreateExtrude, Entity); itemList.AddCommand(ModelCommands.CreateRevolve, Entity); }
//-------------------------------------------------------------------------------------------------- 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); }
//-------------------------------------------------------------------------------------------------- public override void EnrichContextMenu(ContextMenuItems itemList) { itemList.AddCommand(AuxiliaryCommands.SetWorkingPlaneToDatumPlane); }