is there a quicker way to do this...

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?

Reply to
joe
Loading thread data ...

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

mrcswp

Reply to
mrcswp

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.

Reply to
joe

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 & " " TraverseComponent swChildComp, nLevel + 1 ThisDocument.Rebuild (swForceRebuildAll) 'swForceRebuildAll = 2 End If Next i

End Sub

Corey

Reply to
CS

There wouldn't happen to be lightweight parts involved here, would there?

WT

Reply to
Wayne Tiffany

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

Corey

Reply to
CS

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.

Reply to
joe

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.

Reply to
joe

I think it may have wrapped from the line before you can delete it.

Reply to
CS

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.

'swForceRebuildAll

Reply to
joe

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

snipped-for-privacy@garlockequip.com

Remove any eroneous info to reply by e-mail

Reply to
CS

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

Reply to
Todd Brake

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"

Reply to
Jerry Steiger

"swChildComp.ReferencedConfiguration

sub-assembly

Reply to
joe

Redlight does this to you... sadly, mr. Guglielmetti went to e-Systems and all of his excellent macros / programs are eithert taken over by e-systems or they are just discontinued... I do have that redlight still somewhere...

more here:

formatting link
Mayby you can fin the redlight with the help of google... if not reply to this post and we´ll figure something out...

Last I would like to point out, that the redlight was originally designed to block excessive rebuilds in SW, but there is an option to rebuild all...

Reply to
Kvick

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

Corey

Reply to
CS

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

Reply to
Mike J. Wilson

PolyTech Forum website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.