AnsweredAssumed Answered

Macro dimension across a centerline

Question asked by Neil Anderson on Jul 10, 2019
Latest reply on Jul 11, 2019 by Deepak Gupta

Hi All,


Using SW version 17. 


Trying to dimension across a centerline which should turn the dimension into a diameter.  If you have manually smart dimensioned this way prior to running the macro, it works perfect…..BUT…..if you run the macro first thing after opening solidworks, or before manually smart dimensioning across the centerline, you get a radius, even though the dimension is placed on the opposite side of the centerline via the macro.  It’s almost as if the first time you manually use smart dimension, it initializes some unknown variable that tells solidworks that it is in “diameter mode”. 


To illustrate:

  1. Open a fresh instance of solidworks and open the attached part file. 
  2. Run the Centerline_Example.swp macro (attached) immediately after opening.  When I run this, I get the below:

  1. Manually use smart dimension to create the diameter dimension across the centerline
  • Delete the manually created dimension


  1. Run the Centerline_Example.swp macro
  2. Results in the correct Ø2.0 diameter and will continue to result in a diameter dimension until you shut down solidworks and restart again.

Obviously the workaround is to open solidworks, manually dimensions across a centerline, but is there a way to avoid this? 


Thank you all in advance.