0

we want to draw dimensions between sleeve (specialty equipment) and Grid lines .

but when we apply dimensions revit throw the error message "Remove References - The references of highlighted dimension are no longer parallel"

XYZ sleeve_xyz = null;
                    Element elm = doc.GetElement(Sleeve_id.Id);
                    FamilyInstance fi = elm as FamilyInstance;
                    Autodesk.Revit.DB.Location position = elm.Location;
                    Autodesk.Revit.DB.LocationPoint positionPoint = position as Autodesk.Revit.DB.LocationPoint;
                    sleeve_xyz = positionPoint.Point;
                    sleeve_xyz = new XYZ(sleeve_xyz.X, sleeve_xyz.Y, 0);
                    Reference sleeve_ref = GetSleeveReference(fi, SpecialReferenceType.CenterLR);
                    Grid first_grid2 = doc.GetElement(First_Grid_elemID) as Grid;
                    Reference gridRef = null;
                    Options opt = new Options();
                    opt.ComputeReferences = true;
                    opt.IncludeNonVisibleObjects = true;
                    opt.View = doc.ActiveView;
                    foreach (GeometryObject obj in first_grid2.get_Geometry(opt))
                    {
                        if (obj is Autodesk.Revit.DB.Line)
                        {
                            Autodesk.Revit.DB.Line line = obj as Autodesk.Revit.DB.Line;
                            gridRef = line.Reference;
                        }
                    }
                    XYZ gr_point2 = new XYZ(grid_intersection_point.X, sleeve_xyz.Y, 0.000000000);
                    Autodesk.Revit.DB.Line line5 = null;
                    line5 = Autodesk.Revit.DB.Line.CreateBound(gr_point2, sleeve_xyz);
                    ReferenceArray refArray = new ReferenceArray();
                    refArray.Append(sleeve_ref);
                    refArray.Append(gridRef);
                    Dimension dim = doc.Create.NewDimension(doc.ActiveView, line5, refArray);

Error

Ajay D
  • 1
  • 1
  • please paste the code here so that we can copy it if we need to. Don't just provide a picture of it. – Ray Oct 25 '17 at 05:20
  • Autodesk.Revit.DB.Line line = Autodesk.Revit.DB.Line.CreateBound(grid_XYZ_coordinate, sleeve_XYZ_coordinate); ReferenceArray refArray = new ReferenceArray(); refArray.Append(sleeve_Reference); refArray.Append(grid_Reference); Dimension dim = doc.Create.NewDimension(doc.ActiveView, line, refArray); – Ajay D Oct 25 '17 at 05:38
  • not in the comments man, add it to your question – Ray Oct 25 '17 at 05:38

1 Answers1

1

Create a dimension that works manually through the user interface first, then use RevitLookup to analyse its properties and find out what exact references it has picked up. In general, if a feature is not available in the Revit product manually through the user interface, then the Revit API will not provide it either.

Jeremy Tammik
  • 7,333
  • 2
  • 12
  • 17