.NET

Reply
*Nermeen Bakr
Message 1 of 10 (394 Views)

filtering selection set with handle

394 Views, 9 Replies
06-13-2005 02:06 AM
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
*Laurence Skoropinski
Message 2 of 10 (394 Views)

Re: filtering selection set with handle

06-13-2005 04:51 AM in reply to: *Nermeen Bakr
Might be wrong here but the lisp ssget help states

"The ssget function recognizes all group codes except entity names
(group -1), handles (group 5), and xdata codes (groups greater than 1000).
If an invalid group code is used in a filter-list, it is ignored by ssget. "

I assume that this will also be the case for any selection set function in
.NET

Laurence

"Nermeen Bakr" wrote in message
news:4872798@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
*Albert Szilvasy
Message 3 of 10 (394 Views)

Re: filtering selection set with handle

06-13-2005 09:27 AM in reply to: *Nermeen Bakr
Correct. This restriction applies to all APIs (lisp, C++, .net).
Albert

"Laurence Skoropinski" wrote in message
news:4872848@discussion.autodesk.com...
Might be wrong here but the lisp ssget help states

"The ssget function recognizes all group codes except entity names
(group -1), handles (group 5), and xdata codes (groups greater than 1000).
If an invalid group code is used in a filter-list, it is ignored by ssget. "

I assume that this will also be the case for any selection set function in
.NET

Laurence

"Nermeen Bakr" wrote in message
news:4872798@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
*Nermeen Bakr
Message 4 of 10 (394 Views)

Re: filtering selection set with handle

06-14-2005 02:40 AM in reply to: *Nermeen Bakr
Thanks for Information.But isn't there a way around to filter a selection
set knowing the handle of the items to be filtered.

Thanks again

--
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:4872798@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
*Tony Tanzillo
Message 5 of 10 (394 Views)

Re: filtering selection set with handle

06-14-2005 05:30 AM in reply to: *Nermeen Bakr
You don't filter for handles. Handles are, in the first
place, a way of 'identifying' an object, which means
that if you have the handle, you have the object that
it identifies, so there is no need to filter for them.

I'm not sure what the .NET equivalent is, but in LISP
the (handent) function takes a handle and returns an
entity name.

In ObjectARX, it is AcDbDatabase::getObjectId(), but
I'm not sure if that has a direct counterpart in .NET.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006
http://www.acadxtabs.com

"Nermeen Bakr" wrote in message news:4873947@discussion.autodesk.com...
Thanks for Information.But isn't there a way around to filter a selection
set knowing the handle of the items to be filtered.

Thanks again

--
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:4872798@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
*Albert Szilvasy
Message 6 of 10 (394 Views)

Re: filtering selection set with handle

06-14-2005 10:25 AM in reply to: *Nermeen Bakr
Database.GetObjectId is the .NET function to translate a Handle to an
ObjectId.
Albert

"Tony Tanzillo" wrote in message
news:4874028@discussion.autodesk.com...
You don't filter for handles. Handles are, in the first
place, a way of 'identifying' an object, which means
that if you have the handle, you have the object that
it identifies, so there is no need to filter for them.

I'm not sure what the .NET equivalent is, but in LISP
the (handent) function takes a handle and returns an
entity name.

In ObjectARX, it is AcDbDatabase::getObjectId(), but
I'm not sure if that has a direct counterpart in .NET.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006
http://www.acadxtabs.com

"Nermeen Bakr" wrote in message
news:4873947@discussion.autodesk.com...
Thanks for Information.But isn't there a way around to filter a selection
set knowing the handle of the items to be filtered.

Thanks again

--
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:4872798@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
*Tony Tanzillo
Message 7 of 10 (394 Views)

Re: filtering selection set with handle

06-14-2005 03:15 PM in reply to: *Nermeen Bakr
Can you tell us what the third paramter is?

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006
http://www.acadxtabs.com

"Albert Szilvasy" wrote in message news:4874517@discussion.autodesk.com...
Database.GetObjectId is the .NET function to translate a Handle to an
ObjectId.
Albert

"Tony Tanzillo" wrote in message
news:4874028@discussion.autodesk.com...
You don't filter for handles. Handles are, in the first
place, a way of 'identifying' an object, which means
that if you have the handle, you have the object that
it identifies, so there is no need to filter for them.

I'm not sure what the .NET equivalent is, but in LISP
the (handent) function takes a handle and returns an
entity name.

In ObjectARX, it is AcDbDatabase::getObjectId(), but
I'm not sure if that has a direct counterpart in .NET.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006
http://www.acadxtabs.com

"Nermeen Bakr" wrote in message
news:4873947@discussion.autodesk.com...
Thanks for Information.But isn't there a way around to filter a selection
set knowing the handle of the items to be filtered.

Thanks again

--
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:4872798@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
*Tony Tanzillo
Message 8 of 10 (394 Views)

Re: filtering selection set with handle

06-14-2005 05:14 PM in reply to: *Nermeen Bakr
Nevermind - It's in the ObjectARX docs.

For those interested, this is how you can get an
ObjectId given a string representation of a handle:

public static ObjectId ObjectIdFromHandle(Database db, string strHandle)
{
Int32 nHandle = Int32.Parse(strHandle, NumberStyles.AllowHexSpecifier);
Handle handle = new Handle(nHandle);
return db.GetObjectId(false, handle, 0);
}

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006
http://www.acadxtabs.com

"Tony Tanzillo" wrote in message news:4874926@discussion.autodesk.com...
Can you tell us what the third paramter is?

"Albert Szilvasy" wrote in message news:4874517@discussion.autodesk.com...
Database.GetObjectId is the .NET function to translate a Handle to an
ObjectId.
Albert
Valued Contributor
Kelly-NDLEA
Posts: 92
Registered: ‎11-09-2005
Message 9 of 10 (394 Views)

Re: filtering selection set with handle

10-17-2006 03:10 PM in reply to: *Nermeen Bakr
Can anyone break this down into a step by step procedure as to how a "non-programmer" type would go about selecting an object, knowing its handle.

I am using Civil 3D 2007 SP2. I am getting errors when I save to the effect of:
*Warning* Multiply owned object, handle "A1B2"

So I want to be able to list the offending objects and decide if they need to be deleted.
Active Contributor
sdphg
Posts: 28
Registered: ‎05-21-2008
Message 10 of 10 (394 Views)

Re: filtering selection set with handle

07-12-2008 01:08 AM in reply to: *Nermeen Bakr
really?In .NET,Yes the handle(group 5)can't used to filter, but the xdata code 1001 do. I hava the test code below, and I can got the entity filtered by code 1001, here is the code:

C# code:
TypedValue[] tv = { new TypedValue(1001, "Instrument") };
SelectionFilter sf = new SelectionFilter(tv);
PromptSelectionResult pr = ed.SelectAll(sf);
the text in dxf file:
1001
Instrument
1000
This is a test string

is anything different?or acturally the group 1001 can be used to fileter in .NET.
I used ObjectARX2008.
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.