Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Modify Rebar Set Layout

2 REPLIES 2
Reply
Message 1 of 3
mm1452
505 Views, 2 Replies

Modify Rebar Set Layout

mm1452
Enthusiast
Enthusiast

Hi all,

 

I'm trying to adjust the layout of the rebar set (width and length).

    Q1) I have tried to adjust the width through ArrayLength property (See below code) but nothing happend.

    Q2) How Can I adjust the length also?

 

string prombtMessage = "Pick Rebar Set";
Reference setRef = selection.PickObject(ObjectType.Element, prombtMessage);
Element element = doc.GetElement(setRef);
Rebar rebar = (Rebar)element;
rebar.ArrayLength = rebar.ArrayLength / 2;

P.S: I can do this as a Revit end-user by the sliders of the rebar set.

 

Thanks in advance.

0 Likes

Modify Rebar Set Layout

Hi all,

 

I'm trying to adjust the layout of the rebar set (width and length).

    Q1) I have tried to adjust the width through ArrayLength property (See below code) but nothing happend.

    Q2) How Can I adjust the length also?

 

string prombtMessage = "Pick Rebar Set";
Reference setRef = selection.PickObject(ObjectType.Element, prombtMessage);
Element element = doc.GetElement(setRef);
Rebar rebar = (Rebar)element;
rebar.ArrayLength = rebar.ArrayLength / 2;

P.S: I can do this as a Revit end-user by the sliders of the rebar set.

 

Thanks in advance.

2 REPLIES 2
Message 2 of 3
mm1452
in reply to: mm1452

mm1452
Enthusiast
Enthusiast

I have modified the length through the below parameter

 rebar.get_Parameter(BuiltInParameter.REBAR_ELEM_LENGTH).Set(maxRebarLength);

but I still can't set property ArrayLength !

0 Likes

I have modified the length through the below parameter

 rebar.get_Parameter(BuiltInParameter.REBAR_ELEM_LENGTH).Set(maxRebarLength);

but I still can't set property ArrayLength !

Message 3 of 3
manuel.solis.lopez
in reply to: mm1452

manuel.solis.lopez
Contributor
Contributor

You have to set the layout Rule, the array length is included there.

Rebar.SetLayoutAsMaximumSpacing(...), Rebar.SetLayoutAsFixedNumber(...), etc.

You have to set the layout Rule, the array length is included there.

Rebar.SetLayoutAsMaximumSpacing(...), Rebar.SetLayoutAsFixedNumber(...), etc.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report