Controlling size of flex as it is created with API

Controlling size of flex as it is created with API

mhillis
Advocate Advocate
396 Views
3 Replies
Message 1 of 4

Controlling size of flex as it is created with API

mhillis
Advocate
Advocate

Hello all,

 

I'm running into a minor issue while creating flex with the API.

 

You see - I am currently using the following API routine to create Flex Duct.

 

Autodesk.Revit.Creation.Document.NewFlexDuct(connector1, connector2, flexTypeId);

So far, this has been the most consistent method of putting together flex.  I have not had much luck putting together a system that builds flex well with points, so I've opted for using the connector method.

 

The issue I am having is that I cannot control the size of the flex as it comes in, so when I call this method it will automatically connect to my connectors which on its own is fine.  The problem is that, since I cannot control the size, I'm getting transition/reducers everywhere because Revit wants to put those down since I am, in essence, trying to connect a 12" flex to another size (12" being the default it seems).

 

So, does anyone know a way to work around this issue so I can stop having Revit dump a bunch of reducers/transitions on my connectors?

 

Thanks! 

0 Likes
397 Views
3 Replies
Replies (3)
Message 2 of 4

FAIR59
Advisor
Advisor

Solution: change the  diameter of the flexduct in the same transaction:

 

                Autodesk.Revit.DB.Mechanical.FlexDuct f = doc.Create.NewFlexDuct(connector0, connector1, ducttype);
                f.get_Parameter( BuiltInParameter.RBS_CURVE_DIAMETER_PARAM).Set(ductsize);
0 Likes
Message 3 of 4

JimJia
Alumni
Alumni

Yes, I also think changing the flex's parameter after creation is the applicable approach; There is no other method to control the size during flex create.


Jim Jia
Autodesk Forge Evangelist
https://forge.autodesk.com
Developer Technical Services
Autodesk Developer Network
Email: Jim.Jia@autodesk.com
0 Likes
Message 4 of 4

mhillis
Advocate
Advocate

@Anonymous wrote:

Yes, I also think changing the flex's parameter after creation is the applicable approach; There is no other method to control the size during flex create.


JimJia, 

 

I am aware of this, but this does not deal with the issue as I described in my inital post.  If you use the CreateFlex routine that accepts connectors for it's parameters, the routine itself will connect to those connectors with a default flex size (10" I believe).  When this connection happens within the creation routine, it will either drastically change the fittings or it will drop transitions to make the fittings work.  All of this happens before I have the opportunity to change the size of the flex.  I can change the flex after the fact yes, but the damage is already done.  I'd like to prevent these things from happening in the first place. 

0 Likes