/// <summary> /// Создает простой стержень /// </summary> public static void CreateSimpleRod(string filePath) { var model = CreateMainModel(); var point1 = new XYZ(0, 0, 0); var point2 = new XYZ(0, 10, 0); var archRod = new ArchitectureRod(model); KeyExternalProgram_Revit keyExternalProgram = (KeyExternalProgram_Revit)KeyExternalProgram.createKeyExternalProgram(e_Key_External_Program.KEP_REVIT); keyExternalProgram.setIntKey(123L); keyExternalProgram.setStringKey("test_rod"); keyExternalProgram.setIntNumber(0); archRod.setKeyExternalProgram(keyExternalProgram); var polygon = new ArchitecturePolygon(archRod); var polygonalEdgeLine1 = CreatePolygonEdgeLine(polygon, point1); var polygonalEdgeLine2 = CreatePolygonEdgeLine(polygon, point2); polygon.addEdge(polygonalEdgeLine1); polygon.addEdge(polygonalEdgeLine2); archRod.setPolygon(polygon); model.addArchitectureElement(archRod); LiraUtils.CreateModelFile(model, filePath); }
private static PolygonEdgeLine CreatePolygonEdgeLine(ArchitecturePolygon parentPoly, XYZ point) { PolygonEdgeLine polygonEdgeLine = new PolygonEdgeLine(parentPoly); polygonEdgeLine.setXYZ(point.X, point.Y, point.Z); return(polygonEdgeLine); }