ObjectClass

ObjectClass

Anonymous
Not applicable
590 Views
3 Replies
Message 1 of 4

ObjectClass

Anonymous
Not applicable
Help. I need ObjectClass in ObjectId but my Visual Studio 2008 does not recognize ObjectClass as one of the properties of ObjectId what is wrong with my code?

Dim bObject As New EditorInput.PromptNestedEntityOptions("")
Dim opt As EditorInput.PromptPointOptions = New EditorInput.PromptPointOptions("Pick point: ")
bObject.NonInteractivePickPoint = myEd.GetPoint(opt).Value
bObject.UseNonInteractivePickPoint = True

Dim bRes As EditorInput.PromptNestedEntityResult = myEd.GetNestedEntity(bObject)
If bRes.Status = EditorInput.PromptStatus.OK Then
Using ta As Transaction = tm.StartTransaction
myEnt = ta.GetObject(bRes.ObjectId, OpenMode.ForRead)
Dim id As DatabaseServices.ObjectId = myEnt.ObjectId
id.ObjectClass <---- does not exists
end using
end if

Edited by: a7v1n on Apr 9, 2010 3:36 AM
0 Likes
591 Views
3 Replies
Replies (3)
Message 2 of 4

_gile
Consultant
Consultant
Hi

The ObjectClass property isn't available prior ObjectARX 2010.

Prior 2010, you can use the Entity.GetType() method

or evaluate the entity type :
{code}if (myEnt is Polyline)
{
// Do something here with the polyline
}{code}

or try an explicit cast to the requiered type (Curve in this example):
{code}Curve curveEnt = ta.GetObject(bRes.ObjectId, OpenMode.ForRead) as Curve
if (curveEnt != null)
{
// Do something here with the curve
}{code}


Gilles Chanteau
Programmation AutoCAD LISP/.NET
GileCAD
GitHub

0 Likes
Message 3 of 4

Anonymous
Not applicable
ObjectClass is available in 2009 or later.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD
Supporting AutoCAD 2000 through 2011

http://www.acadxtabs.com

Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");

<_gile> wrote in message news:6370128@discussion.autodesk.com...
Hi

The ObjectClass property isn't available prior ObjectARX 2010.

Prior 2010, you can use the Entity.GetType() method

or evaluate the entity type :
{code}if (myEnt is Polyline)
{
// Do something here with the polyline
}{code}

or try an explicit cast to the requiered type (Curve in this example):
{code}Curve curveEnt = ta.GetObject(bRes.ObjectId, OpenMode.ForRead) as Curve
if (curveEnt != null)
{
// Do something here with the curve
}{code}
0 Likes
Message 4 of 4

_gile
Consultant
Consultant
> ObjectClass is available in 2009 or later.
Oops!...
I upgraded from 2007 to 2010, so I don't know much about 2008 and 2009.


Gilles Chanteau
Programmation AutoCAD LISP/.NET
GileCAD
GitHub

0 Likes