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

Picking PLines

2 REPLIES 2
Reply
Message 1 of 3
Anonymous
350 Views, 2 Replies

Picking PLines

I have a dwg with both polylines (polyline) and curve fit polylines
(polyline2D) on it. I need to select a polyline and get its endpoints and
midpoint. When I select any polyline, how do I get its values without
knowing whether it is a polyline or polyline2d? I use the following to get
the entity:

myPER =myEd.GetEntity(myPEO)
myEnt=myPER.ObjectId.GetObject(DatabaseServices.OpenMode.ForRead)

myEnt value is {Autodesk.AutoCAD.DatabaseServices.Polyline2D} (or Polyline)
but I can't find a way to test which it is.

After the test, I think I want to use:
myPL=myEnt.ObjectId.GetObject(DatabaseServices.OpenMode.For Read)
or
myPL2D=myEnt.ObjectId.GetObject(DatabaseServices.OpenMode.For Read)
as the next line where:
Dim myPL As DatabaseServices.Polyline
or
Dim myPL2D As DatabaseServices.Polyline2d
The test would determine which is the proper call.

Any thoughts would be appreciated.
2 REPLIES 2
Message 2 of 3
Anonymous
in reply to: Anonymous

I believe the syntax is:

If TypeOf myEnt is Polyline2d Then
....

--
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");

"Ray S Whitmore" wrote in message
news:6400137@discussion.autodesk.com...
I have a dwg with both polylines (polyline) and curve fit polylines
(polyline2D) on it. I need to select a polyline and get its endpoints and
midpoint. When I select any polyline, how do I get its values without
knowing whether it is a polyline or polyline2d? I use the following to get
the entity:

myPER =myEd.GetEntity(myPEO)
myEnt=myPER.ObjectId.GetObject(DatabaseServices.OpenMode.ForRead)

myEnt value is {Autodesk.AutoCAD.DatabaseServices.Polyline2D} (or Polyline)
but I can't find a way to test which it is.

After the test, I think I want to use:
myPL=myEnt.ObjectId.GetObject(DatabaseServices.OpenMode.For Read)
or
myPL2D=myEnt.ObjectId.GetObject(DatabaseServices.OpenMode.For Read)
as the next line where:
Dim myPL As DatabaseServices.Polyline
or
Dim myPL2D As DatabaseServices.Polyline2d
The test would determine which is the proper call.

Any thoughts would be appreciated.
Message 3 of 3
Anonymous
in reply to: Anonymous

That did it beautifully! I never ran across TypeOf before. Easy to look up
once you know it exists.

Thank you, Tony.

"Tony Tanzillo" wrote in message
news:6400128@discussion.autodesk.com...
I believe the syntax is:

If TypeOf myEnt is Polyline2d Then
....

--
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");

"Ray S Whitmore" wrote in message
news:6400137@discussion.autodesk.com...
I have a dwg with both polylines (polyline) and curve fit polylines
(polyline2D) on it. I need to select a polyline and get its endpoints and
midpoint. When I select any polyline, how do I get its values without
knowing whether it is a polyline or polyline2d? I use the following to get
the entity:

myPER =myEd.GetEntity(myPEO)
myEnt=myPER.ObjectId.GetObject(DatabaseServices.OpenMode.ForRead)

myEnt value is {Autodesk.AutoCAD.DatabaseServices.Polyline2D} (or Polyline)
but I can't find a way to test which it is.

After the test, I think I want to use:
myPL=myEnt.ObjectId.GetObject(DatabaseServices.OpenMode.For Read)
or
myPL2D=myEnt.ObjectId.GetObject(DatabaseServices.OpenMode.For Read)
as the next line where:
Dim myPL As DatabaseServices.Polyline
or
Dim myPL2D As DatabaseServices.Polyline2d
The test would determine which is the proper call.

Any thoughts would be appreciated.

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