Message 1 of 4
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am new to Revit API, I am trying to make an add-in to add the dimension automatically. But some dimension texts overlap. For example here:
I use this function to add a dimension to the grid
Dimension dim = doc.Create.NewDimension(doc.ActiveView, rowDimLine, rowsArr);
The new dimension have some overlapped text like this:
A dimension has many segments, how can I find which segments (or which text) overlap?
As I researched, I can get the "drag point" of the text by this code:
Dimension dim = doc.Create.NewDimension(doc.ActiveView, rowDimLine, rowsArr);
var firstSegment = dim.Segments.get_Item(0);
XYZ dragPoint = firstSegment.TextPosition;
However, with one point, I cannot check if that text overlaps other text.
With the dimension' type, I can get the text size but not the text box's width.
Dimension dim = doc.Create.NewDimension(doc.ActiveView, rowDimLine, rowsArr);
var type = doc.GetElement(dim.DimensionType.Id);
double textSize = type.get_Parameter(BuiltInParameter.TEXT_SIZE).AsDouble();
How can get the dimension textbox's width or check which text overlaps?
Solved! Go to Solution.