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.
Thanks!
-Ben
Solved! Go to Solution.
Solved by naveen.kumar.t. Go to Solution.
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.
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?
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
}
}
Can't find what you're looking for? Ask the community or share your knowledge.