How to create a dimension between two reference plane without any other elements?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
How to solve this problem?
Hint: The two references are not geometrically aligned so the Alignment cannot be created.
My code:
UIDocument uidoc = commandData.Application.ActiveUIDocument;
Autodesk.Revit.DB.Document doc = uidoc.Document;
Transaction transaction = new Transaction(doc, "New Dimension");
transaction.Start();
XYZ rp1point1 = new XYZ(0, 0, 0);
XYZ rp1point2 = new XYZ(0, 100, 0);
XYZ rp1point3 = new XYZ(0, 0, 10);
XYZ rp2point1 = new XYZ(50, 0, 0);
XYZ rp2point2 = new XYZ(50, 100, 0);
XYZ rp2point3 = new XYZ(50, 0, 10);
try
{
ReferencePlane referencePlane1 = doc.Create.NewReferencePlane(rp1point1, rp1point2, rp1point3, doc.ActiveView);
Autodesk.Revit.DB.Reference reference1 = referencePlane1.GetReference();
ReferencePlane referencePlane2 = doc.Create.NewReferencePlane(rp2point1, rp2point2, rp2point3, doc.ActiveView);
Autodesk.Revit.DB.Reference reference2 = referencePlane2.GetReference();
try
{
Dimension dimension = doc.Create.NewAlignment(doc.ActiveView, reference1, reference2);
}
catch
{
TaskDialog.Show("Hint", "Create Dimension Failed.");
}
}
catch
{
TaskDialog.Show("Hint", "Create Reference Planes Failed.");
}
transaction.Commit();
return Result.Succeeded;