Create rebar with CreateFromCurves, segments dimensions not correct

Create rebar with CreateFromCurves, segments dimensions not correct

maisoui
Advocate Advocate
631 Views
3 Replies
Message 1 of 4

Create rebar with CreateFromCurves, segments dimensions not correct

maisoui
Advocate
Advocate

Hi,

 

I try to create rebar using the API method CreateFromCurves. The problem is that the segments dimensions are not correct, there is a difference of 1-2 centimeters. Where does this difference come from? How to build correctly the curves list needed by CreateFromCurves?

 

revit_issue_createfromcurves.png

 

I passed a the curves list according the following illustration :

revit_issue_createfromcurves2.png

note: 50 and 200 are in centimeters and are external dimensions (=> the bar should not be larger than these values)

 

Best regards,

Jonathan

--
Jonathan
0 Likes
632 Views
3 Replies
Replies (3)
Message 2 of 4

jaroslav.kopecky
Contributor
Contributor

Hello,

I would guess, that, your created shape is OK, difference seem comes from the corners - there is some "bending part".

I would suggest you - decide what bending diameter you want (try to tune in by parameters),

(or I also suggest you to use predefined shapes if you can)

and then also you can use ScaleToBox() method on RebarShapeDrivenAccessor

 

I don't know if that is solution for you, I also have issues.

 

Greetings Jaroslav.

0 Likes
Message 3 of 4

JimJia
Alumni
Alumni

Hi Jonathan,

 

     As Jaroslav said, you may have missed bending part of corner. Bending of rebar has radian, not straight line in actually, it causes additional length. The third parameter bartype of  API CreateFromCurves contains bending info, it's a RebarType object.

     You could use RevitLookUp to select a rebar, then click the GetTypeId property, you may found  info of RebarType, and bending infoes are included in it.

     Hope it can be helpful 🙂

 

Best regards

 

 

 


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

maisoui
Advocate
Advocate

Hi,

 

Thank you for your answer. I'm not sure that this shift comes from bending but rather from the bar's diameter. I guess that Revit supposes that the curves array define the axis of the bar. The problem is that I have external dimensions and I need to retrieve the right axis (not so simple depending on the type of bar).

 

That's what I found based on my different tests but maybe I'm wrong. Maybe a member of the Revit team could give us the complete documentation of the method CreateFromCurves.

 

Best regards

Best regards

--
Jonathan
0 Likes