Buckets:
kuklev9797/revit-ckpts / assets /samples /Samples /ContextualAnalyticalModel /CS /SetOuterContourForPanels.cs
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Text; | |
| using System.Threading.Tasks; | |
| using Autodesk.Revit; | |
| using Autodesk.Revit.DB; | |
| using Autodesk.Revit.UI; | |
| using Autodesk.Revit.DB.Structure; | |
| namespace ContextualAnalyticalModel | |
| { | |
| /// <summary> | |
| /// Implements the Revit add-in interface IExternalCommand | |
| /// </summary> | |
| [] | |
| [] | |
| class SetOuterContourForPanels : IExternalCommand | |
| { | |
| public virtual Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements) | |
| { | |
| try | |
| { | |
| Document document = commandData.Application.ActiveUIDocument.Document; | |
| //create analytical panel | |
| AnalyticalPanel analyticalPanel = CreateAnalyticalPanel.CreateAMPanel(document); | |
| if (analyticalPanel != null) | |
| { | |
| using (Transaction transaction = new Transaction(document, "Edit Analytical Panel outer contour")) | |
| { | |
| transaction.Start(); | |
| //create a new curve loop | |
| CurveLoop profileloop = new CurveLoop(); | |
| profileloop.Append(Line.CreateBound( | |
| new XYZ(0, 0, 0), new XYZ(5, 0, 0))); | |
| profileloop.Append(Line.CreateBound( | |
| new XYZ(5, 0, 0), new XYZ(5, 5, 0))); | |
| profileloop.Append(Line.CreateBound( | |
| new XYZ(5, 5, 0), new XYZ(-2, 5, 0))); | |
| profileloop.Append(Line.CreateBound( | |
| new XYZ(-2, 5, 0), new XYZ(0, 0, 0))); | |
| //Sets the new contour for analytical panel | |
| analyticalPanel.SetOuterContour(profileloop); | |
| transaction.Commit(); | |
| } | |
| } | |
| return Result.Succeeded; | |
| } | |
| catch (Exception ex) | |
| { | |
| message = ex.Message; | |
| return Result.Failed; | |
| } | |
| } | |
| } | |
| } | |
Xet Storage Details
- Size:
- 2.2 kB
- Xet hash:
- 5509fa4903b6684f16272b076d91fbe8e116fc99171a9aa6d65f22367e87e882
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.