How to get the center line of items in a rebar element?

How to get the center line of items in a rebar element?

hai_nn
Contributor Contributor
821 Views
7 Replies
Message 1 of 8

How to get the center line of items in a rebar element?

hai_nn
Contributor
Contributor

Hello, 

 

I have a rebar element with 4 lines as you can see in the picture.
I edited each item using edit rebar mode.
Using API how can I get exactly 4 lines of each of these items.

hai_nn_0-1714043519092.png

 

Thank you.

0 Likes
Accepted solutions (1)
822 Views
7 Replies
Replies (7)
Message 2 of 8

jeremy_tammik
Alumni
Alumni

Here is a solution to retrieve rebar curves:

  

  

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

hai_nn
Contributor
Contributor

I tried transform but the results don't match the centerline items.

Take a look at the image below.

Can you suggest me more?

hai_nn_1-1714094737047.pnghai_nn_2-1714094743384.png

 

0 Likes
Message 4 of 8

Moustafa_K
Collaborator
Collaborator

can you send the a Revit file sample, i wasn't able to reproduce different behavior when you use GetCenterlineCurves(). So far it is always in a match with the rebar instances. 

Moustafa Khalil
Cropped-Sharp-Bim-500x125-Autodesk-1
0 Likes
Message 5 of 8

hai_nn
Contributor
Contributor

Select the edit rebar button to adjust each item
Take a look at a model I created myself

hai_nn_0-1714102912751.png

 

0 Likes
Message 6 of 8

Moustafa_K
Collaborator
Collaborator
Accepted solution

you need to use GetTransformedCenterlineCurves instead of  GetCenterlineCurves

var curves = rebar.GetTransformedCenterlineCurves(.......);

 

Moustafa Khalil
Cropped-Sharp-Bim-500x125-Autodesk-1
0 Likes
Message 7 of 8

tuan253461
Participant
Participant

If I edit the bar and delete some bar items in the rebar element, is there any way I can get the centerlines?

tuan253461_0-1716001025209.png

 

0 Likes
Message 8 of 8

jeremy_tammik
Alumni
Alumni

I see no connection between the two parts of your question, so, simply ignoring the 'if' aspect, here are some ideas on obtaining rebar centreline curves:

  

  

That issue has also been discussed repeatedly here in the forum, so a quick search might bring additional more pertinent results.

  

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