Message 1 of 3

Not applicable
07-02-2019
07:37 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello ,
I am new to programming using c# in autocad
I have selected some objects in autocad drawing using ( c# code ) as the part of code followed :
'''''''''''''''''''
foreach (SelectedObject sobj in ss)
{
Entity ent = trans.GetObject(sobj.ObjectId, OpenMode.ForWrite) as Entity;
if (ent != null)
{
//edt.WriteMessage("\n Type of object is : " + ent.GetType().FullName);
if (ent.GetType().Name == "PolyLine")
{
Polyline pl = new Polyline();
pl = ent;
}
}
}
'''''''''''''''
so when i write ( pl = ent;) it gives me an error that it can't be assigned and have to converted i first.
so how can i do the conversion ?
Thanks ,,
Solved! Go to Solution.