Send the size of the ducts to python

Hi guys!
I want to get the size of many ducts (height and width) of the ducts by python. In python I want to find the perimeter of the ducts and if that perimeter has a certain size, I assign to a variable “weight” the weight of the steel plate. And I want to return the “weight” of the plate to the dynamo.
can anybody help me?
I dont have the script, because I’m new user of python.
Thanks.

Is there any particular reason for you to do it in python?
I think what you are trying to do can be easily done using just Dynamo nodes.

2 Likes

Agreed. You should be able to do this without Python. Just get the Diameter or the Height and Width to find the perimeter.

1 Like

I want to reduce program logic and also learn Python!

This ought to get you going:

1 Like

I don’t want to be stupid about it but if you want to primarily learn about Python the Dynamo forum might not be the right place.
Knowing Python can be incredibly useful for Dynamo but I don’t think most people on this forum are that knowledgeable on it.

Thank you very much :grinning:

Ok, I understand. I know a little of Python, this code will be part of a larger code. I program in other languages ​​and I want to learn Python solely for Revit.

If your sole purpose is programming for Revit:
Don’t underestimate Dynamo. You can do tons with it. It is very much designed to interact with Revit and it is very good at that.
Using Python in Dynamo in my idea tends to be an emergency case. If you think the nodes can be a bit clumsy there’s tons you can replace with Code Block nodes, to avoid the entire file turning into a mess.
You can always check out the Primer if you want to learn about the possiblities:
http://dynamoprimer.com/en/01_Introduction/1_introduction.html

1 Like

Thank you very much!!!