Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

RebarConstraint ToOtherRebar

4 REPLIES 4
Reply
Message 1 of 5
vankhoi9966
269 Views, 4 Replies

RebarConstraint ToOtherRebar

Hi all.

How to set RebarConstrait as ToOtherRebar like in the picture.

 

My problem is that I cannot get or create a RebarConstraint with type ToOtherRebar so that I can continue processing in the API if the user has not manually manipulated in the Revit environment for the Handle to be a constraint to Rebar.


I use Shape Driven Rebar
Sorry, I use google translate because my english is not good.
Thanks all

 

Screenshot 2024-09-24 041734.png

4 REPLIES 4
Message 2 of 5
jeremy_tammik
in reply to: vankhoi9966

I searched my files and found some hints in the DLL-embedded Revit API documentation:

   

Searching 6234 files for "ToOtherRebar" (regex)

~/a/src/rvt/ObjExporter/bin/Debug/RevitAPI.xml:
 22488  </summary>
 22489        <remarks>
 22490:    The RebarConstraintType of the RebarConstraint must be 'ToOtherRebar,' and the
 22491     RebarTargetConstraintType must be 'Edge' or 'BarBend.'
 22492  </remarks>
 .....
 22513      <member name="M:Autodesk.Revit.DB.Structure.RebarConstraint.TargetRebarConstraintTypeIsEdge">
 22514        <summary>
 22515:    Returns true if the RebarConstraintType of the RebarConstraint is 'ToOtherRebar,'
 22516     and the RebarConstraint is attached to an edge of the other Rebar Element.
 22517  </summary>
 .....
 22528  </since>
 22529      </member>
 22530:     <member name="M:Autodesk.Revit.DB.Structure.RebarConstraint.IsToOtherRebar">
 22531        <summary>
 22532:    Returns true if the RebarConstraintType of the RebarConstraint is 'ToOtherRebar.'
 22533  </summary>
 22534        <since>
 .....
 22688     RebarConstraint is no longer valid.
 22689     -or-
 22690:    The RebarConstraint is not of RebarConstraintType 'ToOtherRebar.'
 22691     -or-
 22692     The RebarTargetConstraintType is not 'HookBend' or 'BarBend'.
 .....
 22701        <summary>
 22702     Returns 0 or 1 to indicate which end hook on the other Rebar Element to which this RebarConstraint is attached.
 22703:    The RebarConstraint must be of RebarConstraintType 'ToOtherRebar,' and the TargetRebarConstraintType
 22704     must be 'HookBend.'
 22705     Rebar must be Shape Driven Rebar element.
 .....
 22711     RebarConstraint is no longer valid.
 22712     -or-
 22713:    The RebarConstraint is not of RebarConstraintType 'ToOtherRebar.'
 22714     -or-
 22715     The RebarTargetConstraintType is not 'HookBend'
 .....
 22724        <summary>
 22725     Returns the number of the bend on the other Rebar Element to which this RebarConstraint is attached.
 22726:    The RebarConstraint must be of RebarConstraintType 'ToOtherRebar,' and the TargetRebarConstraintType
 22727     must be 'BarBend.'
 22728     Rebar must be Shape Driven Rebar element.
 .....
 22731     RebarConstraint is no longer valid.
 22732     -or-
 22733:    The RebarConstraint is not of RebarConstraintType 'ToOtherRebar.'
 22734     -or-
 22735     The RebarTargetConstraintType is not 'BarBend'
 .....
 22744        <summary>
 22745     Returns the number of the edge on the other Rebar Element to which this RebarConstraint is attached.
 22746:    The RebarConstraint must be of RebarConstraintType 'ToOtherRebar,' and the TargetRebarConstraintType
 22747     must be 'Edge.'
 22748     Rebar must be Shape Driven Rebar element.
 .....
 22751     RebarConstraint is no longer valid.
 22752     -or-
 22753:    The RebarConstraint is not of RebarConstraintType 'ToOtherRebar.'
 22754     -or-
 22755     The RebarConstraint is not attached to an edge, or bend, or hook bend of another Rebar Element.
 .....
 22765     Returns the TargetRebarConstraintType of the handle on the other Rebar Element
 22766     to which this RebarConstraint is attached. The RebarConstraintType of the
 22767:    RebarConstraint must be 'ToOtherRebar.'
 22768     Rebar must be Shape Driven Rebar element.
 22769  </summary>
 .....
 22771     RebarConstraint is no longer valid.
 22772     -or-
 22773:    The RebarConstraint is not of RebarConstraintType 'ToOtherRebar.'
 22774     -or-
 22775     Constrained rebar is a free form rebar element.
 .....
 23223  </since>
 23224      </member>
 23225:     <member name="F:Autodesk.Revit.DB.Structure.RebarConstraintType.ToOtherRebar">
 23226        <summary>
 23227     Handle is attached to a handle on another Rebar Element.  Only applies to
 .....
 24546     locked dimension, moving one of dimension references, and then re-locking the
 24547     dimension - all in one step.</p>
 24548:         <p>When a handle with a ToCover or ToOtherRebar preferred constraint is dragged by
 24549     the user, it will snap back to its constraint target, unless it is dragged
 24550     beyond tolerance distance.  In that case, it will select a new constraint using

   

Maybe you can glean some info from them. Another way to explore how to achieve this might be to set up the required constraint manually in the end user interface and then use RevitLookup and other database exploration tools to analyse the resulting elements, their properties and relationships. Meanwhile, I also asked the development team for advice for you.

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
Message 3 of 5
vankhoi9966
in reply to: jeremy_tammik

Thanks Jeremy Tammik so much, I really tried everything but couldn't create a RebarConstraint with type ToOtherRebar.

I noticed that when I get all the RebarConstraints of Handle there is no RebarConstraint type ToOtherRebar even though I set it manually in Revit environment.

 

Thanks again, if there is any new information please let me know

Message 4 of 5
jeremy_tammik
in reply to: vankhoi9966

Answer:

   

 

From the picture, it looks like you want to set it to "true".

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
Message 5 of 5
vankhoi9966
in reply to: jeremy_tammik

Thanks jeremy_tammik, maybe my question was not clear, I apologize for this.

My problem is that I cannot get or create a RebarConstraint with type ToOtherRebar so that I can continue processing in the API if the user has not manually manipulated in the Revit environment for the Handle to be a constraint to Rebar.

 

Thanks

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report