Setting radius bend for conduit

Hi all,

I’ve been trying to set the desired radius bend size using python, but I find that when I do, no matter what value I put, I always end up getting this error message below:

This is my code:

    Elbow = doc.Create.NewElbowFitting(connector1, connector2)
    Elbow.LookupParameter("Bend Radius").Set(UnitUtils.ConvertToInternalUnits(50, UnitTypeId.Millimeters))

I want the radius bend to be 50mm. When it creates the conduit bend, if I don’t try to explicitly set the size, then it automatically gives it 127mm (which seems to be 50 inches). I’m not sure why I can’t set the bend size via dynamo/python. Anyone else come across this problem before? They are conduits with fittings if that helps any.

Start by leaving it at 127mm for now in the Python, can you then manually set it to 50mm using the user interface? My guess is 50 is too small of a turn based on the pipe radius, causing geometry to fail.

I tried to manually change it to 50mm from 127mm and it throws out the same error. If I manually model a conduit run from scratch, it actually draws a bend with a radius of 50mm automatically, so 50mm isn’t too small for the conduits, but for some reason it is when doing it via python/dynamo. For some reason no matter what size i set in the python node, be it 50 or 5000mm, it always says that the bend is too small.

Might be a transaction issue then. Can you post a dataset (RVT file with the families and such you use) and working sample graph (DYN with your Python and input/output nodes thereof)?

I’m afraid I can’t because the project I’m working on is highly classified and the family names would give away the company I work for, otherwise I would have

When inspecting the radius bend family, it shows this:

and when going to “family types” I see this:

image

so it looks like 128mm is the default, which I’m guessing is why when my script creates the conduit bend, it reads that and gives an automatic radius size of 127mm (not sure why not 128 but it’s the closest number to it that I can see). At the same time I don’t want to delete the above formula and tamper with the family as this would have to be done every single time the script is used on a new model. However, if manually drawing the conduit bend, it gives a bend radius size of 50mm, which is the desired size (the conduit diameter is 25mm). I’m not sure if there’s a way to bypass the above formula and set the desired radius bend size?

I figured out the solution. I noticed that the diameter that python/dynamo was outputting for the conduit runs and bends was not quite the same as what’s in the “electrical settings” under systems. I forced my code to give the right diameter size for the conduit runs before creating the conduit bends using this line:

Createconduit.get_Parameter(BuiltInParameter.RBS_CONDUIT_DIAMETER_PARAM).Set(UnitUtils.ConvertToInternalUnits(25, UnitTypeId.Millimeters))

and it seemed to do the trick. Now it automatically generates a radius bend of 50mm, and I can even change the size afterwards if I want to, whereas before it was locked in at 127mm no matter what I did.