is there a quicker way to do this...

Discussion in 'SolidWorks' started by joe, Nov 17, 2004.

  1. joe

    joe Guest

    I opened up an assembly containing 50+ parts and most of them are invisible.
    I know the remedy to the problem is to open each individual part into its
    own separate window and do a rebuild, but is there a way to apply the
    rebuild command to all of the parts in the assembly at the same time?
     
    joe, Nov 17, 2004
    #1
  2. joe

    mrcswp Guest

    Open the assembly and do a CTRL+Q on the assembly. Its a forced rebuild
    that will rebuild all models in the assembly.

    mrcswp
     
    mrcswp, Nov 17, 2004
    #2
  3. joe

    joe Guest

    by the time I read your suggestion I already fixed the problem by opening up
    each individual model that make up the assembly and rebuilding each one, and
    saved the rebuilt parts just in case. I then re-opened the assembly to make
    sure that I solved the problem, it did. Then saved the assembly. Then I ran
    ecosqueeze to shrink the file sizes. I've discovered that doing this caused
    the parts in the assembly to disappear again. So now I know that ecosqueeze
    was the cause of the disappearing parts, because when I opened up the
    assembly, the problem re-appeared, so I tried your tip of pressing ctrl+Q,
    but it didn't work. I was thinking that the reason that it didn't work was
    because there is one sub-assembly, so I opened up the sub-assembly in a
    separate window and tried the ctrl-q command on it, it still didn't rebuild
    the sub-assembly. Am I doing something wrong? I'm going to see if I can play
    around with the ecosqueeze settings so that I can prevent this from
    happening again.
     
    joe, Nov 17, 2004
    #3
  4. joe

    CS Guest

    I kindof thought that the CTRL-Q wouldn't recurse every part, though I
    wasn't quite sure.

    I seem to recall mention here of an absolute assembly rebuild macro but I
    haven't searched for it. Maybe you could google it and see if anything
    comes up. A macro shouldn't be all that hard.....Oh wait here I wrote one
    modified some code from solidworks website. Seemed to rebuild my assembly,
    but I don't know if it will resolve your problem Paste the code in an empty
    macro.

    Dim swapp As SldWorks.SldWorks
    Dim assy As SldWorks.AssemblyDoc

    Sub test()
    Dim firstComp As Component2
    Dim config As Configuration
    Dim m As ModelDoc2
    Set swapp = Application.SldWorks
    Set assy = swapp.ActiveDoc
    Set config = assy.GetActiveConfiguration
    Set firstComp = config.GetRootComponent

    TraverseComponent firstComp, 0

    End Sub


    Sub TraverseComponent _
    ( _
    swComp As SldWorks.Component2, _
    nLevel As Long _
    )

    Dim vChildComp As Variant

    Dim swChildComp As SldWorks.Component2

    Dim swCompConfig As SldWorks.Configuration

    Dim sPadStr As String

    Dim i As Long

    Dim SplitStr As Variant
    Dim ThisDocument As ModelDoc2


    For i = 0 To nLevel - 1

    sPadStr = sPadStr + " "

    Next i



    vChildComp = swComp.GetChildren

    For i = 0 To UBound(vChildComp)

    Set swChildComp = vChildComp(i)

    If swChildComp.GetSuppression = swComponentFullyResolved Then
    Set ThisDocument = swChildComp.GetModelDoc

    'swChildComp.Name2
    'Debug.Print sPadStr & swChildComp.Name2 & " <" &
    swChildComp.ReferencedConfiguration & ">"
    TraverseComponent swChildComp, nLevel + 1
    ThisDocument.Rebuild (swForceRebuildAll) 'swForceRebuildAll = 2
    End If
    Next i

    End Sub


    Corey
     
    CS, Nov 17, 2004
    #4
  5. There wouldn't happen to be lightweight parts involved here, would there?

    WT
     
    Wayne Tiffany, Nov 17, 2004
    #5
  6. joe

    CS Guest

    The macro will skip them so make sure everything is fully resolved first.
    Or edit to handle them.

    Corey
     
    CS, Nov 17, 2004
    #6
  7. joe

    joe Guest

    I tried to make a new macro by clicking tools>macro>new. I then gave the new
    macro the name of super rebuild.swp, witch then opened up the window witch
    allowed me to paste the code that you provided. Before I pasted the code
    though I noticed that the window were I would past the code, already had the
    words "Dim swApp As Object
    Sub main()

    Set swApp = Application.SldWorks
    End Sub" I over-wrote those commands with your code, doing so resulted in
    solidworks informing me that there was a syntax error in the code. It didn't
    like the line of code found near the end of the macro,
    "swChildComp.ReferencedConfiguration & ">". I don't know anything about vba
    or programming methods in solidworks, so I wouldn't know were to begin on
    how to fix the error, can you help please.
     
    joe, Nov 17, 2004
    #7
  8. joe

    joe Guest

    nope the parts aren't lightweight. that's the 1st thing that occurred to me
    too., but no such luck, the cause was an ecosqueeze setting called "remove
    parasolid" witch for some reason is the default setting, witch means that
    every time I use ecosqueeze I have to remember to un-select that option.
     
    joe, Nov 17, 2004
    #8
  9. joe

    CS Guest

    I think it may have wrapped from the line before you can delete it.
     
    CS, Nov 17, 2004
    #9
  10. joe

    joe Guest

    I've deleted the line of code saying "swChildComp.ReferencedConfiguration &
    ">", as you suggested. As a result solidworks no longer cries syntax
    errors., but the macro doesn't effect the assembly in any way. In fact I had
    to make sure that I ran the macro, so I did it twice. The macro still didn't
    do anything to the assembly. No progress bar or something to signify that sw
    was thinking.
     
    joe, Nov 18, 2004
    #10
  11. joe

    CS Guest

    Could you e-mail me the version of ecosqueeze you are using. Please zip and
    mask the file
    Ecosqueeze.zi_ because our firewall won't let me download it and we can't
    accept zips or exes through our e-mail so we have to cheat the system.

    Corey



    Remove any eroneous info to reply by e-mail
     
    CS, Nov 18, 2004
    #11
  12. joe

    Todd Brake Guest

    Joe:

    You need to be really careful about that "remove parasolid" option.
    If you have a file with an imported solid I've heard it will delete it
    and you'll have to recreate the part.

    I suggest you only use ecosqueeze when you're going to be sending
    files or archiving. Otherwise, it just takes a bunch of time and
    they'll inflate again as soon as you open them.

    Todd
     
    Todd Brake, Nov 18, 2004
    #12

  13. Something isn't right here. "Remove Parasolid" is not the default for
    EcoSqueeze, in fact the program puts up a warning when you check it. You
    should only have to uncheck it once. It should stay unchecked the next time
    you run it.

    Jerry Steiger
    Tripod Data Systems
    "take the garbage out, dear"
     
    Jerry Steiger, Nov 19, 2004
    #13
  14. joe

    joe Guest

    I tried to send it to address without the
    cErooneOus, but it bounced back, even though I attatched the program in the
    form requested, "ecosqueeze 3.12.1601._ip". Here's the link to where I got
    the program: http://www.ecocom.com/eng/index00.htm
     
    joe, Nov 19, 2004
    #14
  15. joe

    CS Guest

    you need the "c" in the front of the address I can't download it because of
    our fire wall I tried yesterday.

    Corey
     
    CS, Nov 19, 2004
    #15
  16. I haven't tried this, but there is a setting called "Verification on
    rebuild" in options. You can enable it and do the CTRL-Q.

    Just be sure and turn it off if you don't need it, since it greatly
    increases rebuild time.

    Mike Wilson
     
    Mike J. Wilson, Nov 20, 2004
    #16
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.