Change Multiple Radii

I have several detail line circles. I would like to change the radius of all of them in one go, rather than one by one. I have tried a couple of different approaches. For the second approach I used a python script generated by ChatGPT.

Please see screenshot below. Any help would be much appreciated.

Dynamo Core 2.17.0.3472
Dynamo Revit 2.17.0.7404

BTW, the parameter name input in 1st attempt reads “Line Style” because I was experimenting with different parameter names to see if I could get something to work. I originally tried “Radius” here, but then I realised that there is no “Radius” parameter in the Properties dialog when a line is selected. The only dimension parameter is “Length”, but that’s greyed out, which means it’s read-only, right?

Screenshot 2023-09-11 110641

Here’s the python script that ChatGPT created:

[10:39 am] Peter Christensen

# Import the required libraries

import clr

clr.AddReference('RevitAPI')

from Autodesk.Revit.DB import *


# Input Parameters

curveElement = IN[0]  # Input curve element (e.g., a circle)

newRadius = IN[1]     # New radius value


# Initialize an empty list to store the modified curves

modifiedCurves = []


# Start a Revit transaction

doc = DocumentManager.Instance.CurrentDBDocument

transaction = Transaction(doc, "Change Curve Radius")

transaction.Start()


# Loop through each input curve

for curve in curveElement:

    # Check if the curve is a circle

    if isinstance(curve, Arc):

        # Create a modified circle with the new radius

        modifiedCircle = Arc.Create(curve.Center, newRadius, curve.StartAngle, curve.EndAngle, curve.Normal)

        # Add the modified circle to the list

        modifiedCurves.append(modifiedCircle)


# Commit the transaction

transaction.Commit()


# Output the modified curves

OUT = modifiedCurves

Hi @Peter-Christensen probably something could work…

Revit_ScpAKcwEv5

Hi @sovitek thanks very much. I tried it but the element.delete node isn’t working. I couldn’t find a node called ‘elements.delete’, just ‘element.delete’

I get the preview in revit, but it doesn’t create the actual geometry (and it doesn’t delete the initial curves)

Here’s the graph with the error

Here’s what it looks like before I run the graph

Here’s what it looks like after I run the graph

I can’t select any of those blue circles; they are just the revit preview. Why won’t they turn into actual curves in revit, like in your example?

Thanks again

1 Like

Hi Peter do you have dynamoironpython 2.5 package installed ? and try current document before active view node


Home.dyn (17.3 KB)

Oh that worked, thanks. I had the wrong node. I used active view in current document from the clockwork package.

I actually had a set of curves in an array group and I wanted to change all their radii rather than clicking each one individually. I see that your method creates the new curves outside the group, but that’s OK, I can still use it.

I wonder if there’s a way to get this to work inside an array group… ?