hayyagahoy Posted September 26, 2013 Posted September 26, 2013 Hello, I am fairly new to SolidWorks and even newer to scripting. Our design department recently came to me wondering if there was a way to create a macro that when they selected a part in the feature tree on the left hand side, and pushed the macro hotkey, if the name could be copied to the clipboard to be pasted in other programs. We have various documents that they need the name of, and right now they are right clicking on the part name and selecting properties, and getting to the name that way to copy it. It would be a lot easier for them if they could just do a quick key similar to ctrl+c to copy it. It would be even better if they could select multiple parts at a time, and have it copy each part name on a different line so when you pasted it, it would look similar to: part1 part2 part3 If anyone has anyone could help me out it would be very much appreciated. Even if all you can give me is pointers or suggestions. Thanks very much!! Quote
bhamze Posted October 2, 2013 Posted October 2, 2013 (edited) Copy Feature Names Place In Clip Board.zip I'm a bit hesitate sharing this macro as I'm not an API expert and newish myself. The code has no error handling so make sure you have the features selected in feature tree before running macro. Select your items, run macro then paste items in note, word etc... Copy Assembly Part Names to Clip Board.zip Edited October 3, 2013 by bhamze Quote
hayyagahoy Posted October 4, 2013 Author Posted October 4, 2013 Thanks for sharing that with me! It didn't exactly work for me, it isn't picking up that anything is selected in the feature tree. But it's a good start for me to go off of. I really appreciate it! Quote
bhamze Posted October 4, 2013 Posted October 4, 2013 Are you in an assembly or part? There are two macros attached, one for part files and one for assemblies. They both work for me. Curious why it's not working for u. Quote
hayyagahoy Posted October 4, 2013 Author Posted October 4, 2013 I had tried both a part and assembly. But I also didn't realize you posted two! The copy feature names didn't work for me in either, but the copy assembly part names worked great! That's exactly what I was trying to do, thank you very much! Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.