Debugging & reloading Addins

Discussion in 'SolidWorks' started by Jon Slaughter, Dec 6, 2008.

  1. 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
     
    Jon Slaughter, Dec 6, 2008
    #1
  2. By the way, I'm using VS.NET 2k8
     
    Jon Slaughter, Dec 6, 2008
    #2
  3. Jon Slaughter

    That70sTick Guest

    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.
     
    That70sTick, Dec 6, 2008
    #3
  4. Jon Slaughter

    That70sTick Guest

    What I need to be able to do is debug the addin and/or be able to reload it
    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.
     
    That70sTick, Dec 6, 2008
    #4
  5. 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?
     
    Jon Slaughter, Dec 9, 2008
    #5
  6. Jon Slaughter

    That70sTick Guest

    Have you had any problems with passing arrays?

    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.
     
    That70sTick, Dec 9, 2008
    #6
  7. 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
     
    Jon Slaughter, Dec 9, 2008
    #7
  8. Jon Slaughter

    koorzena Guest

    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.
     
    koorzena, Dec 10, 2008
    #8
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.