Announcements

Starting in December, we will archive content from the community that is 10 years and older. This FAQ provides more information.

Select entity using vb.net code same as selecting using mouse

jwe03
Advocate
Advocate

Select entity using vb.net code same as selecting using mouse

jwe03
Advocate
Advocate

Is there a way to select an entity and displaying the selection on the view? 

 

The end result should be the same as selecting an entity using the mouse (as shown below)

selection in autocad.PNG

 

tried using a selection set and then highlight, but turned out that highlight is not a selection, it just highlights it in the view.

 

Thank you.

 

0 Likes
Reply
Accepted solutions (1)
1,718 Views
6 Replies
Replies (6)

Alfred.NESWADBA
Consultant
Consultant
Accepted solution

Hi,

 

is >>>acDocEd.SetImpliedSelection<<< what you are looking for?

 

- alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
ISH-Solutions GmbH / Ingenieur Studio HOLLAUS
www.ish-solutions.at ... blog.ish-solutions.at ... LinkedIn ... CDay 2024
------------------------------------------------------------------------------------

(not an Autodesk consultant)

jwe03
Advocate
Advocate

Hello Alfred,

 

No this is not what i want. 

 

Let's say i have defined my filters and selected some entities using the editor.select(filter) function.

Then i get this selection set, and show it to the user on the screen.

 

Not only that, the user should be able to delete, copy, cut, change the layer, of those selected entities... (same as you would select those entities by using the AutoCAD interface).

0 Likes

jwe03
Advocate
Advocate

In other words, 

Suppose i have a selection set in my code, how can i select those objects in this selection set in the AutoCAD view?

0 Likes

Alfred.NESWADBA
Consultant
Consultant

Hi,

 

have you tried it?

If you create a selectionset by filter and forward it to the ImpliedSelection then these objects get gripped, the property window shows the properties and you can change the properties you were looking for ...

 

- alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
ISH-Solutions GmbH / Ingenieur Studio HOLLAUS
www.ish-solutions.at ... blog.ish-solutions.at ... LinkedIn ... CDay 2024
------------------------------------------------------------------------------------

(not an Autodesk consultant)
0 Likes

jwe03
Advocate
Advocate

I must have misinterpreted the post then.

I will try it and let you know.

 

Thanks.

0 Likes

jwe03
Advocate
Advocate

Finally, thanks a million Alfred. 

I also tried passing an array of object IDs 😄 

 

Dim ed As Editor = doc.Editor

Dim objectIDs(1) As ObjectId
objectIDs(0) = curve1.ObjectId
objectIDs(1) = curve2.ObjectId

ed.SetImpliedSelection(objectIDs)