Message 1 of 7

Not applicable
01-09-2015
02:18 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I am trying to access properties such as polyline.closed, from polylines in a selection set.
I use code as follows:
dim pl as acadpolyline
IF selectionset.item(i).objectname = "AcDbPolyline" Then
<<Here I need to cast the object as acadpolyline >>
Endif
I have tried with:
- pl = selectionset.item(i)
- pl = document.handletoobject(selectionset.item(i).handle)
- for each pl in selection if pl.handle = selectionset.item(i).handle then ......
All attempts give error as:
Unable to cast COM object of type AcadentityClass to interface type AcadPolyline
I have refernces AcCoreMgd, AcDbMgd, AcMgd, AutoCAD.Interop & AutoCad.Interop.common
Am I missing any libraries to cast acadentity into acadpolyline? Or what else am I missing?
Thanks for all help in advance
Mdshameer
Solved! Go to Solution.