Is it possible Dynamo make line as per duct size in revit

I want to create a script in Dynamo that draws a line in Revit based on a duct’s size, and also includes the system and size with it. When I export this to CAD, I want to be able to calculate the quantity using that line. Is this possible?.. i make a script but i am not able to complete. its showing errors please help.

What does the warning/error say? This is totally possible using the methods you’ve shown.

Try removing the double quotes of Duct_Info since it’s a String node.

Same error is coming.

Then I suppose you really don’t have a parameter named Duct_Info. I would check the spelling of that parameter name, no extra space or anything.

I tried putting in a new parameter too, but the same error keeps popping up.

I’ve just noticed these are model curves. user-defined parameter cant be added to that category iirc. Off the top of my head, you can use duct placeholders or a custom line family to work around this. or by using Extensible Storage, but that’s a long story.

This is exactly correct. I missed that on my initial read.

You had the right idea, you just don’t have that parameter to write to (and you can’t assign model lines project parameters). One alternative would be to create a new LineStyle for every unique system and size in your project and just create the model lines using the appropriate LineStyle.
NewSubcategory Method

You also might want to double-check what information actually gets exported to CAD with the model line. It’s probably been a decade since I’ve ventured into CAD. I have no idea what all transfers accurately.