5 Replies Latest reply on Mar 29, 2015 4:06 PM by Deepak Gupta

    Entities selection by Mouse like AutoCad

    Marcello Saracino

      Hello!!.

      I 'm at the beginning of the programming API , and I come from programming in LISP AutoCAD \ VB . NET ;

      I would like to create a macro in .NET Solidworks .

      I would like to select the user's choice some entities in a sketch by selecting them through the click of the mouse .

      At the end I would like to change the color of these selected entities .

      As the user selects the entities should be observed as normally happens .

      For what I understand , I have to capture the coordinates x , y , z of the various mouse clicks and then apply the method SelectById2 passing the various coordinates captured previously .... and ' correct this reasoning ? How can I do to highlight entities as that I select ?

      Some expert can show me a few lines of code to give me a start ?

       

      Another thing that I did not understand is , that while in Autocad to select entities launches GetEntities method , the selection changes to the user that selection what he wants in the methods they prefer . As you select Autocad behaves as if there were no mecro in operation , and the entities are highlighted normally .... and at the end the selection set is returned to the program .

      This  approach can also do the Solidworks or not?

       

      Thanks and regards-

      Marcello