In case 1, since I am using a BuiltIn Parameter, it doesn’t work if i write:
using DB = Autodesk.Revit.DB;
but it works if I write
using Autodesk.Revit.DB;
Case 2 works fine but if I read the built-in parameter (which I don’t like)
Case 3 doesn’t work if I choose not to show “out”.
In case 5 I am getting the rebar diameter property of the RebarBarType.
I am trying to get it directly for the rebar, first the RebarBarType then the diameter, which is in case 4, but it doesn’t work.
Sorry for the long question and i hope someone will be able to help
Hi Japhy,
The end goal is to create a C# component that gets as input the rebar and outputs the diameter (which is what case 2 is doing). What I don’t like in this is that I have to use :
and the output is not in the default units and I have to convert it manually.
What I want to do is to get RebarBarType of the input rebar and then for this, I can read BarDiameter.
Of course, if I can read Bar Diameter directly (without getting RebarBarType), it would be even better.
In order to get the Bar Diameter, you got to get the type first. BarModelDiameter method will give the result as a float. But the result still will be in Imperial units. I tried it in Python and still got the result in imperial. https://apidocs.co/apps/revit/2022/206e9dc6-5fc1-c0a8-6c76-d5a53ee93a39.htm
Thank you very much Kike.
It’s crazy that I wasn’t using UnitConverter.
I managed to get also RebarBarType from the Rebar element and then the Diameter from RebarBarType.
Has there been another change in the unit conversion? I guess there is no documentation for RIR API 2024 and I get the error that ‘ToModelLength’ does not exist in the namespace ‘RhinoInside.Revit.Convert.Geometry’ (are you missing an assembly reference?)