15 Replies Latest reply on Oct 27, 2017 12:50 PM by Ian Pommer

    How to auto balloon all smart dimensions (without BOM)?

    Ian Pommer

      Hello -

       

      I am looking for a way to speed up our company's time spent adding bubbles to our internal sketches. We have probably a dozen new sketches a week, plus legacy drawings that need to be brought up to speed. I have personally bubbled sketches that have over 80 smart dimensions, so finding something that can either add balloons as features are dimensioned, or something that can parse through all the features and add bubbles would greatly reduce the workload on our ME department. We do not use a BOM, so the built-in "Auto Balloon" does not work. Something that could put a bubble at the "10 O'clock" position at every smart dimension would be great. Something that could grab every smart dimension, and bubble tied to each smart dimension and export to an Excel spread sheet would be ideal.

       

      I am willing/able to spend some time writing my own macro. I do have some programming history, but an unfamiliar with the SolidWorks API and VBA syntax, so obviously if I could find something that already does this that would save me a lot of time and stress.

       

      I am currently trying to learn some SolidWorks API through youtube videos, but I am apprehensive about wasting time on this endeavor.

       

      Thank you for your time,

       

      Ian

        • Re: How to auto balloon all smart dimensions (without BOM)?
          Amen Allah Jlili

          This is so specific I'm not sure you'd find something that would accomplish it 100%. Having said that, I don't think this would take you a lot of time to write a macro for it. Simply traverse all views, then for each view traverse all dimensions, select each dimension at a time then insert a note. By default, SOLIDWOKS will insert notes at the 10 o'clock position of the selected entity.

           

          Check this out: 2013 SOLIDWORKS API Help - Get Dimension Values in Drawing Example (VBA)


          Cheers,
          Amen
          CADHERO consulting SUARL – SOLIDWORKS API/PDM Design Automation & Training – SOLIDWORKS VBA MACROS, SOLIDWORKS Addins an…

            • Re: How to auto balloon all smart dimensions (without BOM)?
              Jacob Corder

              something like this?

               

               

               

               

              i am actually in the process of completing this project, however it is not a simple implementation

               

              what i would suggest to you is this

              loop through all of the display dimensions in all views in all sheets

              for each DisplayDimension that you want to add a balloon to call this function below

              For each Display Dimension Store this

              Dim DimBalloonTxt as string

              dimballoontxt = getdisplaydimensionText

              DimBalloonTxt = DimBalloonTxt & "|" & BalloonNoteAssigned

               

              later you can split this on your export to excel

               

               

              Public Function GetDisplayDimensionDisplayText() As String

                      Dim Txts() As String = GetDisplayDimensionDisplayTexts()

                      Dim Txt As String = ""

                      For i = 0 To UBound(Txts)

                          If Len(Trim(Txts(i))) > 0 Then

                              If Len(Trim(Txt)) = 0 Then

                                  Txt = Txts(i)

                              Else

                                  Txt = Txt & vbCrLf & Txts(i)

                                  'VBCRLF is the same as  Chr(13) + Chr(10)  i believe

                              End If

                          End If

                      Next

                      GetDisplayDimensionDisplayText =Txt

                  End Function

               

              Public Function GetDisplayDimensionDisplayText as string()

                      Dim RetTxt(3) As String

                      RetTxt(1) = DispDim.GetText(swDimensionTextParts_e.swDimensionTextCalloutAbove)

                      RetTxt(2) = DispDim.GetText(swDimensionTextParts_e.swDimensionTextCalloutBelow)

                      RetTxt(0) = DispDim.GetText(swDimensionTextParts_e.swDimensionTextPrefix)

                      RetTxt(3) = DispDim.GetText(swDimensionTextParts_e.swDimensionTextSuffix)

                      GetDisplayDimensionDisplayTexts = RetTxt

                  End Function

               

              Function AddBalloon(byval SwDispDim as displaydimension,byval BalloonTxtID as string) as boolean

              'Create the Coded Text for solidworks to create the balloon

              'you could use the solidworks built in Balloons but they only go to 99

              '<font size =2 color=0x000000ff> Makes the text Red

              '<font size =2 color=0x00000000> Makes the Text Black Again

              '<border type=1 size=0 padding=0>"  This is the circle boarder around the Balloon

               

              if you want the color a different color then use this

                   Dim BalloonTxt as string = "<font size =2 color=0x000000ff><border type=1 size=0 padding=0>" & BalloonTxtID & "</border><font size =3 color=0x00000000>

              if you want it the same color as the display Dimension Text then use this

              <border type=1 size=0 padding=0>" & BalloonTxtID & "</border>

              if you want the balloon smaller then this

              <FONT SIZE=2><border type=1 size=0 padding=0>" & BalloonTxtID & "</border><FONT SIZE=3"

               

              'use the one below that looks best to you

                   SwDispDim.SetTextAtIndex(SwDimensionTextParts_e.swDimensionTextSuffix,BalloonTxt)

                   or to

                   SwDispDim.SetTextAtIndex(SwDimensionTextParts_e.swDimensionTextCalloutAbove,BalloonTxt)

                   or to

                   SwDispDim.SetTextAtIndex(SwDimensionTextParts_e.swDimensionTextCalloutBelow,BalloonTxt)

                   or to

                   SwDispDim.SetTextAtIndex(SwDimensionTextParts_e.swDimensionTextPrefix,BalloonTxt)

              end function

               

               

              To export to excel you will need to store all of the DimensionValues and BalloonIDs as something

               

              Dim DimensionBalloon as string

               

              then the export to excel

               

               

              good luck

                • Re: How to auto balloon all smart dimensions (without BOM)?
                  Ian Pommer

                  Jacob -

                   

                  This does look helpful, however we have some specific situations... now that I am spending the time thinking about what our drafters are going through, this project might be more complicated than what I am prepared for.

                   

                  Considering I still have some stuff to learn with VBA, I probably won't be digging into this code or trying to implement until next week. However, I am marking it as the "correct answer" because I suspect I won't be getting a more thorough response than this.

                   

                  Thanks for your time,

                  Ian

              • Re: How to auto balloon all smart dimensions (without BOM)?
                Jim Steinmeyer

                Ian,

                Please forgive my ignorance, I don't understand the reasoning for placing a balloon on the smart dimensions. You mention not using BOMs so I wonder if the balloon is for part identification, but tagging it to the dim would not do that.

                  • Re: How to auto balloon all smart dimensions (without BOM)?
                    Dan Pihlaja

                    Tateos Tvapanyan wrote:

                     

                    Why you don't give a try on SolidWorks Inspection

                    YES!  That was what I was looking for to share, but I couldn't find it!   Good find Tateos!

                     

                    We had our VAR come here to trail it with us, but we were too deep into our process to change at the time.  It would have cost too much money to flip over.  Plus, we have to balloon our customer prints as well, which only come to us via PDF files and using Solidworks inspection would have meant laboriously recreating the PDF print in Solidworks.

                     

                    If you think that it might be a good fit, Call your VAR and ask them to give you a demo.

                      • Re: How to auto balloon all smart dimensions (without BOM)?
                        Deepak Gupta

                        Dan Pihlaja wrote:

                         

                        Plus, we have to balloon our customer prints as well, which only come to us via PDF files and using Solidworks inspection would have meant laboriously recreating the PDF print in Solidworks.

                        You do not need to redraw in SW as Inspection can also read PDF/Tiff files

                         

                        I'm not sure if this is available in earlier versions but yes for latest version. I would suggest you to take another look at it.

                        • Re: How to auto balloon all smart dimensions (without BOM)?
                          Ian Pommer

                          I was able to talk to GoEngineer and get a short trial period to test out Inspection 2017, since I guess our company tried it out 3-4 years back and it wasn't a good fit.

                           

                          I've been trying it out for a week now, and it's *so close* to being perfect software for us to cut down on a lot of labor hours. There are some hang-ups, and I have sent a list of concerns to an Applications Engineer, still waiting to hear back tho.

                           

                          For those of you who have tried Inspection, how flexible did you find it? Were you able to create your own export to excel commands to call for things not pre-built into the export tokens?  Where you able to insert features into the characteristic tree if something was skipped? How does exploding notes work?