Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Value of overridden dimensions

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
BCampbellNWL
525 Views, 4 Replies

Value of overridden dimensions

Im using C# to create some tools, and I was wondering, is it possible to get the value of the "Replace With Text" on dimensions? the idea is to make a tool to identify overridden dimensions to help identify problems in the model. 

 

BCampbellNWL_0-1667845260438.png

Thanks!

-Ben

 

Labels (2)
4 REPLIES 4
Message 2 of 5

Hi, Benjamin!

Sure you can. Collect the Dimension object. Get its ValueOverride property value if you dimension is single-segment. For multi-segment dimension first get its Segments and use the corresponding property of the DimensionSegment class.


Maxim Stepannikov | Architect, BIM Manager, Instructor
Message 3 of 5
BCampbellNWL
in reply to: BCampbellNWL

Hey Maxim! Ive grabbed all the dimensions from the current view using the FilteredElementCollector, but I cant seem to be able to grab ValueOverride as a parameter for those elements. Do you know how I would apply it to my elements in a Foreach loop?

Message 4 of 5

Hi @BCampbellNWL ,

 

Does this help?

FilteredElementCollector collector = new FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_Dimensions).WhereElementIsNotElementType();
foreach(Element e in collector)
  {
   if(e is Dimension)
     {
       Dimension dimension = e as Dimension;
       string dimensionTextValue = dimension.ValueOverride;//Get Text Value
       dimension.ValueOverride = "Your Text Value";//Set Text Value
     }
  }

Naveen Kumar T
Developer Technical Services
Autodesk Developer Network

Message 5 of 5

That worked perfectly! Thank you!

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report