3 Replies Latest reply on Oct 18, 2017 3:16 AM by Deepak Johsh

    Macro help on Drawings in Dual Dimensions:

    Deepak Johsh

      HI Guys,

       

      I have a need to create drawings of parts with its dimensions presented on drawings in dual dimensions, mm [Inch]. I have custom template available for same.

      Now I have a convention to follow on these drawings on the decimal precision.

      For ex: if the dimension is 80.00 in mm (primary dimension), i need the dimension in inches to be [2.362].
      ie if its two decimal places in MM then i would need 2+1= 3 decimal places in inches.

      I create the model while precising the dimension and required accuracy of decimals in mm. The numbers of places of decimals (accuracy) is bound to change.

       

      Could you please help me with a macro which would change the precision in the Dimensions decimal places of dual dimension (inches) to be one place more than that of the primary unit mm????

      i.e for;

      1. X.XX mm ==> Y.YYY in

      2. X.XXX mm ==> Y.YYYY in

      i would like to run this macro in solid works drawing environment and i would like to have all the dimension in the drawing update with a click of a button.

       

      Thanks in advance!!!

        • Re: Macro help on Drawings in Dual Dimensions:
          Solid Air

          What kind of help are you looking for?  Do you want someone to completely write the macro for you?

           

          I looked at what might be required (I state might because there are normally a couple ways to get where you want to go).

           

          Looks like you will need to traverse the feature manager tree of the drawing to find all the views.  For each view you will need to get the display dimension object for each dimension.  Once you have that you can get the primary precision and alternate precision.  The trick now is that if the precision is set to the default value the actually precision is not returned you need to look at values set in the document for the dimension type.  Of course you need to do this for each dimension in the view then repeat the procedure for each view.

           

          Seems like it will be a fairly complex macro to write.  I can probably help you get started...

           

          EDIT:  After giving it some more thought, you would only need to get the default precision once (I assume the default is set to two places for mm and three places for alternate inch?  If that is the case, when you find the primary is set to default then all you need do is make sure the alternate is set to default.

          • Re: Macro help on Drawings in Dual Dimensions:
            Deepak Gupta

            You can try the manual method by selecting the dimensions one by one (having same decimal precision) and can change their decimal precision setting in one go. Repeat as needed for other dimensions.