get and object as implied selection by its handle?

get and object as implied selection by its handle?

mehdi.Autodesk
Contributor Contributor
4,617 Views
5 Replies
Message 1 of 6

get and object as implied selection by its handle?

mehdi.Autodesk
Contributor
Contributor

Hi professionals and thank you for follow this issue.
my question is: how is it possible to get and object as implied selection by its handle?

for example we generated a list of handles which we have in drawing (from database) and now we need to select or filter one cad element by its handle not by get selection from model space. (Vb.net or C# please)

 

Capture.JPG

0 Likes
Accepted solutions (1)
4,618 Views
5 Replies
Replies (5)
Message 2 of 6

Jeff_M
Consultant
Consultant
Does this help?
Database.GetObjectId(false, Hi, 0)
Jeff_M, also a frequent Swamper
EESignature
0 Likes
Message 3 of 6

mehdi.Autodesk
Contributor
Contributor

Dear Jeff,

Thank you for your response.
I tried your suggestion as below

 

Capture 01.JPG

 

but i have this error for Pss type

 

Capture.JPG

0 Likes
Message 4 of 6

Jeff_M
Consultant
Consultant
Accepted solution

The SetImpliedSeelction takes an ObjectIdCollection as it's argument. The following is close to what you will need, but I normally use c# so not sure of the syntax on VB

 

Dim id as ObjectId
id = Db.GetObjectId(False, Hi, 0)

Dim idColl as new ObjectIdCollection
idColl.Add(id)

ed.SetImpliedSelection(idColl)

Dim ss as SelectionSet = ed.SelectImplied().Value

But if what you are after is the selected object, there is no need to use the Set/Select Implied since you already have the ObjectId.

Jeff_M, also a frequent Swamper
EESignature
0 Likes
Message 5 of 6

mehdi.Autodesk
Contributor
Contributor

Thank you Dr. Jeff,

your suggestion was solve the issue as you see below

 

Capture 2.JPG
and also very special thank from kean Walmsley  because of his useful posts :

 

Adding to the AutoCAD pickfirst set with .NET

 

Getting access to an entity from its handle in AutoCAD .NET

 

0 Likes
Message 6 of 6

Jeff_M
Consultant
Consultant
Glad you got it figured out, even though I incorrectly remembered the type of object needed for the SetImpliedSelection...which is an array of ObjectIds.
Jeff_M, also a frequent Swamper
EESignature
0 Likes