Dimension of element Revit links move wrong location or throw error
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi, I'm developing an add-in for Revit,
I wanna creating dimension for both main model and link model, create dimension for element in main model is ok but when create for link model by using mainDoc.Create.NewDimension(mainDoc.ActiveView, topLine, verArr) it throw null exception verArr. verArr = refer.CreateLinkReference(linkIntance).
The blue color is link model
I used face and GeometryElement and used some function and it can pass and create dimension for link model, but when I move dimension, it 's went to a wrong location
Create dimension
When move dimension, they go to wrong place and change direction
I use dim.Segments.get_Item(i).TextPosition with dim is type dimension which I save from return of "mainDoc.Create.NewDimension(mainDoc.ActiveView, topLine, verArr)"
Code:
...
Dimension topDim;
List<Dimension> newDimension = new List<Dimension>();
...
topDim = mainDoc.Create.NewDimension(mainDoc.ActiveView, topLine, verArr);
newDimension.add(topDim );
Then,
foreach(Dimension dim in newDimension){
//move dimension here
dim.Segments.get_Item(m).TextPosition = .....
}
I think the reference of link file is change or gone after created dimension
So how to move the dimension of element of link model on main model without change direction and move to wrong location or another element? Also, do we have any different way to create dimension for link model without use Face and GeometryElement, Solid?