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

ObjectClass

3 REPLIES 3
Reply
Message 1 of 4
a7v1n
497 Views, 3 Replies

ObjectClass

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
3 REPLIES 3
Message 2 of 4
_gile
in reply to: a7v1n

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

Message 3 of 4
Anonymous
in reply to: a7v1n

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}
Message 4 of 4
_gile
in reply to: a7v1n

> 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

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