protected override void PreviewFillet() { InitSession(); bool result; bool linesChamfer = _filletNodes[0].Node.Get <ShapeFunctionsInterface.Functions.FunctionInterpreter>().Name == FunctionNames.LineTwoPoints && _filletNodes[1].Node.Get <ShapeFunctionsInterface.Functions.FunctionInterpreter>().Name == FunctionNames.LineTwoPoints; if (!linesChamfer) { Builder = new NodeBuilder(Document, FunctionNames.Fillet2D); Builder[0].ReferenceList = SelectedShapes; Builder[1].Real = SizeWindow.Value; Builder[2].Integer = (int)FilletChamferTypes.SimpleChamfer2D; result = Builder.ExecuteFunction(); SizeWindow.FailedValue = !result; } else { result = NodeBuilderUtils.BuildChamfer(_filletNodes[0], _filletNodes[1], AnimationDocument, Document, SizeWindow.Value); AnimationDocument.Revert(); } if (!result) { InitSession(); } Send(InputNames.View, NotificationNames.RefreshView); }
public static void Chamfer2D(Document document, List <SceneSelectedEntity> entities, double radius) { var previewDocument = new Document(); var interpreter = previewDocument.Root.Set <DocumentContextInterpreter>(); var contextInterpreter = document.Root.Get <DocumentContextInterpreter>(); interpreter.Context = contextInterpreter.Context; previewDocument.Root.Set <ActionGraphInterpreter>().ActionsGraph = document.Root.Get <ActionGraphInterpreter>().ActionsGraph; interpreter.Document = previewDocument; previewDocument.Transact(); NodeBuilderUtils.BuildChamfer(entities[0], entities[1], previewDocument, document, radius); previewDocument.Revert(); }