/// <summary> /// Applies an Extrusion feature on a shape. /// </summary> /// <param name = "document">Document that holds data tree</param> /// <param name = "shape">Shape on which the extrusion is applied</param> /// <param name = "extrusionHeight">Extrusion height</param> /// <param name = "extrusionType">Extrusion type</param> public static NodeBuilder Extrude(Document document, SceneSelectedEntity shape, double extrusionHeight, ExtrusionTypes extrusionType) { var builder = new NodeBuilder(document, FunctionNames.Extrude, DisplayedShapeNames.Extrude); // Attach the shape on which the Extrusion is applied as the first child label builder[0].ReferenceData = shape; // Add the Extrusion Type as a third child label builder[1].Integer = (int)extrusionType; // Add the extrusion height as a second child label builder[2].Real = extrusionHeight; builder.ExecuteFunction(); return(builder); }
private int BuildExtrude(int sketchId, double height, ExtrusionTypes type) { if (!Document.Root.Children.ContainsKey(sketchId)) { return(-1); } var sketchNode = Document.Root[sketchId]; sketchNode.Children[2].Set <MeshTopoShapeInterpreter>().Shape = AutoGroupLogic.RebuildSketchFace(sketchNode, Document); var extrudeBuilder = new NodeBuilder(Document, FunctionNames.Extrude); var sse = new SceneSelectedEntity(sketchNode); var nb = TreeUtils.Extrude(Document, sse, height, type); NodeUtils.SetSketchTransparency(Document, sketchNode, ObjectVisibility.Hidden); sketchNode.Set <DrawingAttributesInterpreter>().Visibility = ObjectVisibility.Hidden; return(nb.Node.Index); }
public static void CreateExtrude(Node node, Node referedShape, double height, ExtrusionTypes type) { Features.Extrude(node, referedShape, height, ExtrusionTypes.ToDepth); }