2 Replies Latest reply on Feb 12, 2018 4:18 PM by Nilesh Patel

    How to use macro to choose the right size of the hardware?

    Marco Wu

      Assume I take a dowel pin from toolbox into my assembly, the macro will choose the diameter and the length of the dowel pin according the size of my holes and the thickness of the part. Is that possible?

        • Re: How to use macro to choose the right size of the hardware?
          Michael Spens

          Absolutely Marco.  The trick is to use topology traversal techniques.  For example. starting from a circular edge of a hole, you can get the underlying curve and its diameter using CircleParams.  Also, from the edge, you can get the two adjacent faces using GetTwoAdjacentFaces2.  Figure out which one is the cylinder, use GetSurface and check its IsCylinder property.  From the cylindrical face, get the other circular edge and check the distance between the two circular edges, again using CircleParams.  Then it is a matter of selecting the corresponding configuration in your dowel pin.

           

          Mike

          • Re: How to use macro to choose the right size of the hardware?
            Nilesh Patel

            Hi Marco,

             

            I would like to add few points to Michael Spens response.

             

            1. You will also need to get the thickness of other part as you fasten two or more parts using the fastener.

            2. You will also need to consider thicknesses of washers and nut if you are using them.

             

            Regards,

            Nilesh