filtering selection set with handle

filtering selection set with handle

Anonymous
Not applicable
581 Views
6 Replies
Message 1 of 7

filtering selection set with handle

Anonymous
Not applicable
Hi:
I am trying to filter a selctionset objects by the searched objects handle
but the result is always zero although i am sure they are in the drawing
i think i am missing the right dxf code for the object
handle(entity.Handle).I am trying "5" and "DXFCode.Handle" but they don't
work.

Thanks in advance.

--
Nermeen Bakr
Project Manager
MCS (Modern Computing Services)
Website: http://www.mcsoil.com
Phone: +2 02 4036520 /+202 4051129
Fax: +2 02 4040503
0 Likes
582 Views
6 Replies
Replies (6)
Message 2 of 7

Anonymous
Not applicable
Could you post the setup of your 'code' and 'value' arrays?

"Nermeen Bakr" wrote in message
news:4872799@discussion.autodesk.com...
Hi:
I am trying to filter a selctionset objects by the searched objects handle
but the result is always zero although i am sure they are in the drawing
i think i am missing the right dxf code for the object
handle(entity.Handle).I am trying "5" and "DXFCode.Handle" but they don't
work.

Thanks in advance.

--
Nermeen Bakr
Project Manager
MCS (Modern Computing Services)
Website: http://www.mcsoil.com
Phone: +2 02 4036520 /+202 4051129
Fax: +2 02 4040503
0 Likes
Message 3 of 7

Anonymous
Not applicable
Why do you need a filter?. each object's handle is
unique so there is only one.

"Nermeen Bakr" wrote in message
news:4872799@discussion.autodesk.com...
Hi:
I am trying to filter a selctionset objects by the searched objects handle
but the result is always zero although i am sure they are in the drawing
i think i am missing the right dxf code for the object
handle(entity.Handle).I am trying "5" and "DXFCode.Handle" but they don't
work.

Thanks in advance.

--
Nermeen Bakr
Project Manager
MCS (Modern Computing Services)
Website: http://www.mcsoil.com
Phone: +2 02 4036520 /+202 4051129
Fax: +2 02 4040503
0 Likes
Message 4 of 7

Anonymous
Not applicable
check out "HandleToObject"
"Paul Richardson" wrote in message
news:4872931@discussion.autodesk.com...
Why do you need a filter?. each object's handle is
unique so there is only one.

"Nermeen Bakr" wrote in message
news:4872799@discussion.autodesk.com...
Hi:
I am trying to filter a selctionset objects by the searched objects handle
but the result is always zero although i am sure they are in the drawing
i think i am missing the right dxf code for the object
handle(entity.Handle).I am trying "5" and "DXFCode.Handle" but they don't
work.

Thanks in advance.

--
Nermeen Bakr
Project Manager
MCS (Modern Computing Services)
Website: http://www.mcsoil.com
Phone: +2 02 4036520 /+202 4051129
Fax: +2 02 4040503
0 Likes
Message 5 of 7

Anonymous
Not applicable
My main problem is that i want to pass a selection set to the properties
window as to change the properties of some
acad entites i am identify them with their handles.I couldn't find a way to
do that except to make a selection set and then pass the ("_P")
perivous selection to the properties window.but for this to be done the
selection set must select something from the drawing.adding the acadentites
directly to the seletctionset by using the handleToobject method doesn't
work bcs the autocad didn't feel the selection.
--
Nermeen Bakr
Project Manager
MCS (Modern Computing Services)
Website: http://www.mcsoil.com
Phone: +2 02 4036520 /+202 4051129
Fax: +2 02 4040503
"Nermeen Bakr" wrote in message
news:4872799@discussion.autodesk.com...
Hi:
I am trying to filter a selctionset objects by the searched objects handle
but the result is always zero although i am sure they are in the drawing
i think i am missing the right dxf code for the object
handle(entity.Handle).I am trying "5" and "DXFCode.Handle" but they don't
work.

Thanks in advance.

--
Nermeen Bakr
Project Manager
MCS (Modern Computing Services)
Website: http://www.mcsoil.com
Phone: +2 02 4036520 /+202 4051129
Fax: +2 02 4040503
0 Likes
Message 6 of 7

Anonymous
Not applicable
something like this should work...

'
Sub handleToSS()
Dim objHandles(1) As String
Dim ss As AcadSelectionSet
Dim ent() As AcadEntity
Dim obj As AcadObject
Dim i As Integer

objHandles(0) = "2B"
objHandles(1) = "2C"

Set ss = ThisDrawing.SelectionSets.Add("ssname")

For i = 0 To UBound(objHandles)
ReDim Preserve ent(i)
Set ent(i) = ThisDrawing.HandleToObject(objHandles(i))
Next i

ss.AddItems ent

ThisDrawing.SelectionSets("ssname").Delete

End Sub
'



"Nermeen Bakr" wrote in message
news:4873942@discussion.autodesk.com...
My main problem is that i want to pass a selection set to the properties
window as to change the properties of some
acad entites i am identify them with their handles.I couldn't find a way to
do that except to make a selection set and then pass the ("_P")
perivous selection to the properties window.but for this to be done the
selection set must select something from the drawing.adding the acadentites
directly to the seletctionset by using the handleToobject method doesn't
work bcs the autocad didn't feel the selection.
--
Nermeen Bakr
Project Manager
MCS (Modern Computing Services)
Website: http://www.mcsoil.com
Phone: +2 02 4036520 /+202 4051129
Fax: +2 02 4040503
"Nermeen Bakr" wrote in message
news:4872799@discussion.autodesk.com...
Hi:
I am trying to filter a selctionset objects by the searched objects handle
but the result is always zero although i am sure they are in the drawing
i think i am missing the right dxf code for the object
handle(entity.Handle).I am trying "5" and "DXFCode.Handle" but they don't
work.

Thanks in advance.

--
Nermeen Bakr
Project Manager
MCS (Modern Computing Services)
Website: http://www.mcsoil.com
Phone: +2 02 4036520 /+202 4051129
Fax: +2 02 4040503
0 Likes
Message 7 of 7

Anonymous
Not applicable
The only proble with this is that the HandleToObject method is extremly slow. Try it with 200 handles...

To my experience, you are better off selecting all objects (or looping trought ModelSpace) and trying to match each object's handle to your handle list. (try using a dictionnary and the Exists method, witch is very fast....)
0 Likes