Hi
We are working on updating some of our Revit famiiies. Some of them have been accidentaly tweaked in regards to the units setting from metric to imperial for both common and strucutral units.
ie. Length = mm, Volumn = Cubic Feet.
Is there an API avaialbe that can reset the current family back to default metric or default imperial units for all of Common, Structural, Electrical ect?
If not, how would I start building this? Code example?
Thanks,
Matt
Hi Matt,
basically, the units within the Revit database are always the same and cannot be changed:
http://thebuildingcoder.typepad.com/blog/units
What you see in the user interface is a different matter.
If your families have been tweaked to modify certain dimensions from a 'nice' number of feet to a 'nice' number of inches or vice versa, then all you can do is tweak them right back again.
Of course almost anything can be automated.
I'm looking to change the units that are displayed within the family.
How do I go about doing that?
Look at the ProjectUnit SDK sample.
I have my add-in to Reset project units almost complete. I'm able to reset both metric and imperial values of almost all of them. I'm having difficulties with a few UnitTypes that I have tried for a day and half to get working with no success.
I have looked into the ProjectUnit SDK and that has helped for all other UnitTypes, but the following are not working in Revit 2014:
These particular ProjectUnit Names I'm not 100% sure on the UnitType names but I have tried UT_LinearForceScale, UT_MomentScale,
UT_LinearMomentScale with no success:
Snippet of code.
FormatOptions foMetNumber = unitsMetric.GetFormatOptions(UnitType.UT_Number); foMetNumber.DisplayUnits = DisplayUnitType.DUT_GENERAL; foMetNumber.Accuracy = 0.000001; foMetNumber.UnitSymbol = UnitSymbolType.UST_NONE; foMetNumber.SuppressTrailingZeros = false; //foMetNumber.SuppressLeadingZeros = n/a ; //foMetNumber.UsePlusPrefix = n/a ; foMetNumber.UseGrouping = false; //foMetNumber.SuppressSpaces = n/a ;
Maybe some of these cannot be set/changed like UT_SiteAngle... I'm not sure but I'm out of ideas.
Matt
Can't find what you're looking for? Ask the community or share your knowledge.