|
macro for inserting and mating a new part in an assembly
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 an assembly creates a new part, asks for file name and save location then inserts that part into the active assembly setting it to fixed or mated?
i've tried recording a macro but of course i don't know how to get it to ask for user input a the save stage.
thanks for your help. very much appreciated.
hi scott,
the functionality you describe was more or less how solidworks worked prior to sw2008 when using the 'insert new part' function.
i don't like the virtual component functionality introduced in sw2008 - or to be more precise i don't like that i am forced to use it. it gives me an extra step in the process because i always save out 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 will be happy to assist you with specific questions/problems if you have something to start with.
jorn bjarning
cswp
cad & plm consultant
sw2008 sp5 / sw2009 sp2
using common dialog from vb
thanks for your comments jorn. i do like the virtual feature functionality and use it quite a bit for things like fasteners and gaskets that aren't actually modeled in the assembly but need to appear in the bom. however when i do this it's from within a drawing by right clicking on the bom and selecting "insert new part". when in an assembly i never use it and as you say, resent being forced to which adds the extra work. i would appreciate the option of being asked for a file name and have lodged a enhancement request. i as you say, always save out the parts and so want to revert to the old behavior.
anyway, back to the topic of a macro...
i know nothing of vb but have decided to learn since many if not all my enhancement requests can be solved with macros. all i have done is to use the record macro function which has produced the desired result only it doesn't give the option to nominate the new part name or save location. i just need to find the vb function that brings up the dialogue box for user input. i have tried to upload it up get an error.
ivan,
as mentioned i know zip about vb... so i just ran the macro within an open assembly you attached and it starts a new part file but does not insert it nor give me the option to name it. what is the intended usage of the macro?
i am off to buy a vb book today! thanks
edited: 03/15/2009 at 07:34 pm by scott manning
here is the macro...
scott,
in my macro, if you choose tools -> references, are you missing "microsoft common dialog control" ?
originally posted by: scott manning
here is the macro...
scott,
stay tuned. the next couple of days i am busy with meetings and things to do so i am not able to assist you right now. i will get back to you later this week (if you still need help).
jorn bjarning
cswp
cad & plm consultant
sw2008 sp5 / sw2009 sp2
originally posted by: ivana kolin
in my macro, if you choose tools -> references, are you missing "microsoft common dialog control" ?
arrr yes. i see in there where there is no file reference - which causes the error. i got that far. so your macro then calls the dialogue control which allows the data to be entered?
i don't have that control available in the "references" as you mention. i'll go and have a google and track it down. |
|