Сообщество
Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
отмена
Отображаются результаты для 
Показать  только  | Вместо этого искать 
Вы имели в виду: 

Spiral stirrup rebar

3 ОТВЕТ 3
Ответить
Сообщение 1 из 4
Anonymous
781 просмотров, 3 ответов

Spiral stirrup rebar

Hello,

 

What is the correct way to create spiral shaped stirrup rebar?

 

I have tried to:

 

var spiralShapeDefinition = new RebarShapeDefinitionByArc (document, 5, 1, 1, 1);

var spiralShape = RebarShape.Create (document, spiralShapeDefinition, null, RebarStyle.StirrupTie, StirrupTieAttachmentType.InteriorFace,
    0, RebarHookOrientation.Left, 0, RebarHookOrientation.Left, 0);
spiralShape.Name = "spiralShape";

var rebar1 = Rebar.CreateFromCurves (document, RebarStyle.StirrupTie, barType, null, null, revitHost, norm,
    curves, RebarHookOrientation.Left, RebarHookOrientation.Left, true, true);
rebar1.RebarShapeId = spiralShape.Id;

var rebar2 = Rebar.CreateFromRebarShape (document, spiralShape, barType, revitHost, XYZ.Zero, XYZ.BasisX, XYZ.BasisY);

 

 After creation of rebar1 I get an error: "Can't solve Rebar Shape.". rebar2 creation throws an exception: "Problem evaluating RebarShape spiralShape".

 

It seems that there is something wrong with the shape. I tried to compare my shape with the inbuilt spiral shape. I found two main differences:

  1. Inbuilt shape's definition had a single radius constraint. I replicated that constraint. However that did not help.
    var newParameter = GlobalParameter.Create (document, "param", ParameterType.Number);
    newParameter.SetValue (new DoubleParameterValue (3));
    spiralShapeDefinition.AddConstraintRadius (newParameter.Id, RebarShapeArcReferenceType.Centerline);
  2. Inbuilt shape has more parameters than the one that I created. Even if the lack of those parameters is the reason that my shape is invalid there is no way to add them manually and because they are readonly I cannot duplicate the inbuilt shape and reuse it.image.png

Thank You

Теги (3)
3 ОТВЕТ 3
Сообщение 2 из 4
aignatovich
в ответ: Anonymous

Hi,

 

I understand, that this forum topic is very old. However, I faced with this solution and spent 2 or 3 hours to solve it and I didn't find anything useful in the Internet. Hope, my solution could save few hours for someone later.

 

So, to create a spiral rebar shape we need to define a constraint. It could be radius, diameter or circumreference. To define a constraint we need to add a parameter:

shapeDefinition.AddParameter(prmId, defaultDiameter);
shapeDefinition.AddConstraintDiameter(prmId, RebarShapeArcReferenceType.External);

We need to have a shared parameter in the model to do this. So we can get it with SharedParameterElement.Lookup method:

var prmId = SharedParameterElement.Lookup(new Guid("...."));

Or with RebarShapeParameters.GetElementIdForExternalDefinition as it is suggested by SDK RebarShapeDefinition.AddParameter method description of paramId

Сообщение 3 из 4
aignatovich
в ответ: aignatovich

One more addition to this topic. There is still a problem to edit the spiral rebar shape family. To solve this, you need to add an additional constraint (meanwhile shapeDefinition.Complete returns true). Something like this:

shapeDefinition.AddParameter(diamPrmId, defaultDiameter);
shapeDefinition.AddConstraintDiameter(diamPrmId, RebarShapeArcReferenceType.External);

shapeDefinition.AddParameter(radiusPrmId, 0.5*defaultDiameter);
shapeDefinition.AddConstraintRadius(radiusPrmId, RebarShapeArcReferenceType.External);

 

Сообщение 4 из 4
eng.abdelrahman.mohamed1
в ответ: Anonymous

Could you share with us how to create a spiral stirrups for a circular column please ?

 

Не нашли то, что искали? Задайте вопросы в сообществе или поделитесь своими знаниями.

Новая тема  

Autodesk DevCon in Munich May 28-29th


Rail Community