Announcements

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

Community
AutoCAD Forum
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

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

6 REPLIES 6
SOLVED
Reply
Message 1 of 7
jwe03
1719 Views, 6 Replies

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

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.

 

6 REPLIES 6
Message 2 of 7
Alfred.NESWADBA
in reply to: jwe03

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)
Message 3 of 7
jwe03
in reply to: Alfred.NESWADBA

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).

Message 4 of 7
jwe03
in reply to: jwe03

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?

Message 5 of 7
Alfred.NESWADBA
in reply to: jwe03

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)
Message 6 of 7
jwe03
in reply to: Alfred.NESWADBA

I must have misinterpreted the post then.

I will try it and let you know.

 

Thanks.

Message 7 of 7
jwe03
in reply to: Alfred.NESWADBA

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)

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

AutoCAD Inside the Factory


Autodesk Design & Make Report