Hey all! I'm developing a tool that will renumber views on a sheet based on their location in relationship to our title block. I'm super close, but when I go to set the value nothing happens. Anyone know why the SetValueString() method wouldn't work?
FilteredElementCollector viewportCollector = new FilteredElementCollector(doc.ActiveView.Document)
.OfCategory(BuiltInCategory.OST_Viewports)
.WhereElementIsNotElementType();
int arbitrarySet = 1000;
Transaction t2 = new Transaction(doc);
t2.Start("Reset Detail Numbers");
foreach (Element vp in viewportCollector)
{
arbitrarySet++;
vp.get_Parameter(BuiltInParameter.VIEWPORT_DETAIL_NUMBER).SetValueString(arbitrarySet.ToString());
}
t2.Commit();
(This portion is designed to renumber them to something arbitrary to avoid duplicate errors)
Solved! Go to Solution.
Hey all! I'm developing a tool that will renumber views on a sheet based on their location in relationship to our title block. I'm super close, but when I go to set the value nothing happens. Anyone know why the SetValueString() method wouldn't work?
FilteredElementCollector viewportCollector = new FilteredElementCollector(doc.ActiveView.Document)
.OfCategory(BuiltInCategory.OST_Viewports)
.WhereElementIsNotElementType();
int arbitrarySet = 1000;
Transaction t2 = new Transaction(doc);
t2.Start("Reset Detail Numbers");
foreach (Element vp in viewportCollector)
{
arbitrarySet++;
vp.get_Parameter(BuiltInParameter.VIEWPORT_DETAIL_NUMBER).SetValueString(arbitrarySet.ToString());
}
t2.Commit();
(This portion is designed to renumber them to something arbitrary to avoid duplicate errors)
Solved! Go to Solution.
Solved by RPTHOMAS108. Go to Solution.
Note remarks section for Parameter.SetValueString in RevitAPI.chm:
"The method only applies to parameters of value types."
String is not a value type so use Parameter.Set.
There is also unit parsing overhead associated with SetValueString for value types.
Note remarks section for Parameter.SetValueString in RevitAPI.chm:
"The method only applies to parameters of value types."
String is not a value type so use Parameter.Set.
There is also unit parsing overhead associated with SetValueString for value types.
@RPTHOMAS108 Thank you so much! Worked Like a charm! This API can be very confusing sometimes! haha I'll get the hang of it eventually!
@RPTHOMAS108 Thank you so much! Worked Like a charm! This API can be very confusing sometimes! haha I'll get the hang of it eventually!
Can't find what you're looking for? Ask the community or share your knowledge.