Is there a way to read an Arc Lenght Dimension's radius?

Hi there.

I’m trying to create a script to automatically fill all Arc Length Dimension’s Suffix with the following:

" - r = "

So far, I haven’t found a way to retrieve the dimension’s radius or diameter, but it makes sense to think it should be somewhere.

Any ideas? Thanks.

-Select the dimension.
-Get the Parameters, seen if there is the one you want
-If not, get the FamilyType from the Element and see if its hidden there
-Get and Set the parameter value

1 Like

Are you sure you want the radius of the dimension and not the dimensioned object? The radius of the dimension is based on placement and nothing else. The radius of the referenced objects can vary though. You’ll need to provide more specific information.

You can get the underlying curve of the dimension itself. Then you can get any geometry properties (like radius) from the curve object.
Curve Property (revitapidocs.com)

I’m guessing you actually want the radius of the reference object though. This still isn’t always an explicit result. The same references could represent multiple objects with different radii, as the references themselves don’t always represent a curve.
References Property (revitapidocs.com)

1 Like

@Nick_Boyts
Thanks for correcting. What I need is the second, the radius of the reference. But I guess my curse is still not knowing how to code, and trying to find my way through OOTB and Packages.

I’ll let it rest for now, and get back to it when I wrap my head around C#.

Thanks a lot.

@Marcel_Rijsmus that was my first thought as well, but those properties are not available through regular nodes.

1 Like

rhythm might have nodes for that.

image

1 Like

Hi @pedruccioli - This may be a start of what you are looking for :slight_smile: Bear in mind that depending on how you are working you would need to build in more safeguards to this workflow - i.e. different unit support.

pedruccioli_Revit_SetDimensionArcRadiusAsSuffix.dyn (9.3 KB)

The code is as follows:

# Import the Common Language Runtime (CLR) module, allowing the Python code to interact with the .NET environment
import clr

# Import the Revit API, only choosing to specifically import the Arc class
clr.AddReference("RevitAPI")
from Autodesk.Revit.DB import Arc

# Define a custom Function to get radius of an arc dimension and safeguard non-Arc failures
def get_arc_radius(dimension):
    curve = dimension.Curve
    if isinstance(curve, Arc):
        return curve.Radius
    return None

# Helper function to ensure the input is a list as our Python code needs to be structured to cover both singletons (One dimension) and a list (Many dimensions)
def ensure_list(input_data):
    if isinstance(input_data, list):
        return input_data
    return [input_data]

# For us to work on the Revit version of the element, not the Dynamo one we need to Unwrap and process the input dimensions
dimensions = [UnwrapElement(dim) for dim in ensure_list(IN[0])]

# Calculate radii for arc dimensions, rounding to the specified precision using a List Comprehension
precision = IN[1]
radii = [round(get_arc_radius(d), precision) for d in dimensions]

# The actual output you want here is converting the double or number input into a string and providing a custom concatenation. This is the most risk prone part of the code and could do with some further hardening around units if you want to make this robust
dimensionSuffix = [(" = " + str(r) + "m") for r in radii]

# Output the list of Dimension Suffixes 
OUT = dimensionSuffix
5 Likes

Hi @solamour, thanks for the detailed explanation.

I’m getting the following error when running the node:
image

I have no idea how to debug it. Could you help me, please?

Thanks

@bvs1982 Unfortunately they don’t. The GetCurve node only works for linear dimensions, not arc length (or angular, for that matter)

Edit: Just to clarify my thinking process:

To form an Arc Length dimension, there are 3 steps: Select arc, select references intersecting the arc, click to define dimension offset.

The information of that arc should be in the dimension somewhere, and there could be a way to retrieve that arc (reference) and read its radius.

This would be of great value for me because of landscaping and site design. There are projects where I spend at least 1 hour just making those dimensions and editing those suffixes.

Hello @pedruccioli - The error is stating that what you have selected as your Inputs do not have a “Curve” property, from which we then query the radius of. So it sounds like my assumptions based on your image in the first post were incorrect.

Just to confirm, you are creating your dimensions with the Angular Dimension approach correct? If not please tell me what you are using, what units your project is set to, and what version of Revit you are in?

For reference: I wrote the code in Revit 2025 and Dynamo 3.0.3 using the Angular Dimension tool between two lines, as depicted in the image.

The same code also works for me on Arc Length dimensions:

It may be easiest if you can upload a test case to ensure we’re on the same page; such as a whipped up Revit file showing the same kind of approach.

1 Like

Thanks for clarifying. I was trying to run in 2024. Tried it in 2025 and it worked as designed.

Unfortunately, the script reads the dimension’s annotation line’s radius, not the reference it is measuring, which is my goal. The use I have for this is conveying in one annotation the arc length and the radius of the curve, so the drawing can be cleaner, and easy to read. At the same time, doing this by hand is time consuming and prone to error.

If you’re still willing to help me, here it goes:

  1. Yes, I am using Arc Length. The code worked, but as I said, retrieved the annotation’s radius, not the reference’s.

  2. The project is set to centimeters. I noticed the code gives the value in feets. That I was able to correct by changing the code at line 32, then converting the units and applying as a string:

dimensionSuffix = [float(r) for r in radii]

It would be awesome to change the unit in the code itself, but that’s the best I can do for now given how little is my knowledge with codes :sweat_smile:.

  1. Mainly 24, not many reasons (as a team) to upgrade to 25 for now.

Here’s a reference file in 2025 with the original code already applied to it. On the left, the result of the script you provided. On the right, what is my goal.

Auto_Radius_Dynamo.rvt (6.3 MB)

Thanks again for being so helpful and clear in your responses.

The problem is that the reference(s) you’re using to define the angular dimension may not represent an arc itself. Unlike tags, which reference the object they represent, a dimension may reference one or more objects besides the element the dimension represents.


If the blue arcs are the elements you want to dimension, you may have to reference a separate object like a reference plane (green lines) or an internal reference within the element itself. The blue elements may have a specific radius, but that doesn’t mean that the reference for the dimension will. In this case, you have to dimension the reference lines to get the angle, but the reference lines don’t define an arc. They won’t have a radius.

3 Likes

Hmmm… assuming the reference is part of an element which is curve based and not an adjacent object, you could grab the element from the reference, and then you can pull the location of that and finally the radius from there… Lots of work though, and perhaps easier to grab the curved element by location (the center point of the radius of the dimension should align to the center point of the curved element), but that falls flat with concentric objects…

3 Likes

@Nick_Boyts In this case, I’m using an Arc Length dimension, not an Angular one. I made a sample file and uploaded it on my last reply, testing the script @solamour made.

Please correct me if I’m wrong, but it seems that an Arc Length always uses an arc as reference. It also has 2 intersecting elements to define where it begins and finish measuring. That’s why I’m assuming this information is somewhere to be read.

@jacob.small What you said makes complete sense, assuming the referenced element of the Arc Length Dimension is readable.

Another approach (reversing the logic of applying the radius after the dimension is already there) would be to create a dimension with the radius value already applied to the suffix. Since it is required to select the arc for the dimension to be created, it makes sense for it to be easier to retrieve at that point (or maybe not, i don’t really know).

Hi,
an approach using the Faces reference, there will be cases where this will not work, perhaps, it will be better to use the RayBounce technique to be more precise.

Radius Element by ArcLengthDimension

import clr
import sys
import System
#
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
import Autodesk.DesignScript.Geometry as DS

#import Revit API
clr.AddReference('RevitAPI')
import Autodesk
from Autodesk.Revit.DB import *
import Autodesk.Revit.DB as DB

clr.AddReference('RevitNodes')
import Revit
clr.ImportExtensions(Revit.GeometryConversion)
clr.ImportExtensions(Revit.GeometryReferences)

clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

doc = DocumentManager.Instance.CurrentDBDocument

def convertunitpara(value):
    UIunit = doc.GetUnits().GetFormatOptions(SpecTypeId.Length).GetUnitTypeId()
    nameUnit = LabelUtils.GetLabelForUnit(UIunit)
    convertfrom = UnitUtils.ConvertFromInternalUnits(value, UIunit)
    return round(convertfrom, 2), nameUnit 

def toList(x):
    if isinstance(x, (list, dict)) or \
            (hasattr(x, "GetType") and x.GetType().GetInterface("ICollection") is not None):
        return x
    else : return [x]

lst_dims = toList(UnwrapElement(IN[0]))
results = []
debug = []
for dim in lst_dims:
    lstPtFace = []
    arc = dim.Curve
    arc_center = dim.Curve.Center
    refA, refB = dim.References
    # get Elements from References
    elemA = doc.GetElement(refA)
    elemB = doc.GetElement(refB)
    # get faces reference for arc
    faceA = elemA.GetGeometryObjectFromReference(refA)
    faceB = elemB.GetGeometryObjectFromReference(refB)
    bbxUVA = faceA.GetBoundingBox()
    bbxUVB = faceB.GetBoundingBox()
    lstPtFace.append(faceA.Evaluate(refA.UVPoint))
    lstPtFace.append(faceB.Evaluate(refB.UVPoint))
    lstPtFace.append(faceA.Evaluate(bbxUVA.Min))
    lstPtFace.append(faceB.Evaluate(bbxUVB.Min))
    # move pts to the Z arc center
    lstPtFace = [XYZ(p.X, p.Y, arc_center.Z) for p in lstPtFace]
    # compute the min distance from arc and get the point
    mini_IntersectionResult, pt_OnFace = min([[arc.Project(pt), pt] for pt in lstPtFace], key = lambda x : x[0].Distance)
    face_radius = pt_OnFace.DistanceTo(arc_center)
    debug.append(pt_OnFace.ToPoint())
    # convert unit
    results.append(convertunitpara(face_radius))
    
OUT = results, debug
7 Likes

@c.poupin I don’t understand how you did it, but it seems like you did it. Thank you so, so much. Also, I have no clue what is the RayBounce technique, I’ll read about it later on. I will also try to understand how the code is working, and see the logic behind it.

The node seems to be returning the correct value, I’ll run some tests and come back later with the workflow fully tested.

If all is working as desired, I’ll upload a .dyn file so eveyone can benefit from it too.

Edit:

Works great!
As far as my knowledge goes, this is what I’ve come up with:


Auto_Radius_RVT25.dyn (17.7 KB)

The only change I made to the code was changing the precision from 2 to 0, because a project in centimeters does not require anything after the pediod.

After that, filtered the OUT (instead of removing the debug point, which i found very helpful to give an instant feedback and quick check), converted to string, removed the “.000000” it generates, and applied to the dimension with the required additions.

Absolutely amazing result. Absolutely amazing community.
Thanks to everyone that took their time. Cheers!

1 Like

Great work on this @c.poupin! I had gotten to a similar point but stopped being as eloquent in an attempt to catch some of the nearly infinite edge cases I ran into in testing another dataset… Was enough that I said this is more of a mess than it’s worth. Asked the Revit dev team if there is a common sense solution but my guess is it’s an API gap at the moment as currently I can’t even find a way to identify the curve which is being dimensioned in cases like this:

I’ll post back what I hear.

3 Likes

I know this has been solved but I had been working on since this was posted. What I did was get the reference geometry, exploded it, got all the arcs, and obtained the angle of the arc that is closest to the selected dimension and used the angle and dimension value to calculate the radius. probably not as much as reliable as the previous solution, but works. I’m trying to learn python to see what the previous solution does lol
ArcRadiusAsSuffix2.dyn (49.7 KB)
Auto_Radius_Dynamo.rvt (6.3 MB)

1 Like