Page 1 of 1

Viewing swp files without opening them in SolidWorks

Posted: Tue Jan 10, 2023 8:35 am
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!

Re: Viewing swp files without opening them in SolidWorks

Posted: Tue Jan 10, 2023 9:04 am
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 2201 times

Re: Viewing swp files without opening them in SolidWorks

Posted: Tue Jan 10, 2023 10:14 am
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.

Re: Viewing swp files without opening them in SolidWorks

Posted: Tue Jan 10, 2023 11:47 am
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.

Re: Viewing swp files without opening them in SolidWorks

Posted: Tue Jan 10, 2023 12:10 pm
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.

Re: Viewing swp files without opening them in SolidWorks

Posted: Tue Jan 10, 2023 12:25 pm
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.

Re: Viewing swp files without opening them in SolidWorks

Posted: Tue Jan 10, 2023 1:23 pm
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.

Re: Viewing swp files without opening them in SolidWorks

Posted: Mon Jan 16, 2023 11:39 am
by Frederick_Law
Save them out as text.

Re: Viewing swp files without opening them in SolidWorks

Posted: Mon Jan 30, 2023 11:20 am
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!