0

We have the concept of Grouping among blocks. So, on selection of one block, I need to show the other blocks as selected in AutoCAD -2013. I have the AutoCAD Handle of the all the blocks available.

The blocks should show the highlight, and must also be part of the SelectionSet in case they run a command with the selection intact/modified.

How do I do this in code - C#? Thanks

nonexistent myth
  • 135
  • 1
  • 14
  • 1
    What did you try, and what problems are you experiencing? can we see some code? – Timothy Groote Aug 01 '13 at 08:54
  • 1
    What your asking for doesn't make any since from a programming stand point. You need to do some research and then if you have questions comeback and ask. There should be no reason you need to highlight "select" the blocks and if you would need to, you would need to get them in a selectionset prior to "highlighting" them. You must me a drafter... – Trae Moore Aug 02 '13 at 03:40

1 Answers1

2

Thanks Trae, Setting the selectionSet did it.

I was looking for this.

List<ObjectId> pid = new List<ObjectId>();
//Add ObjectIds to the pid
SelectionSet ss1 = SelectionSet.FromObjectIds(pid.ToArray());
ed.SetImpliedSelection(ss1)

This will select the respective blocks in AutoCAD.

From the comments, I gather the question was not that clear.
I add blocks to the drawing and this information and handle also go into my database.
I group blocks based on user input which also goes into my DB.

The option I had to provide to the user was if he were to run a command and select a single block belonging to a group, all the other blocks of the group were to be selected. And hence, my question.

nonexistent myth
  • 135
  • 1
  • 14
  • Glad you got it sorted out. When dealing with objects from the database the handle is not very important. You will use the ObjectIds. Take a look at my github, the link is in my profile and you can see the database work. Also look into transactions. Also autocad has an ObjectIdCollection class. – Trae Moore Aug 02 '13 at 13:03