How can I set constraint to rebar that created by Rebar.CreateFreeForm with GUID?

How can I set constraint to rebar that created by Rebar.CreateFreeForm with GUID?

qoreodlf37
Enthusiast Enthusiast
107 Views
0 Replies
Message 1 of 1

How can I set constraint to rebar that created by Rebar.CreateFreeForm with GUID?

qoreodlf37
Enthusiast
Enthusiast

Hi.

I want to create a stirrup rebar using CreateFreeForm() and place it along the location curve of the host beam.

Rebar newRebar = Rebar.CreateFreeForm(Doc, serverGuid, rebarType, host);

 

So I tried to SetLayoutAsMaximumSpacing(space), but It throws two errors on revit UI error window:

1. Can't solve Rebar Shape.

2. The constraints for the rebar with free form geometry are not set or modifications have caused the automatic constraints to be deleted. You can use Edit Constraints to assign new bar constraints.

 

So I think I need to modify the RebarConstrainedHandle in the code below.

RebarConstraintsManager manager = newRebar.GetRebarConstraintsManager();
IList<RebarConstrainedHandle> handles = manager.GetAllHandles();

 

But I don't know how to modify Constraints.

 

How can I do?

By the way, I don't want to use 'CreateFromCurves' or create each stirrup one by one.

0 Likes
108 Views
0 Replies
Replies (0)