I know there must be one out there but I can't find it!
Does anyone know where I can get a macro that when run inside anassembly creates a new part, asks for file name and save locationthen inserts that part into the active assembly setting it to fixedor mated?
I've tried recording a macro but of course I don't know how to getit to ask for user input a the save stage.
Thanks for your help. Very much appreciated.SolidworksApi macros


Does anyone know where I can get a macro that when run inside anassembly creates a new part, asks for file name and save locationthen inserts that part into the active assembly setting it to fixedor mated?
I've tried recording a macro but of course I don't know how to getit to ask for user input a the save stage.
Thanks for your help. Very much appreciated.SolidworksApi macros

The functionality you describe was more or less how SolidWorksworked prior to SW2008 when using the 'Insert New Part' function.
I don't like the virtual component functionality introduced inSW2008 - or to be more precise I don't like that I am forced to useit. It gives me an extra step in the process because I ALWAYS saveout the parts. Is that the same reason you have for such a macro?
I don't know if a ready-made macro can be found somewhere. I willbe happy to assist you with specific questions/problems if you havesomething to start with.
Anyway, back to the topic of a macro...
I know nothing of VB but have decided to learn since many if notall my enhancement requests can be solved with macros. All I havedone is to use the record macro function which has produced thedesired result only it doesn't give the option to nominate the newpart name or save location. I just need to find the VB functionthat brings up the dialogue box for user input. I have tried toupload it up get an error.
Ivan,
As mentioned I know zip about VB... so I just ran the macro withinan open assembly you attached and it starts a new part file butdoes not insert it nor give me the option to name it. What is theintended usage of the macro?
I am off to buy a VB book today! Thanks
in my macro, if you choose tools -> references, are you missing"microsoft common dialog control" ?
Scott Manning wrote:
Here is the macro...
Stay tuned. The next couple of days I am busy with meetings andthings to do so I am not able to assist you right now. I will getback to you later this week (if you still need help).
ivana kolin wrote:
in my macro, if you choose tools -> references, are youmissing "microsoft common dialog control" ?
I don't have that control available in the "references" as youmention. I'll go and have a google and track it down.
Open assembly, save assembly. Run macro.
The macro still created a new part but did not save it (no dialoguebox or anything) nor insert it into the assembly.... Still doingsomething wrong?
FWIW, I am using SW2009 SP2.1 on WinXP SP2
Thanks, I appreciate your help