Debugging & reloading Addins

I'm trying to write some addins in C# for SW 2009 but I'm having some difficultly. (besides the absolute lack of information/documentation)

What I need to be able to do is debug the addin and/or be able to reload it without restarting solidworks every time.

Anyone have any experience with this?

Thanks, Jon

Reply to
Jon Slaughter
Loading thread data ...

By the way, I'm using VS.NET 2k8

Reply to
Jon Slaughter

As long as the addin is loaded into SW, I don't think you'll be able to change the DLL. If you turn the addin off (under Tools -->

Addins), you migh be able to swap DLLs.

Reply to
That70sTick

Usually I start with writing an EXE. When I get the code running the way I want, I migrate the modules to an addin DLL.

My addin class modules typically don't have code that does the actual "work". I structure addin projectss such that the addin class module is simply a portal to the other forms and modules. The addin class module just does the SolidWorks housekeping such as connecting, getting cookies, and settin up menus and toolbars.

Reply to
That70sTick

I've got the exe to work but I'm having problems passing arrays. DispatchWrapper wraps them but for some reason the data doesn't get solid works(ends up with 0's).

I can, for example, do a table pattern using a file but not passing points directly. If I just pass the double array it gets just the y values(strangely) and the x values are 0. If I wrap them then it just gets

0's ;/

Have you had any problems with passing arrays?

Reply to
Jon Slaughter

Some, usually with variants returned from functions.

I work in VB, and I'm not .NET yet. Don't know how much I can help.

Reply to
That70sTick

Strangly enough it works now ;/ I just pass the array directly just as I did the first time ;/

Feature p = FeatureManager.InsertTableDrivenPattern("", points, true, false);

where points is simply a double array.

I had solidworks crash at one point and maybe that somehow corrupted something. In any case it seems to work. I did get the holes at least.

Thanks,

Jon

Reply to
Jon Slaughter

Hi jon. You can debug an add-in by simply putting a break line. When VS.Net 2008 breaks, make the changes you want and then press the play button again. Works on my machine.

Reply to
koorzena

PolyTech Forum website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.