I originally started my addin when we were on SW07. Several months ago we upgraded to SW09. When I debug my addin I would like it to open SW09 but it opens SW07. How can I change this?SolidworksApi macros
Answers9
SF
SF2010-03-12Best Answer
Go to the Project Properties, then Debug tab, and then change the Start External Program file to the new SW location.
SF
SF2010-03-12
"Start External Program" is not an option...
on the debug tab is:
a text area for "Command Line Arguments" and a text box for "Working Directory"
do know if it matters or not but Im using VB 2008 Express
SF
SF2010-03-16
still cant get this to work...
JC
JC2010-03-16
What you can try
register dll file x64 C:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727\regasm "Path of the debug dll file" /codebase x32 C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\regasm "Path of the debug dll file" /codebase
start Solidworks
in VB click tools/attach to process
find SLDWORKS.exe select it and click attach
SF
SF2010-03-16
With you saying it starts when you debug I presumed you meant it actually runs and attaches to SW automatically after a build, no?
Anyway, in express check the Post Build Events, that may be manually running the SolidWorks exe for you, and you can change that, but that wouldn't attach to the process so it wouldn't actually debug and you would have to do a Debug->Attach to Process.. as shown.
SF
SF2010-03-17
when I "Start debugging" in VB express it starts my SW07 and I am able to step thru the code.
I do not have the Attach to Process in my VB Express...
DG
DG2010-03-17
I have same issue. My macro are made in VB and some of them will open SW2007 when run thru SW2009.
SF
SF2010-03-17
Open up your .vbproj and .sln files in notepad and search for SLDWORKS.exe. It was probably set in there by another version, but either way you will have a path in one of them launching the file, just change the path and save. Backup the 2 files before doing it.
"Start External Program" is not an option...
on the debug tab is:
a text area for "Command Line Arguments" and a text box for "Working Directory"
do know if it matters or not but Im using VB 2008 Express
What you can try
register dll file
x64 C:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727\regasm "Path of the debug dll file" /codebase
x32 C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\regasm "Path of the debug dll file" /codebase
start Solidworks
in VB click tools/attach to process
find SLDWORKS.exe select it and click attach
With you saying it starts when you debug I presumed you meant it actually runs and attaches to SW automatically after a build, no?
Anyway, in express check the Post Build Events, that may be manually running the SolidWorks exe for you, and you can change that, but that wouldn't attach to the process so it wouldn't actually debug and you would have to do a Debug->Attach to Process.. as shown.
when I "Start debugging" in VB express it starts my SW07 and I am able to step thru the code.
I do not have the Attach to Process in my VB Express...
that did it... thanx