Bug FeatureLine.BaseCurve

Bug FeatureLine.BaseCurve

joantopo
Mentor Mentor
709 Views
8 Replies
Message 1 of 9

Bug FeatureLine.BaseCurve

joantopo
Mentor
Mentor

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
0 Likes
710 Views
8 Replies
Replies (8)
Message 2 of 9

stacy.dunn
Collaborator
Collaborator

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

Stacy Dunn
0 Likes
Message 3 of 9

Jeff_M
Consultant
Consultant
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
0 Likes
Message 4 of 9

Anonymous
Not applicable

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

 

Thanks,

0 Likes
Message 5 of 9

Jeff_M
Consultant
Consultant

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
0 Likes
Message 6 of 9

Anonymous
Not applicable

I will log a change request to investigate this further.

 

Thanks,

Partha

0 Likes
Message 7 of 9

joantopo
Mentor
Mentor

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
0 Likes
Message 8 of 9

joantopo
Mentor
Mentor

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
0 Likes
Message 9 of 9

joantopo
Mentor
Mentor

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
0 Likes