Rebar Placement along Normal.

Rebar Placement along Normal.

shindeaa15
Contributor Contributor
598 Views
6 Replies
Message 1 of 7

Rebar Placement along Normal.

shindeaa15
Contributor
Contributor

Hi all,

 

I am trying to Place rebars for a wall which is slightly inclined along X-axis as shown in attached Image.


While doing so Rebars are getting placed along normal (1, 0, 0) properly.

But if we pass Normal (0.9997, 0, -0.0250) which is actually along inclination of Wall, then Rebars are not getting placed.

 

Code used for placing:

Rebar walldistBar = Rebar.CreateFromCurves(doc, RebarStyle.Standard, barType, null, null, selectionWall, new XYZ(1,0,0), distBarCurve, RebarHookOrientation.Right, RebarHookOrientation.Left, true, true);

 

Here Curve is a Vertical Line as shown in attached Image in Blue Color.

 

Any help would be appreciated

 

Thanks,

Akshay Shinde.

0 Likes
599 Views
6 Replies
Replies (6)
Message 2 of 7

jeremy_tammik
Alumni
Alumni

Solve it manually in the user interface first to understand how Revit wants it to be done.

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
Message 3 of 7

shindeaa15
Contributor
Contributor

While doing it manually, when we select Host element as wall and then path for placement as a line inclined. In that case we are able to place rebars as required. As shown in attached image I have selected Red highlighted line as a path.

 

0 Likes
Message 4 of 7

jeremy_tammik
Alumni
Alumni

It looks as if you are placing the rebar parallel to the wall's location line. Is that correct? Can you share the rebar creation code snippet including the input argument calculation based on the wall geometry data?

   

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
0 Likes
Message 5 of 7

shindeaa15
Contributor
Contributor

Actually Rebar length is perpendicular to Wall location line and Rebar placement (Layout: Number with Spacing) direction is along wall location line.

 

Code:

XYZ lineStart = new XYZ(offsetX, offsetY, offsetZ + zCorr);

XYZ lineEnd = new XYZ(offsetX, offsetY, offsetZEnd + zCorr);

 

List<Curve> distBarCurve = new List<Curve> { Line.CreateBound(lineStart, lineEnd) as Curve };

Rebar walldistBar = Rebar.CreateFromCurves(doc, RebarStyle.Standard, barType, null, null, selectionWall, newNorm, distBarCurve, RebarHookOrientation.Right, RebarHookOrientation.Left, true, true);

 

 

Note: Here Start point of Rebar Curve is Calculated considering Wall's top left Corner point.

offsetZEnd = = offsetZ - rebarLen; 

As we are considering top most point of Wall so here Rebar length is minus from start Z value.

 

Here When newNorm is passed as (1, 0, 0) it is getting placed in the direction of X axis.

Whereas actual Normal for placing should be (0.9997, 0, -0.0250), but when we pass this value we are getting Internal error.

0 Likes
Message 6 of 7

jeremy_tammik
Alumni
Alumni

I recently discussed very generic freeform rebar placement with the development team and one of your peers here in the forum with a fruitful result that hopefully can give you some pointers as well:

  

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
0 Likes
Message 7 of 7

shindeaa15
Contributor
Contributor

Thank you...

0 Likes