McMaster Cleaning Macro

Programming and macros
User avatar
SPerman
Posts: 1819
Joined: Wed Mar 17, 2021 4:24 pm
Answers: 13
x 2003
x 1677
Contact:

McMaster Cleaning Macro

Unread post by SPerman »

I thought I remembered someone on here mentioning a macro they used to clean all of the junk out of McMaster Carr part files. If someone could point me to that macro, or even that thread, I would appreciate it.
-
I may not have gone where I intended to go, but I think I have ended up where I needed to be. -Douglas Adams
User avatar
DanPihlaja
Posts: 741
Joined: Thu Mar 11, 2021 9:33 am
Answers: 24
Location: Traverse City, MI
x 737
x 891

Re: McMaster Cleaning Macro

Unread post by DanPihlaja »

SPerman wrote: Thu Jan 26, 2023 1:28 pm I thought I remembered someone on here mentioning a macro they used to clean all of the junk out of McMaster Carr part files. If someone could point me to that macro, or even that thread, I would appreciate it.
I don't use a macro. I just save the part as a parasolid and then overwrite the original Solidworks file. Works like a charm.
-Dan Pihlaja
Solidworks 2022 SP4

2 Corinthians 13:14
User avatar
SPerman
Posts: 1819
Joined: Wed Mar 17, 2021 4:24 pm
Answers: 13
x 2003
x 1677
Contact:

Re: McMaster Cleaning Macro

Unread post by SPerman »

I was hoping for one of these:
image.png
image.png (24.55 KiB) Viewed 1203 times
-
I may not have gone where I intended to go, but I think I have ended up where I needed to be. -Douglas Adams
User avatar
Frederick_Law
Posts: 1815
Joined: Mon Mar 08, 2021 1:09 pm
Answers: 8
Location: Toronto
x 1525
x 1367

Re: McMaster Cleaning Macro

Unread post by Frederick_Law »

You're assuming McMaster model are consistent.
I don't use a macro. I just save the part as a parasolid and then overwrite the original Solidworks file. Works like a charm.
Download STEP?
User avatar
SPerman
Posts: 1819
Joined: Wed Mar 17, 2021 4:24 pm
Answers: 13
x 2003
x 1677
Contact:

Re: McMaster Cleaning Macro

Unread post by SPerman »

That works for most items. I like having the history tree on fasteners so that I can suppress the threads.
-
I may not have gone where I intended to go, but I think I have ended up where I needed to be. -Douglas Adams
MattW
Posts: 50
Joined: Wed May 12, 2021 12:39 pm
Answers: 2
x 5
x 30

Re: McMaster Cleaning Macro

Unread post by MattW »

The biggest problem with McMaster Carr models is the visual properties are maxed out.
image.png
Setting these two sliders in the middle will cut the file size to 30% of what it is initially. Suppressing the helix will cut that in half again.

I have a macro for reducing image quality.
Alin
Posts: 310
Joined: Sun Mar 14, 2021 9:46 am
Answers: 3
x 260
x 389

Re: McMaster Cleaning Macro

Unread post by Alin »

MattW wrote: Thu Jan 26, 2023 5:06 pm The biggest problem with McMaster Carr models is the visual properties are maxed out.
image.png

Setting these two sliders in the middle will cut the file size to 30% of what it is initially. Suppressing the helix will cut that in half again.

I have a macro for reducing image quality.
Exactly! Also, delete all equations in the file.
User avatar
gupta9665
Posts: 359
Joined: Thu Mar 11, 2021 10:20 am
Answers: 20
Location: India
x 383
x 414

Re: McMaster Cleaning Macro

Unread post by gupta9665 »

Share one sample file and what changes you would need and then I will try to create one :)
Deepak Gupta
SOLIDWORKS Consultant/Blogger
User avatar
bnemec
Posts: 1848
Joined: Tue Mar 09, 2021 9:22 am
Answers: 10
Location: Wisconsin USA
x 2431
x 1330

Re: McMaster Cleaning Macro

Unread post by bnemec »

Don't download models from MMC or vendors. Start with a parent model and copy it to make all similar part types. Then they can be easily swapped out in the where used. Importing steps or SW models from everywhere will never likely not have same geometry IDs.

For example, in our data set a 1/4-20 x 1.00 SHCS and a 3/8-16 x 1.50 HHCS should have same face IDs for the cylinder that represents threads as well as the face under the head should have same ID on each. Anything else makes for a lot of lost time in product maint.
User avatar
DanPihlaja
Posts: 741
Joined: Thu Mar 11, 2021 9:33 am
Answers: 24
Location: Traverse City, MI
x 737
x 891

Re: McMaster Cleaning Macro

Unread post by DanPihlaja »

gupta9665 wrote: Fri Jan 27, 2023 12:16 am Share one sample file and what changes you would need and then I will try to create one :)
Basically, you want to get rid of unneeded design table data, update graphics slider to something lower, possibly suppress a helix (if applicable), and possibly get rid of equation data.
-Dan Pihlaja
Solidworks 2022 SP4

2 Corinthians 13:14
User avatar
Frederick_Law
Posts: 1815
Joined: Mon Mar 08, 2021 1:09 pm
Answers: 8
Location: Toronto
x 1525
x 1367

Re: McMaster Cleaning Macro

Unread post by Frederick_Law »

Randomly picked a few.
Attachments
90201A443_Extreme-Strength Grade 9 Steel Hex Head Screw.SLDPRT
(639.4 KiB) Downloaded 28 times
91268A618_High-Strength Grade 8 Steel Hex Head Screw.SLDPRT
(708.74 KiB) Downloaded 27 times
91813A160_Mil. Spec. Low-Strength Steel Hex Nut.SLDPRT
(285.32 KiB) Downloaded 27 times
90685A110_High-Strength Steel Hex Nut.SLDPRT
(409.45 KiB) Downloaded 34 times
User avatar
gupta9665
Posts: 359
Joined: Thu Mar 11, 2021 10:20 am
Answers: 20
Location: India
x 383
x 414

Re: McMaster Cleaning Macro

Unread post by gupta9665 »

Frederick_Law wrote: Mon Jan 30, 2023 10:49 am Randomly picked a few.
Can you add finished version of these files as well i.e. after making the required changes.
Deepak Gupta
SOLIDWORKS Consultant/Blogger
User avatar
Frederick_Law
Posts: 1815
Joined: Mon Mar 08, 2021 1:09 pm
Answers: 8
Location: Toronto
x 1525
x 1367

Re: McMaster Cleaning Macro

Unread post by Frederick_Law »

Sorry, I don't have SW. I just get them from McMaster Carr.
I'll let other clean that up.
Or upload what they use.
User avatar
SPerman
Posts: 1819
Joined: Wed Mar 17, 2021 4:24 pm
Answers: 13
x 2003
x 1677
Contact:

Re: McMaster Cleaning Macro

Unread post by SPerman »

After thinking about it over the weekend, what I want is to strip away everything that isn't directly related to the geometry (custom properties, equations, backgrounds, scenes, decals, etc.) Given that request, I think the easiest thing to do is as Fred suggested earlier, import a format that doesn't come with all of that overhead. For fasteners, I will have to decide what is the best way to eliminate the threads. (For those, maybe I will import the sw file, suppress the helix, then save as a step and re-import.)
-
I may not have gone where I intended to go, but I think I have ended up where I needed to be. -Douglas Adams
User avatar
zxys001
Posts: 1047
Joined: Fri Apr 02, 2021 10:08 am
Answers: 4
Location: Scotts Valley, Ca.
x 2259
x 961
Contact:

Re: McMaster Cleaning Macro

Unread post by zxys001 »

SPerman wrote: Mon Jan 30, 2023 3:56 pm After thinking about it over the weekend, what I want is to strip away everything that isn't directly related to the geometry (custom properties, equations, backgrounds, scenes, decals, etc.) Given that request, I think the easiest thing to do is as Fred suggested earlier, import a format that doesn't come with all of that overhead. For fasteners, I will have to decide what is the best way to eliminate the threads. (For those, maybe I will import the sw file, suppress the helix, then save as a step and re-import.)
or, saveas a parasolid (native, fast and no translation) :D
"Democracies aren't overthrown; they're given away." -George Lucas
“We only protect what we love, we only love what we understand, and we only understand what we are taught.” - Jacques Cousteau
Post Reply