Hello,
I'm in the situation that I have to insert same two parts into more than 200 assemblies.
Are there any feature that I can do it one shot or do it automatically?
Hello,
I'm in the situation that I have to insert same two parts into more than 200 assemblies.
Are there any feature that I can do it one shot or do it automatically?
And related to this one, if you have to put both parts into every assembly, you can make an assembly of the two parts, put that into your assemblies and dissolve the sub-assembly in the assembly.
And sometimes, the best way is to just, in an organized manner (I tend to keep spreadsheets and mark things off) so that you know which assemblies you have completed, go through them one by one. If it is likely to need to be done again, I would spend the time researching macros.
Minkyu Bae - Do you need to "Add" the components or "Replace" ? Don't know if a Macro is capable or not
John Stoltzfus wrote:
Minkyu Bae - Do you need to "Add" the components or "Replace" ? Don't know if a Macro is capable or not
With a macro, you still need to open each assembly and run the macro - I don't think you can't run in the background to insert the part into the assembly which you can do for 200 assemblies at once
EDIT:
Is there a way to save all the names of the assemblies (200) into a text file ?
If yes, then you can use a macro to retrieve the assembly from the text file and add the component to each assembly at 0,0,0 (no mate)
Here is the macro. Try to replace the part1.sldpt and Assem1.sldasm with your part and assembly and run it
If you get a list of 200 assembly names, then a loop can be added to run thru the 200 files
So with one click, all will be done
Option Explicit
Dim swApp As New SldWorks.SldWorks
Dim swModel As ModelDoc2
Dim Part As SldWorks.ModelDoc2
Dim Assembly As AssemblyDoc
Dim AssemblyTitle As String
Dim errLong As Long
Dim warnLong As Long
Sub Main()
Set swApp = Application.SldWorks
Set Part = swApp.OpenDoc6("C:\Temp\Part1.SLDPRT", swDocPART, 0, "", errLong, warnLong)
Set Assembly = swApp.OpenDoc6("C:\Temp\Assem1.SLDASM", swDocASSEMBLY, 0, "", errLong, warnLong)
AssemblyTitle = Assembly.GetTitle
Set swModel = swApp.ActivateDoc3(AssemblyTitle, True, swUserDecision, errLong)
Set Assembly = swModel
Assembly.AddComponent5 "C:\Temp\Part1.SLDPRT", swAddComponentConfigOptions_CurrentSelectedConfig, "", False, "", 0, 0, 0
End Sub
Minkyu Bae wrote:
nothing, everything just needs to stay on the orgin.
In that case I'd definitely create a sub-assembly of these two Parts. With this sub-assembly open, open a main Assembly and select the "Insert Components" command. Select the sub-assembly, then click on the green check mark at the top of the "Insert Component" feature manager without clicking in the graphics area. That will "Fix" the sub-assembly with its three main planes aligned with those of the main Assembly. Save and close the Assembly and move on the next one. It should only take a few seconds for each one.
I also know nothing about #TASK, but it may be possible to have it do this for you.
Also, there's #TASK
I don't know if it will help, but others with more knowledge of this software may be able to help.
Kevin
wow 200 assemblies get 2 new parts...
sounds like a lot of time you get to spend doing that.
if they are replacing other parts, and you are changing them out, you can do the replace thing.
I used to like the idea of finding faster ways to do repetitive stuff,
depending on how big all 200 assemblies are can you create one assembly that has them all. One time way back when, i added our whole library of parts into one assembly to use the bom to add descriptions to all the parts.
I think that you may be able to do this with find and replace and have all the assemblies updated at one time.
if they are new parts that need to be added, take you time, make sure each one is right, and enjoy the ride.
No matter which way you go, David Matula has some very good advice about taking your time and making sure each one is right. It would be very frustrating to have to redo something another 200 times because you missed something.
Good luck.
Since it's moderated so I post here again
Here is the macro. Try to replace the part1.sldpt and Assem1.sldasm with your part and assembly and run it
If you get a list of 200 assembly names, then a loop can be added to run thru the 200 files
So with one click, all will be done
Option Explicit
Dim swApp As New SldWorks.SldWorks
Dim swModel As ModelDoc2
Dim Part As SldWorks.ModelDoc2
Dim Assembly As AssemblyDoc
Dim AssemblyTitle As String
Dim errLong As Long
Dim warnLong As Long
Sub Main()
Set swApp = Application.SldWorks
Set Part = swApp.OpenDoc6("C:\Temp\Part1.SLDPRT", swDocPART, 0, "", errLong, warnLong)
Set Assembly = swApp.OpenDoc6("C:\Temp\Assem1.SLDASM", swDocASSEMBLY, 0, "", errLong, warnLong)
AssemblyTitle = Assembly.GetTitle
Set swModel = swApp.ActivateDoc3(AssemblyTitle, True, swUserDecision, errLong)
Set Assembly = swModel
Assembly.AddComponent5 "C:\Temp\Part1.SLDPRT", swAddComponentConfigOptions_CurrentSelectedConfig, "", False, "", 0, 0, 0
End Sub
200 assemblies,
400 parts to add.
ok so you added 2 parts to 200 assemblies,
now you have 2 drawings for 2 parts,
do you have 200 drawings for each assembly,
The automation is nice but somewhere you have to take some time to prove out the process.
been there done that and shared all the shortcuts with others in the company...then they did not need me any more,
should have stuck with the boring slow process. routine same click this drawing as the other drawing. slow painful same old thing this time as it was last time.
I looked at being more efficient, to save my sanity and to be able to do more exciting things that never came, unless you consider sitting at home and being depressed exciting.
I don't think so
Unless using API - see my other response !