乐筑天下

搜索
欢迎各位开发者和用户入驻本平台 尊重版权,从我做起,拒绝盗版,拒绝倒卖 签到、发布资源、邀请好友注册,可以获得银币 请注意保管好自己的密码,避免账户资金被盗
查看: 93|回复: 4

[综合讨论] SolidWorks API - Copy part nam

[复制链接]

1

主题

3

帖子

2

银币

初来乍到

Rank: 1

铜币
5
发表于 2022-7-8 21:41:45 | 显示全部楼层 |阅读模式
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!!
回复

使用道具 举报

1

主题

90

帖子

89

银币

初来乍到

Rank: 1

铜币
5
发表于 2022-7-8 22:09:54 | 显示全部楼层
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
回复

使用道具 举报

1

主题

3

帖子

2

银币

初来乍到

Rank: 1

铜币
5
发表于 2022-7-8 22:20:16 | 显示全部楼层
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!
回复

使用道具 举报

1

主题

90

帖子

89

银币

初来乍到

Rank: 1

铜币
5
发表于 2022-7-8 22:31:52 | 显示全部楼层
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.
回复

使用道具 举报

1

主题

3

帖子

2

银币

初来乍到

Rank: 1

铜币
5
发表于 2022-7-8 22:52:32 | 显示全部楼层
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!
回复

使用道具 举报

发表回复

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

QQ|关于我们|小黑屋|乐筑天下 繁体中文

GMT+8, 2025-3-4 01:20 , Processed in 1.079381 second(s), 62 queries .

© 2020-2025 乐筑天下

联系客服 关注微信 帮助中心 下载APP 返回顶部 返回列表