×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

SolidWorks API - Copy part name text

SolidWorks API - Copy part name text

SolidWorks API - Copy part name text

(OP)
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!!

RE: SolidWorks API - Copy part name text

(OP)
Thanks for the reply! I have come across that one though. That one does a full feature tree copy. What I am looking for is to only copy the main part name of what is selected, not the whole tree and all it's subcontext. I'm going to keep looking and trying to modify this script though. Any other suggestions or pointers would be great though!

Thanks again!

RE: SolidWorks API - Copy part name text

This solution requires a few clicks, but it may get you where you need. A macro could probably be made from these steps, but I am not a macro guru...

From the model, you can Insert, Tables, Bill Of Material...
Once configured how you want, RMB on the BOM, Save as, then select the Save as Type (Excel works great). Once in Excel, you can copy paste all the PN's as desired.

RE: SolidWorks API - Copy part name text

(OP)
Hmm, that could work. I'll run it by the designers and see if they'd be ok with that option. Then I'll work on seeing if it can be made into a macro. Thanks for the idea!

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources