Hi.
I want to get the surface boundary in pol3d.
In Civil 3D there is "SurfaceExtractObjects" command but I want to do it automatically, like this:
-Choosing a surface in drawing (or combobox).
-Checking if the surface style has the boundary component activated.
-Calling the command "SurfaceExtractObjects" with only a tick in the checkbox "boundary". Disable the rest of the possible checkbox´s
-Getting the pol3d.
-Coming back the surface style like the beginning: If boundary component was disabled in the beginning, then putting that component disabled again.
But I don´t know if I can do it without showing the dialog box (SurfaceExtractObjects):
I was looking for in Surface class but there is nothing similar.
Solved! Go to Solution.
Solved by Jeff_M. Go to Solution.
Solved by Jeff_M. Go to Solution.
If I have understood, this method is only for TinSurfaces , not for VolumenSurfaces neither does DEM surfaces) in API.
But, the user can do it with "extract objects" surface (for borders) within interface.
I am trying to select new 3d polylines but my command doesn´t works fine about that:
int pos= comboBox_SuperficiesTotales.SelectedIndex; using (Transaction trans = db.TransactionManager.StartTransaction()) { TinSurface tinsurf = trans.GetObject(listaSups[pos].Id, OpenMode.ForRead) as TinSurface; //Type: Autodesk.Civil.SurfaceExtractionSettingsType //Specify SurfaceExtractionSettingsType.Plan to extract the border information using the plan visual style settings, or SurfaceExtractionSettingsType.Model to use the model settings. ObjectIdCollection borders = tinsurf.ExtractBorder(SurfaceExtractionSettingsType.Plan); //en el estilo de superficie asignado en Planta. color y capa para el Borde en Planta. Autodesk.AutoCAD.DatabaseServices.ObjectId[] matriz= new ObjectId[borders.Count]; borders.CopyTo(matriz, 0); Autodesk.AutoCAD.Internal.Utils.SelectObjects(matriz); Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor.UpdateScreen(); trans.Commit(); this.Close(); }
In another button, to select alignments, this code works fine:
Autodesk.AutoCAD.Internal.Utils.SelectObjects(matriz); Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor.UpdateScreen();
But I don´t understand why it doesn´t work here.
Yes, it´s just to get select them.
I have changed GRIPOBJLIMIT (default value in 100) to 5000, but the result is the same.
I have tried with shorter area surface also.
I don´t know what happen... I will continue finding out.
Ok, I know what happens.
I´m using a dialog form.
Form_ExtractBorders formulario = new Form_ExtractBorders(); formulario.ShowDialog();
First, I select objects and then I close the form (this.close). ---> doesn´t work.
If I hide the form (this.hide() ) before select objects---> doesn´t work.
Without using a form, direct wit prompt--- it works (all objects are selected).
I don´t know how resolve using a showDialog..