2 Replies Latest reply on Aug 17, 2016 2:46 AM by Edwin Thompson

    How to draw lines with API measure command?

    Edwin Thompson

      When making measurements it is very helpful to draw a line between the two selected points or between the measured results.  These lines are important to provide verification that the measured results are correct.


      The API measure command is a good command but it is surprising that the command doesn't also provide the lines as shown below:

      I have looked but have not been able to find an option for this.


      The nest best approach is to use the selection points draw our own lines.  Is there a command set to do this?


      The measure command returns an X, Y, Z values and DeltaX, DeltaY,  DeltaZ (the measured results).  I have made a number of attempts to use these values to draw these "reference" lines within both assembly and part model spaces without success.  Is there a way to "translate" these values into something useful?

        • Re: How to draw lines with API measure command?
          Keith Rice

          SolidWorks API calls are not designed to mimic the GUI, only to perform the "end" task. In the case of the measure tool, the end task is simply to obtain a measurement.


          If you want to create any custom graphics on the screen then you will need to insert those graphics "directly" using OpenGL (not a trivial task, unfortunately). There are no API calls that will assist you here.



          SolidWorks API Tutorials

            • Re: How to draw lines with API measure command?
              Edwin Thompson

              In case Solidworks is listening, Given measurements, which are so common, and to not have provided appropriate feedback (such as the measurement lines) is a strong indication that Solidworks programmers have very little experience with using Solidworks.  The challenge for the API programming department is to get a little experience with actually using Solidworks.  It won't be long before they will realize that without appropriate feedback, measurements aren't work the trouble to click the mouse if there isn't some confidence that the proper points have been selected.


              Keith,  thank you for your feedback.