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.