5 Replies Latest reply on Jul 18, 2018 5:13 PM by Ben Langdon

    Dual Dimension Macro

    David Edwards
      I'm trying to set up a macro to add dual dimensions on drawings. We use the duals on the bottom and it defaults to the Top. When I make a macro, the record doesn't capture the radio button selection to place it on the bottom. Does anyone have a solution or a macro that would add dual dimensions and have them on the bottom?

      Thanks


      Running: SW2007 SP4.0
        • Dual Dimension Macro
          Mahir Abrahim
          Try this.

          ModelDoc2.SetUserPreferenceToggle (swDetailingDualDimensions, True)
          ModelDoc2.SetUserPreferenceIntegerValue (swDetailingDualDimPosition, swDualDimensionsOnBottom)

          By the way, I've never used this command. I found it by looking in the API help. I'm always happy to help, but in most cases you'll probably find what you're looking for more quickly if you check there first.
          • Dual Dimension Macro
            Anna Wood
            David,

            Why don't you save your drawing templates with the settings you like and just start your drawing with this drawing template that contains all your standard settings.

            Cheers,
              • Dual Dimension Macro
                David Edwards
                The drawing template works for new drawings but we have several existing drawings that need converted.

                Mahir
                The API code worked great. The last line is what I was looking for. Thanks a bunch. I did have to change it a little so below is the full code in case someone else was needing it.


                ' ******************************************************************************
                ' C:\DOCUME~1\xxxxxxxxx\LOCALS~1\Temp\swx3432\Macro1.swb - macro recorded on 11/26/07 by dedwards
                ' ******************************************************************************
                Dim swApp As Object
                Dim Part As Object
                Dim SelMgr As Object
                Dim boolstatus As Boolean
                Dim longstatus As Long, longwarnings As Long
                Dim Feature As Object
                Sub main()

                Set swApp = Application.SldWorks

                Set Part = swApp.ActiveDoc
                Set SelMgr = Part.SelectionManager
                Part.SetUserPreferenceToggle swDetailingDualDimensions, True
                Part.SetUserPreferenceIntegerValue swDetailingDualDimPosition, swDualDimensionsOnBottom
                End Sub