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: 

Bug FeatureLine.BaseCurve

8 REPLIES 8
Reply
Message 1 of 9
joantopo
471 Views, 8 Replies

Bug FeatureLine.BaseCurve

I´m trying this  to get a polyline 3d in the drawing from feature line.

 

 public static void prueba(Autodesk.AutoCAD.DatabaseServices.ObjectId id)
        {

            Document doc = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument;
            Database db = doc.Database;
            Editor ed = doc.Editor;


            using (DocumentLock docLock = doc.LockDocument())
            {
                using (Transaction trans = db.TransactionManager.StartTransaction())
                {
                   
                        Autodesk.AutoCAD.DatabaseServices.DBObject obj = trans.GetObject(id, OpenMode.ForWrite);
                        DBObjectCollection entitats = new DBObjectCollection();

                        FeatureLine FL = obj as FeatureLine;
                        if (FL != null)
                        {
                            System.Type tipo = FL.GetType();
                            if (tipo.Name != "SurveyFigure")
                            {
                                // get the projected curve from feature line 
                                Curve baseCurve = FL.BaseCurve;
                                baseCurve.Layer = FL.Layer; //lo ponemos en la misma capa que la capa de la línea característica.


                                // Now append the curve to db
                                BlockTable table = trans.GetObject(db.BlockTableId, OpenMode.ForRead) as BlockTable;
                                BlockTableRecord model = trans.GetObject(table[BlockTableRecord.ModelSpace], OpenMode.ForWrite) as BlockTableRecord;

                                model.AppendEntity(baseCurve);

                                trans.AddNewlyCreatedDBObject(baseCurve, true);
                               
                            }

                        }

                    trans.Commit();
                } //end transaction
            } //end candado  
        }

 

However, in some cases, generally if the feature line has arc and lines, the result polyline 3d has some repeated vertex.(3 times).

 

For exemple, in the attached drawing file, vertex 30,31 and 32 has the same position.

 

 

 

Are there any simply methods to erase repeated(duplicated) vertex of one entity?

 

 

 

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
8 REPLIES 8
Message 2 of 9
stacy.dunn
in reply to: joantopo

Do you know if the original feature line had the duplicate vertices or is the BaseCurve method generating them?

Stacy Dunn
Message 3 of 9
Jeff_M
in reply to: stacy.dunn

It appears the BaseCurve has 3 vertices at the end of an arc. Draw a Featureline with an arc, set elevations at the vertices. Explode the Featureline to a 3dpoly. You will see this issue at the end of any arc (not the start, just the end)
Jeff_M, also a frequent Swamper
EESignature
Message 4 of 9
Anonymous
in reply to: Jeff_M

In this situation you can use Map clean up tools or iterate through the vertices to check if there is any duplicate.

 

Thanks,

Message 5 of 9
Jeff_M
in reply to: Anonymous

Partha, yes it's simple enough to run through the vertices and clean them up. But, why do we need to? It seems like a defect to me to place 2 extra vertices at the end of a former arc when getting the BaseCurve object.

Jeff_M, also a frequent Swamper
EESignature
Message 6 of 9
Anonymous
in reply to: Jeff_M

I will log a change request to investigate this further.

 

Thanks,

Partha

Message 7 of 9
joantopo
in reply to: joantopo

thanks.

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 9
joantopo
in reply to: joantopo

Hi.

 

I have a question about BaseCurve()  method.

 

Once an arc segment  has divided in a lot of  line segments, how can we set the length of these line segments?

 

For example in the "test.dwg" each segment line has length= 15.9295

 

segmentLine.jpg

 

Can I set this length in Civil 3D settings? And can I do with API programming?

 

 

 

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 9 of 9
joantopo
in reply to: joantopo

ok.

It is in Site properties (3d Geometry tab) Arrow length.

http://forums.autodesk.com/t5/AutoCAD-Civil-3D-General/Exploding-featurelines-to-3D-Polylines/m-p/45...

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