×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Macro

Macro

(OP)
I have a design table inserted into my assembly that controls the motion of a skeleton sketch. I'm using the design table to drive one dimesion while getting the results of another dimension. The problem is that you have to activate each configuration in order for the design table to record the result of the second dimension. In my case i have 70 configs. Does anyone have a Macro that will do this process for me? or is there an easier way to get this information.

Thanks

RE: Macro

Can you explain a bit more about what you are trying to do & how you are doing it?

Can you not build formulae/equations into the DT which populate the other configuration dimensions?

cheers
Helpful SW websites FAQ559-520
How to find answers ... FAQ559-1091

RE: Macro

I made my DT's fully automated, using Excel formula's and equations... I never had any problems such as that... but you do have to activate the config before the model would update to the new specs given for each COnfig.

Regards,

Scott Baugh, CSWP
www.scottjbaugh.com
FAQ731-376

RE: Macro

If you want to force a rebuild of every configuration there is a macro in the help to do that.  Here it is:

Quote (SolidWorks API Help):


Forcibly Rebuild All Configurations Example (VB)
This example shows how to forcibly rebuild all of the configurations in a SolidWorks document.

 

CODE

'--------------------------------------

Option Explicit

Sub main()

    Dim swApp                   As SldWorks.SldWorks

    Dim swModel                 As SldWorks.ModelDoc2

    Dim vConfNameArr            As Variant

    Dim sConfigName             As String

    Dim nStart                  As Single

    Dim i                       As Long

    Dim bShowConfig             As Boolean

    Dim bRebuild                As Boolean

    Dim bRet                    As Boolean

    

    Set swApp = CreateObject("SldWorks.Application")

    Set swModel = swApp.ActiveDoc

    

    Debug.Print "File = " + swModel.GetPathName

    

    vConfNameArr = swModel.GetConfigurationNames

    For i = 0 To UBound(vConfNameArr)

        sConfigName = vConfNameArr(i)

        

        bShowConfig = swModel.ShowConfiguration2(sConfigName)

        

        nStart = Timer

        bRebuild = swModel.ForceRebuild3(False)

        

        Debug.Print "  Config       = " & sConfigName

        Debug.Print "    ShowConfig = " & bShowConfig

        Debug.Print "    Rebuild    = " & bRebuild

        Debug.Print "    Time       = " & Timer - nStart & " s"

    Next i

End Sub

'--------------------------------------

RE: Macro

(OP)
Thanks Handleman, That is exactly what i was looking for.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources