Viewing swp files without opening them in SolidWorks

Library for macros
gerard
Posts: 60
Joined: Wed Oct 05, 2022 10:24 am
Answers: 0
x 6
x 35

Viewing swp files without opening them in SolidWorks

Unread post by gerard »

Hey all,

I'm retiring in the 2nd quarter and want to document all my macros for future usage.

Is there a way to view the contents of a swp file without opening it in SolidWorks?

That would make the process a lot more efficient.

Thanks!
User avatar
AlexLachance
Posts: 2184
Joined: Thu Mar 11, 2021 8:14 am
Answers: 17
Location: Quebec
x 2364
x 2013

Re: Viewing swp files without opening them in SolidWorks

Unread post by AlexLachance »

Microsoft Visual Studio should do the trick.


Edit: forgot to mention, if those SWP are for SolidWorks macros, then most likely you will require a SolidWorks licence or the person who uses the macros to open them in vB so that they can load the SolidWorks references.
image.png
image.png (13.92 KiB) Viewed 3473 times
gerard
Posts: 60
Joined: Wed Oct 05, 2022 10:24 am
Answers: 0
x 6
x 35

Re: Viewing swp files without opening them in SolidWorks

Unread post by gerard »

AlexLachance wrote: Tue Jan 10, 2023 9:04 am Microsoft Visual Studio should do the trick.


Edit: forgot to mention, if those SWP are for SolidWorks macros, then most likely you will require a SolidWorks licence or the person who uses the macros to open them in vB so that they can load the SolidWorks references.

image.png
Thanks.

I'll look into that.
User avatar
josh
Posts: 295
Joined: Thu Mar 11, 2021 1:05 pm
Answers: 16
x 22
x 508

Re: Viewing swp files without opening them in SolidWorks

Unread post by josh »

I'm not sure what you mean by "Document all your macros for future usage"...

Why not just take the .swp files themselves? What is the value of having access to the code if you don't have SolidWorks? It's like having a set of car keys but no car.
User avatar
gupta9665
Posts: 410
Joined: Thu Mar 11, 2021 10:20 am
Answers: 25
Location: India
x 433
x 447

Re: Viewing swp files without opening them in SolidWorks

Unread post by gupta9665 »

josh wrote: Tue Jan 10, 2023 11:47 am I'm not sure what you mean by "Document all your macros for future usage"...
I believe OP wants to check and document what each macro does for making it easier to use.
Deepak Gupta
SOLIDWORKS Consultant/Blogger
User avatar
josh
Posts: 295
Joined: Thu Mar 11, 2021 1:05 pm
Answers: 16
x 22
x 508

Re: Viewing swp files without opening them in SolidWorks

Unread post by josh »

So... Just the time savings of double-clicking a file in Explorer vs going to Tools->Macro->Edit and viewing in the VBA editor? I don't think you're going to find anything more efficient than mapping Edit to a SW shortcut key. I've not tried it myself (Maybe @AlexLachance has verified?) but I'd be a bit surprised if even visual studio can open .swp files any easier than SW can.
User avatar
AlexLachance
Posts: 2184
Joined: Thu Mar 11, 2021 8:14 am
Answers: 17
Location: Quebec
x 2364
x 2013

Re: Viewing swp files without opening them in SolidWorks

Unread post by AlexLachance »

josh wrote: Tue Jan 10, 2023 12:25 pm So... Just the time savings of double-clicking a file in Explorer vs going to Tools->Macro->Edit and viewing in the VBA editor? I don't think you're going to find anything more efficient than mapping Edit to a SW shortcut key. I've not tried it myself (Maybe @AlexLachance has verified?) but I'd be a bit surprised if even visual studio can open .swp files any easier than SW can.
I haven't tried it myself but one of my collegues which works both on the ERP and sometimes on macros for us has used it to edit macros in the past. I think he's trying to create/edit macros without having SolidWorks.
User avatar
Frederick_Law
Posts: 1947
Joined: Mon Mar 08, 2021 1:09 pm
Answers: 8
Location: Toronto
x 1638
x 1470

Re: Viewing swp files without opening them in SolidWorks

Unread post by Frederick_Law »

Save them out as text.
gerard
Posts: 60
Joined: Wed Oct 05, 2022 10:24 am
Answers: 0
x 6
x 35

Re: Viewing swp files without opening them in SolidWorks

Unread post by gerard »

Unfortunately I've been less than diligent about cleaning up bits and pieces in my macro folder. You know record some things, use some of the recording, never delete the recorded file.

I wound up opening every swp file, some 40+ of them, and whittled them down to about 10 which are actually useful. :roll:

Then I created a OneNote notebook with a listing of them and description of what they do for the "lucky" stiffs who follow behind me.

Thanks!
Post Reply