ShapeItemModify Method |
Modifies a shape in the shape catalog based on the shape name or if not found, based on shape guid.
Namespace: Tekla.Structures.Catalogs
Assembly: Tekla.Structures.Catalogs (in Tekla.Structures.Catalogs.dll) Version: 2023.0.3
Syntax
Examples
using Tekla.Structures.Catalogs; public class Example { public void ModifyCube() { var insertVertices = new[] { new Vector( 0.0, 0.0, 0.0), // 0 new Vector(200.5, 0.0, 0.0), // 1 new Vector(200.5, 200.5, 0.0), // 2 new Vector( 0.0, 200.5, 0.0), // 3 new Vector( 0.0, 0.0, 200.5), // 4 new Vector(200.5, 0.0, 200.5), // 5 new Vector(200.5, 200.5, 200.5), // 6 new Vector( 0.0, 200.5, 200.5), // 7 }; var outloop = new[] { new[] { 0, 3, 2, 1 }, new[] { 0, 1, 5, 4 }, new[] { 1, 2, 6, 5 }, new[] { 2, 3, 7, 6 }, new[] { 3, 0, 4, 7 }, new[] { 4, 5, 6, 7 }}; var innerLoop = new Dictionary{int, int[][]} { }; var insertFBrep = new FacetedBrep(insertVertices, outloop, innerLoop); var insertShapeItem = new ShapeItem { Name = "MyOtherNiceCube", ShapeFacetedBrep = insertFBrep, UpAxis = ShapeUpAxis.Z_Axis }; var resultOfInsert = insertShapeItem.Insert(); insertShapeItem.Select(); var modifyVertices = new[] { new Vector( 0.0, 0.0, 0.0), // 0 new Vector(400.0, 0.0, 0.0), // 1 new Vector(400.0, 400.0, 0.0), // 2 new Vector( 0.0, 400.0, 0.0), // 3 new Vector( 0.0, 0.0, 400.0), // 4 new Vector(400.0, 0.0, 400.0), // 5 new Vector(400.0, 400.0, 400.0), // 6 new Vector( 0.0, 400.0, 400.0), // 7 }; var modifyFBrep = new FacetedBrep(modifyVertices, outloop, innerLoop); var modifyShapeItem = new ShapeItem { Name = "MyOtherNiceCube", ShapeFacetedBrep = modifyFBrep, UpAxis = ShapeUpAxis.Z_Axis }; var resultOfModify = modifyShapeItem.Modify(); modifyShapeItem.Select(); } }
See Also