Community
Civil 3D Customization
Welcome to Autodesk’s AutoCAD Civil 3D Forums. Share your knowledge, ask questions, and explore popular AutoCAD Civil 3D Customization topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

SurfaceExtractObjects with programmation?

7 REPLIES 7
SOLVED
Reply
Message 1 of 8
joantopo
478 Views, 7 Replies

SurfaceExtractObjects with programmation?

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):

 

img2.jpg

 

 

I was looking for in Surface class but there is nothing similar.

Autocad C3D 2019 SP3, 2020 & 2021
Intel I9 9900K with frontal watercooler alphacool eisbaer 360 (original fans mounted in pull)- 3 fans Corsair 120 ML PRO in push.
MOBO Gygabyte Z390 Aorus Master- Corsair RGB Vengeance 64GB RAM (4x16) CL16
Nvidia Quadro RTX 4000
Samsung 970 EVO PLUS 1TB (unit C). Samsung 970 PRO 512GB (for data)
Power Supply: Corsair TX850M PLUS


Descubre mi programa VisorNET para Civil 3D:
https://apps.autodesk.com/CIV3D/es/Detail/Index?id=appstore.exchange.autodesk.com%3avisornet_windows32and64%3aes
7 REPLIES 7
Message 2 of 8
Jeff_M
in reply to: joantopo

Look under the TinSurface object, find this:
http://docs.autodesk.com/CIV3D/2014/ENU/API_Reference_Guide/html/2eaac15d-3cda-a958-5a52-5bbb1376f17...

BTW, the Extract* methods in the API do not need the surface display set to anything special. They will work regardless of what is currently shown.
Jeff_M, also a frequent Swamper
EESignature
Message 3 of 8
joantopo
in reply to: Jeff_M

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.

Autocad C3D 2019 SP3, 2020 & 2021
Intel I9 9900K with frontal watercooler alphacool eisbaer 360 (original fans mounted in pull)- 3 fans Corsair 120 ML PRO in push.
MOBO Gygabyte Z390 Aorus Master- Corsair RGB Vengeance 64GB RAM (4x16) CL16
Nvidia Quadro RTX 4000
Samsung 970 EVO PLUS 1TB (unit C). Samsung 970 PRO 512GB (for data)
Power Supply: Corsair TX850M PLUS


Descubre mi programa VisorNET para Civil 3D:
https://apps.autodesk.com/CIV3D/es/Detail/Index?id=appstore.exchange.autodesk.com%3avisornet_windows32and64%3aes
Message 4 of 8
Jeff_M
in reply to: joantopo

Both Tin & Grid surface objects have the Extract* methods, but you are right about the Tin & Grid Volume surface objects not exposing these methods.
Jeff_M, also a frequent Swamper
EESignature
Message 5 of 8
joantopo
in reply to: joantopo

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.

Autocad C3D 2019 SP3, 2020 & 2021
Intel I9 9900K with frontal watercooler alphacool eisbaer 360 (original fans mounted in pull)- 3 fans Corsair 120 ML PRO in push.
MOBO Gygabyte Z390 Aorus Master- Corsair RGB Vengeance 64GB RAM (4x16) CL16
Nvidia Quadro RTX 4000
Samsung 970 EVO PLUS 1TB (unit C). Samsung 970 PRO 512GB (for data)
Power Supply: Corsair TX850M PLUS


Descubre mi programa VisorNET para Civil 3D:
https://apps.autodesk.com/CIV3D/es/Detail/Index?id=appstore.exchange.autodesk.com%3avisornet_windows32and64%3aes
Message 6 of 8
Jeff_M
in reply to: joantopo

Joan, your code worked fine for me. Is it just not getting selected? Perhaps your vertex count is larger than the GRIPOBJLIMIT?
Jeff_M, also a frequent Swamper
EESignature
Message 7 of 8
joantopo
in reply to: Jeff_M

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.

 

 

Autocad C3D 2019 SP3, 2020 & 2021
Intel I9 9900K with frontal watercooler alphacool eisbaer 360 (original fans mounted in pull)- 3 fans Corsair 120 ML PRO in push.
MOBO Gygabyte Z390 Aorus Master- Corsair RGB Vengeance 64GB RAM (4x16) CL16
Nvidia Quadro RTX 4000
Samsung 970 EVO PLUS 1TB (unit C). Samsung 970 PRO 512GB (for data)
Power Supply: Corsair TX850M PLUS


Descubre mi programa VisorNET para Civil 3D:
https://apps.autodesk.com/CIV3D/es/Detail/Index?id=appstore.exchange.autodesk.com%3avisornet_windows32and64%3aes
Message 8 of 8
joantopo
in reply to: joantopo

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..

 

 

Autocad C3D 2019 SP3, 2020 & 2021
Intel I9 9900K with frontal watercooler alphacool eisbaer 360 (original fans mounted in pull)- 3 fans Corsair 120 ML PRO in push.
MOBO Gygabyte Z390 Aorus Master- Corsair RGB Vengeance 64GB RAM (4x16) CL16
Nvidia Quadro RTX 4000
Samsung 970 EVO PLUS 1TB (unit C). Samsung 970 PRO 512GB (for data)
Power Supply: Corsair TX850M PLUS


Descubre mi programa VisorNET para Civil 3D:
https://apps.autodesk.com/CIV3D/es/Detail/Index?id=appstore.exchange.autodesk.com%3avisornet_windows32and64%3aes

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Rail Community


 

Autodesk Design & Make Report