I would need to ask you if you have any experience with
AutoCAD and/or AutoCAD programming.
If not, please tell us, so we know you are not just missing
something very basic and obvious to most, like for example,
knowing the difference between an AcadPolyline and an
AcadLWPolyline.
In addition, because you are using the ActiveX API, you
can get better help on it in the VBA newsgroup, where it
is routinely discussed.
--
http://www.caddzone.com
AcadXTabs: MDI Document Tabs for AutoCAD 2008
Supporting AutoCAD 2000 through 2008
http://www.acadxtabs.com
wrote in message news:5820494@discussion.autodesk.com...
Hello,
When I draw an object in Autocad and try to select with GetEntity I get System.__ComObject. I can do a cast to AcadEntity, but if I try to do a cast to the drawing object (AcadLine, AcadText...) I obtain a null reference.
object returnObjt = new object();
object pt = new object();
try
{
app.ActiveDocument.Utility.GetEntity(out returnObjt, out pt, "Selecciona un trazado:");
}
catch (Exception ex)
{
MessageBox.Show("Nada seleccionado");
return null;
}
AcadEntity o = returnObjt as AcadEntity;
AcadPolyline linea = returnObjt as AcadPolyline;
If I select an object created by code (pline = app.ActiveDocument.ModelSpace.AddPolyline(puntosSector);) it works perfectly