.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

filtering selection set with handle

9 REPLIES 9
Reply
Message 1 of 10
Anonymous
1203 Views, 9 Replies

filtering selection set with handle

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
9 REPLIES 9
Message 2 of 10
Anonymous
in reply to: Anonymous

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
Message 3 of 10
Anonymous
in reply to: Anonymous

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
Message 4 of 10
Anonymous
in reply to: Anonymous

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
Message 5 of 10
Anonymous
in reply to: Anonymous

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
Message 6 of 10
Anonymous
in reply to: Anonymous

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
Message 7 of 10
Anonymous
in reply to: Anonymous

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
Message 8 of 10
Anonymous
in reply to: Anonymous

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
Message 9 of 10
Anonymous
in reply to: Anonymous

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.
Message 10 of 10
sdphg
in reply to: Anonymous

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.

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

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost