Hi.
I have this:
Autodesk.AutoCAD.Internal.Utils.SetFocusToDwgView(); Document doc = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument; Database db = doc.Database; Editor ed = doc.Editor; Autodesk.Civil.ApplicationServices.CivilDocument civilDoc = default(Autodesk.Civil.ApplicationServices.CivilDocument); civilDoc = Autodesk.Civil.ApplicationServices.CivilApplication.ActiveDocument; //obtener el documento de Civil PromptEntityOptions entOpts = new PromptEntityOptions(" Selecciona una superfície del dibujo <vuelve a la paleta>: "); var _with1 = entOpts; _with1.SetRejectMessage("no es una objeto superfície."); _with1.AddAllowedClass(typeof(Autodesk.Civil.DatabaseServices.TinSurface), true); _with1.AllowNone = true; _with1.AllowObjectOnLockedLayer = true; PromptEntityResult entRes = ed.GetEntity(entOpts); if (entRes.Status != PromptStatus.OK) return; using (DocumentLock docLock = doc.LockDocument()) //bloqueo { using (Transaction trans = HostApplicationServices.WorkingDatabase.TransactionManager.StartTransaction()) { Autodesk.Civil.DatabaseServices.Surface sup = default(Autodesk.Civil.DatabaseServices.Surface); sup = trans.GetObject(entRes.ObjectId, OpenMode.ForRead) as Autodesk.Civil.DatabaseServices.Surface; Autodesk.AutoCAD.Geometry.Point3dCollection pt3dcoll = new Point3dCollection(); //....................
I get a surfaceID from selected TIN surface in drawing, although I want to can also select a GRID surface.
How can I modify this code line to allow both classes? (TinSurface and GridSurface)
_with1.AddAllowedClass(typeof(Autodesk.Civil.DatabaseServices.TinSurface), true);
Thank you.
Solved! Go to Solution.
Hi.
I have this:
Autodesk.AutoCAD.Internal.Utils.SetFocusToDwgView(); Document doc = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument; Database db = doc.Database; Editor ed = doc.Editor; Autodesk.Civil.ApplicationServices.CivilDocument civilDoc = default(Autodesk.Civil.ApplicationServices.CivilDocument); civilDoc = Autodesk.Civil.ApplicationServices.CivilApplication.ActiveDocument; //obtener el documento de Civil PromptEntityOptions entOpts = new PromptEntityOptions(" Selecciona una superfície del dibujo <vuelve a la paleta>: "); var _with1 = entOpts; _with1.SetRejectMessage("no es una objeto superfície."); _with1.AddAllowedClass(typeof(Autodesk.Civil.DatabaseServices.TinSurface), true); _with1.AllowNone = true; _with1.AllowObjectOnLockedLayer = true; PromptEntityResult entRes = ed.GetEntity(entOpts); if (entRes.Status != PromptStatus.OK) return; using (DocumentLock docLock = doc.LockDocument()) //bloqueo { using (Transaction trans = HostApplicationServices.WorkingDatabase.TransactionManager.StartTransaction()) { Autodesk.Civil.DatabaseServices.Surface sup = default(Autodesk.Civil.DatabaseServices.Surface); sup = trans.GetObject(entRes.ObjectId, OpenMode.ForRead) as Autodesk.Civil.DatabaseServices.Surface; Autodesk.AutoCAD.Geometry.Point3dCollection pt3dcoll = new Point3dCollection(); //....................
I get a surfaceID from selected TIN surface in drawing, although I want to can also select a GRID surface.
How can I modify this code line to allow both classes? (TinSurface and GridSurface)
_with1.AddAllowedClass(typeof(Autodesk.Civil.DatabaseServices.TinSurface), true);
Thank you.
Solved! Go to Solution.
Solved by Jeff_M. Go to Solution.
Can't find what you're looking for? Ask the community or share your knowledge.