Publicado: Mar 11 Dic, 2007 17:35 Asunto: crear regiones y obtener su ID
--------------------------------------------------------------------------------
Hi, I'm in troubles wtih obtaining region ID.
I'm drawing Regions and I nedd to obtain now the ID for one of them, it's draws rigth, if I "List" in autocad it give me the correct information but later, when I need the Id I've an object data and there isn't Id. You can see the code here:
public override void dibujarArea(CArea area,string capa)
{
//dibujo la poly y guardo el id
int id = new int();
foreach (SPoligono pol in area.ListaPoligonos) {
foreach (CLinea lin in pol.ListaLineas) {
id = dibujarLinea(lin, capa);
}
}
//creo la lista de 1 objeto para pasarla como param a la region AcadEntity[] listaObjetos = new AcadEntity[1];
//guardo el objeto segun la id, esto es la poly que he creado
listaObjetos[0] = (AcadEntity) app.ActiveDocument.ObjectIdToObject(id);
//creo la var para guardar la region resultante
object[] r = new object[1];
//agrego la region
r[0] = app.ActiveDocument.ModelSpace.AddRegion(listaObjetos);
}
then, once the region is created (r[0]) I'd need to know its Id but tha data is not AcadRegion, it's object and there is no ObjectId......
thanks
sorry my english but I'm from Spain and don't speak very much