2 Replies Latest reply on Jan 29, 2018 4:19 PM by Jacob Corder

    How Was This Add-in Made?

    Brian Smith

      I have been writing macros for a while now and I have brain storming an add-in for quite some time but I am unable to get over one major issue... I don't even know where to begin creating what I will call "new visual objects" in SolidWorks, if it is even possible.


      I look at this add-in found on SolidWorks' website and I am baffled at how they did it.


      Arrow added by me. So I get that L21-1, L31-1, L12-1, Raytrace_1, and Raytrace_2 are likely all macro features. The white lines can very well be a complicated 3D sketch, but my assumption is that they are not and they are some kind of new object created by the developer. So assuming that is true, how did they do it? http://files.solidworks.com/partners/pdfs/apex_2014v1_productflyer.pdf


      The first thing I would like to do is create a select-able dot that's color can be controlled that does not look like a sketch point (which looks like a eight sided star).


      Is this even possible? Any reference documentation or general direction would be appreciated.

        • Re: How Was This Add-in Made?
          Simon Turner

          It's called OpenGL.

          Using the BufferSwapNotifyEventHandler you can draw your own objects to screen.

          I personally use the OpenTK library which is a dotnet wrapper for the opengl32.dll

          You've got a lot of reading up to do though - it's a big topic!

          • Re: How Was This Add-in Made?
            Jacob Corder

            you can achieve this also using Temporary bodies. basically a body created with IModeler.


            ray tracing body creation is not terribly complex to do.  they are just cylinders that originate at a start point, have a direction and a length.


            adding them as a feature would definately require IMacroFeatures.


            i have done this to determine deflection on a surface.


            while opengl is much faster, it is not so easily selectable, if that matters to you.


            perhaps use a ITriadManipulator to be the selectable item because events are fired when anything on the triad changes, moves, ect


            on triad move you can generate the graphics with temporary bodies. i say temporary bodies because they are much simpler to use and can be created using parallelism. meaning you will need to write this in .net


            they are also easy to color, however gradient colors not so much