0

I am developing a plugin for AutoCad.

In a command loop , user will select some text objects by clicking them or By window.

for example : text1 , text2 , text3 , text4 , text5 , text6 , text7

  1. User type command: multiselect
  2. user click on text1
  3. user press on ALT key on the keyboard
  4. user click on text2
  5. user click on text3
  6. user select text4 and text5 by Window
  7. user release ALT key
  8. user select text7
  9. Press ENTER to end multiSelect command

Through this command I want to generate a list like this :

[
  {string : "text1" , groupId : 1},
  {string : "text2" , groupId : 2},
  {string : "text3" , groupId : 2},
  {string : "text4" , groupId : 2},
  {string : "text5" , groupId : 2},
  {string : "text6" , groupId : 3},
  {string : "text7" , groupId : 3},
]

Could someone show me some hints on how to do this ?

CAD bloke
  • 8,578
  • 7
  • 65
  • 114
adam
  • 19
  • 5

1 Answers1

0

So what does the ALT key do if you can select text7 without pressing it?...oh, wait, I see, it determines groupId. I think that UX is confusing, you're better off doing something more clear selecting each group with ENTER between them, tell the user they're selecting the next group and how to move on, and the ENTER after nothing is selected to finish the input sequence. Have a think about what is intuitive for the user.

You could use a selection filter to only get Text with a loop of Application.DocumentManager.MdiActiveDocument.Editor.GetSelection(SelectionFilter) and build your array from the SelectionSets you get from that.

Read the AutoCAD tag wiki for forums you can search for more info.

CAD bloke
  • 8,578
  • 7
  • 65
  • 114