Control the laid out area of rebar set










0















I am using Revit API to create a set of rebar for a beam. By default, when I change the layout rule (using Revit API as well as end user UI), no matter where I place my rebars, they will automatically adjust to spread out the entire face of the host (in this case, the top face of the beam).



However, I want to control the area that my rebars will be laid out so that they only cover a small part but not the entire face of the host when I change rebar layout rule (using Revit API). If I using the end user UI, I can manually grab the handle at the edge of rebar set then adjust the laid out-area after changing layout rule.



I intend to switch from "single" rule (default) to "fixed number" rule. How can I do this? In the worst scenario, I can use "single" rule and place each of the rebar at the desire place, though.










share|improve this question


























    0















    I am using Revit API to create a set of rebar for a beam. By default, when I change the layout rule (using Revit API as well as end user UI), no matter where I place my rebars, they will automatically adjust to spread out the entire face of the host (in this case, the top face of the beam).



    However, I want to control the area that my rebars will be laid out so that they only cover a small part but not the entire face of the host when I change rebar layout rule (using Revit API). If I using the end user UI, I can manually grab the handle at the edge of rebar set then adjust the laid out-area after changing layout rule.



    I intend to switch from "single" rule (default) to "fixed number" rule. How can I do this? In the worst scenario, I can use "single" rule and place each of the rebar at the desire place, though.










    share|improve this question
























      0












      0








      0








      I am using Revit API to create a set of rebar for a beam. By default, when I change the layout rule (using Revit API as well as end user UI), no matter where I place my rebars, they will automatically adjust to spread out the entire face of the host (in this case, the top face of the beam).



      However, I want to control the area that my rebars will be laid out so that they only cover a small part but not the entire face of the host when I change rebar layout rule (using Revit API). If I using the end user UI, I can manually grab the handle at the edge of rebar set then adjust the laid out-area after changing layout rule.



      I intend to switch from "single" rule (default) to "fixed number" rule. How can I do this? In the worst scenario, I can use "single" rule and place each of the rebar at the desire place, though.










      share|improve this question














      I am using Revit API to create a set of rebar for a beam. By default, when I change the layout rule (using Revit API as well as end user UI), no matter where I place my rebars, they will automatically adjust to spread out the entire face of the host (in this case, the top face of the beam).



      However, I want to control the area that my rebars will be laid out so that they only cover a small part but not the entire face of the host when I change rebar layout rule (using Revit API). If I using the end user UI, I can manually grab the handle at the edge of rebar set then adjust the laid out-area after changing layout rule.



      I intend to switch from "single" rule (default) to "fixed number" rule. How can I do this? In the worst scenario, I can use "single" rule and place each of the rebar at the desire place, though.







      c# revit-api revit






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 14 '18 at 4:43









      Thế LongThế Long

      1048




      1048






















          1 Answer
          1






          active

          oldest

          votes


















          0














          The development team already answered your question in the Revit API discussion forum thread on controlling the laid out area of rebar set:



          There is a difference between how the layout rule is changed from API or from UI. I’ll explain how it works from API for a Shape Driven Rebar.



          We have a Rebar element. We obtain the RebarShapeDrivenAccessor and we will work with this class. There is a property called Normal. It represent the normal of the plane on which the rebar is bent. Also, based on this vector it will decide in which direction will expand the set.



          The function



          public void SetLayoutAsFixedNumber(
          int numberOfBarPositions, double arrayLength,
          bool barsOnNormalSide, bool includeFirstBar,
          bool includeLastBar);



          has the following parameters:



          • numberOfBarPositions - How many bars are in the set

          • arrayLength – How long is the set - the distance between the first bar and the last bar in the set

          • barsOnNormalSide - In which part will go the set, in the direction of the normal or opposite

          • includeFirstBar - True if the first bar in set should be visible, false otherwise

          • includeLastBar - True if the last bar in set should be visible, false otherwise

          So, when will change layout from single to any other layout the bar that you see on screen it will keep its position and will be the first bar in the set. It will calculate where is the last bar in the set according to the arrayLength and barsOnNormalSide and will distribute the bars between these two.



          In order to obtain the result you can set layout with the array length equal with your zone length (the set will start from the existing bar on the screen) and then you can move the Rebar element where you want.



          Or, you can move the single bar where zone starts and then set layout with array length equal with your zone length.






          share|improve this answer























          • Thank you tanking time answer a duplicated question from Revit API forum. At the time I post these 2 question, I was trying to change layout rule using rebar Built-In Parameter and realize that there is no parameter for the array length. It made me quite confuse since something that is necessary to be modified does not have a parameter. Later on, it seems to me that a few other properties do not have their parameters either.

            – Thế Long
            Nov 23 '18 at 7:18











          • That should teach me a lesson not to abuse Revit Lookup for some APIs and utils classes exist for a reason.

            – Thế Long
            Nov 23 '18 at 7:19










          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53293314%2fcontrol-the-laid-out-area-of-rebar-set%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          The development team already answered your question in the Revit API discussion forum thread on controlling the laid out area of rebar set:



          There is a difference between how the layout rule is changed from API or from UI. I’ll explain how it works from API for a Shape Driven Rebar.



          We have a Rebar element. We obtain the RebarShapeDrivenAccessor and we will work with this class. There is a property called Normal. It represent the normal of the plane on which the rebar is bent. Also, based on this vector it will decide in which direction will expand the set.



          The function



          public void SetLayoutAsFixedNumber(
          int numberOfBarPositions, double arrayLength,
          bool barsOnNormalSide, bool includeFirstBar,
          bool includeLastBar);



          has the following parameters:



          • numberOfBarPositions - How many bars are in the set

          • arrayLength – How long is the set - the distance between the first bar and the last bar in the set

          • barsOnNormalSide - In which part will go the set, in the direction of the normal or opposite

          • includeFirstBar - True if the first bar in set should be visible, false otherwise

          • includeLastBar - True if the last bar in set should be visible, false otherwise

          So, when will change layout from single to any other layout the bar that you see on screen it will keep its position and will be the first bar in the set. It will calculate where is the last bar in the set according to the arrayLength and barsOnNormalSide and will distribute the bars between these two.



          In order to obtain the result you can set layout with the array length equal with your zone length (the set will start from the existing bar on the screen) and then you can move the Rebar element where you want.



          Or, you can move the single bar where zone starts and then set layout with array length equal with your zone length.






          share|improve this answer























          • Thank you tanking time answer a duplicated question from Revit API forum. At the time I post these 2 question, I was trying to change layout rule using rebar Built-In Parameter and realize that there is no parameter for the array length. It made me quite confuse since something that is necessary to be modified does not have a parameter. Later on, it seems to me that a few other properties do not have their parameters either.

            – Thế Long
            Nov 23 '18 at 7:18











          • That should teach me a lesson not to abuse Revit Lookup for some APIs and utils classes exist for a reason.

            – Thế Long
            Nov 23 '18 at 7:19















          0














          The development team already answered your question in the Revit API discussion forum thread on controlling the laid out area of rebar set:



          There is a difference between how the layout rule is changed from API or from UI. I’ll explain how it works from API for a Shape Driven Rebar.



          We have a Rebar element. We obtain the RebarShapeDrivenAccessor and we will work with this class. There is a property called Normal. It represent the normal of the plane on which the rebar is bent. Also, based on this vector it will decide in which direction will expand the set.



          The function



          public void SetLayoutAsFixedNumber(
          int numberOfBarPositions, double arrayLength,
          bool barsOnNormalSide, bool includeFirstBar,
          bool includeLastBar);



          has the following parameters:



          • numberOfBarPositions - How many bars are in the set

          • arrayLength – How long is the set - the distance between the first bar and the last bar in the set

          • barsOnNormalSide - In which part will go the set, in the direction of the normal or opposite

          • includeFirstBar - True if the first bar in set should be visible, false otherwise

          • includeLastBar - True if the last bar in set should be visible, false otherwise

          So, when will change layout from single to any other layout the bar that you see on screen it will keep its position and will be the first bar in the set. It will calculate where is the last bar in the set according to the arrayLength and barsOnNormalSide and will distribute the bars between these two.



          In order to obtain the result you can set layout with the array length equal with your zone length (the set will start from the existing bar on the screen) and then you can move the Rebar element where you want.



          Or, you can move the single bar where zone starts and then set layout with array length equal with your zone length.






          share|improve this answer























          • Thank you tanking time answer a duplicated question from Revit API forum. At the time I post these 2 question, I was trying to change layout rule using rebar Built-In Parameter and realize that there is no parameter for the array length. It made me quite confuse since something that is necessary to be modified does not have a parameter. Later on, it seems to me that a few other properties do not have their parameters either.

            – Thế Long
            Nov 23 '18 at 7:18











          • That should teach me a lesson not to abuse Revit Lookup for some APIs and utils classes exist for a reason.

            – Thế Long
            Nov 23 '18 at 7:19













          0












          0








          0







          The development team already answered your question in the Revit API discussion forum thread on controlling the laid out area of rebar set:



          There is a difference between how the layout rule is changed from API or from UI. I’ll explain how it works from API for a Shape Driven Rebar.



          We have a Rebar element. We obtain the RebarShapeDrivenAccessor and we will work with this class. There is a property called Normal. It represent the normal of the plane on which the rebar is bent. Also, based on this vector it will decide in which direction will expand the set.



          The function



          public void SetLayoutAsFixedNumber(
          int numberOfBarPositions, double arrayLength,
          bool barsOnNormalSide, bool includeFirstBar,
          bool includeLastBar);



          has the following parameters:



          • numberOfBarPositions - How many bars are in the set

          • arrayLength – How long is the set - the distance between the first bar and the last bar in the set

          • barsOnNormalSide - In which part will go the set, in the direction of the normal or opposite

          • includeFirstBar - True if the first bar in set should be visible, false otherwise

          • includeLastBar - True if the last bar in set should be visible, false otherwise

          So, when will change layout from single to any other layout the bar that you see on screen it will keep its position and will be the first bar in the set. It will calculate where is the last bar in the set according to the arrayLength and barsOnNormalSide and will distribute the bars between these two.



          In order to obtain the result you can set layout with the array length equal with your zone length (the set will start from the existing bar on the screen) and then you can move the Rebar element where you want.



          Or, you can move the single bar where zone starts and then set layout with array length equal with your zone length.






          share|improve this answer













          The development team already answered your question in the Revit API discussion forum thread on controlling the laid out area of rebar set:



          There is a difference between how the layout rule is changed from API or from UI. I’ll explain how it works from API for a Shape Driven Rebar.



          We have a Rebar element. We obtain the RebarShapeDrivenAccessor and we will work with this class. There is a property called Normal. It represent the normal of the plane on which the rebar is bent. Also, based on this vector it will decide in which direction will expand the set.



          The function



          public void SetLayoutAsFixedNumber(
          int numberOfBarPositions, double arrayLength,
          bool barsOnNormalSide, bool includeFirstBar,
          bool includeLastBar);



          has the following parameters:



          • numberOfBarPositions - How many bars are in the set

          • arrayLength – How long is the set - the distance between the first bar and the last bar in the set

          • barsOnNormalSide - In which part will go the set, in the direction of the normal or opposite

          • includeFirstBar - True if the first bar in set should be visible, false otherwise

          • includeLastBar - True if the last bar in set should be visible, false otherwise

          So, when will change layout from single to any other layout the bar that you see on screen it will keep its position and will be the first bar in the set. It will calculate where is the last bar in the set according to the arrayLength and barsOnNormalSide and will distribute the bars between these two.



          In order to obtain the result you can set layout with the array length equal with your zone length (the set will start from the existing bar on the screen) and then you can move the Rebar element where you want.



          Or, you can move the single bar where zone starts and then set layout with array length equal with your zone length.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 18 '18 at 19:29









          Jeremy TammikJeremy Tammik

          2,766157




          2,766157












          • Thank you tanking time answer a duplicated question from Revit API forum. At the time I post these 2 question, I was trying to change layout rule using rebar Built-In Parameter and realize that there is no parameter for the array length. It made me quite confuse since something that is necessary to be modified does not have a parameter. Later on, it seems to me that a few other properties do not have their parameters either.

            – Thế Long
            Nov 23 '18 at 7:18











          • That should teach me a lesson not to abuse Revit Lookup for some APIs and utils classes exist for a reason.

            – Thế Long
            Nov 23 '18 at 7:19

















          • Thank you tanking time answer a duplicated question from Revit API forum. At the time I post these 2 question, I was trying to change layout rule using rebar Built-In Parameter and realize that there is no parameter for the array length. It made me quite confuse since something that is necessary to be modified does not have a parameter. Later on, it seems to me that a few other properties do not have their parameters either.

            – Thế Long
            Nov 23 '18 at 7:18











          • That should teach me a lesson not to abuse Revit Lookup for some APIs and utils classes exist for a reason.

            – Thế Long
            Nov 23 '18 at 7:19
















          Thank you tanking time answer a duplicated question from Revit API forum. At the time I post these 2 question, I was trying to change layout rule using rebar Built-In Parameter and realize that there is no parameter for the array length. It made me quite confuse since something that is necessary to be modified does not have a parameter. Later on, it seems to me that a few other properties do not have their parameters either.

          – Thế Long
          Nov 23 '18 at 7:18





          Thank you tanking time answer a duplicated question from Revit API forum. At the time I post these 2 question, I was trying to change layout rule using rebar Built-In Parameter and realize that there is no parameter for the array length. It made me quite confuse since something that is necessary to be modified does not have a parameter. Later on, it seems to me that a few other properties do not have their parameters either.

          – Thế Long
          Nov 23 '18 at 7:18













          That should teach me a lesson not to abuse Revit Lookup for some APIs and utils classes exist for a reason.

          – Thế Long
          Nov 23 '18 at 7:19





          That should teach me a lesson not to abuse Revit Lookup for some APIs and utils classes exist for a reason.

          – Thế Long
          Nov 23 '18 at 7:19

















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53293314%2fcontrol-the-laid-out-area-of-rebar-set%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          這個網誌中的熱門文章

          How to read a connectionString WITH PROVIDER in .NET Core?

          Node.js Script on GitHub Pages or Amazon S3

          Museum of Modern and Contemporary Art of Trento and Rovereto