Question

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

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top