Hi.
I have this:
Autodesk.Civil.DatabaseServices.Surface sup = new Autodesk.Civil.DatabaseServices.Surface(); if (checkBox_Revision.Checked == true && radioButton_RevisionPtoSup.Checked==true) { //comprobamos si alguna superficie del dibujo coincide con el origen de datos. Autodesk.Civil.ApplicationServices.CivilDocument civDoc = default(Autodesk.Civil.ApplicationServices.CivilDocument); civDoc = Autodesk.Civil.ApplicationServices.CivilApplication.ActiveDocument; //obtener el documento de Civil ObjectIdCollection SurfaceColl = civDoc.GetSurfaceIds(); //obtener la colección de superficies foreach (ObjectId id in SurfaceColl) // para cada superficie abierta para leer { Autodesk.Civil.DatabaseServices.Surface surface = trans.GetObject(id, OpenMode.ForRead) as Autodesk.Civil.DatabaseServices.Surface; if (surface.Name == comboBox_Origenes.ValueMember) { sup = trans.GetObject(surface.ObjectId, OpenMode.ForRead) as Autodesk.Civil.DatabaseServices.Surface; } } }
I have problems with:
Autodesk.Civil.DatabaseServices.Surface sup = new Autodesk.Civil.DatabaseServices.Surface();
and debugger show a message as "it´s not accessible due its level of protection".
I don´t want:
Autodesk.Civil.DatabaseServices.Surface sup = trans.GetObject(surface.ObjectId, OpenMode.ForRead) as Autodesk.Civil.DatabaseServices.Surface;
because I need "sup" in other function and this function there is a loop and I don´t want read every time the same object.
Do I have to do this?
Autodesk.Civil.DatabaseServices.Surface sup = trans.GetObject(surface.ObjectId, OpenMode.ForRead) as Autodesk.Civil.DatabaseServices.Surface;
for each loop?
I have put this var out of all functions and void, only in the header of class but the problem is the same. I have also tried with "public static" but the message appears again.
Thank you in advance.
Solved! Go to Solution.
Solved by Jeff_M. Go to Solution.
ok.
It was that.
Thank you!