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: 

Help: InsertFeaturePoint( )

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
joantopo
508 Views, 4 Replies

Help: InsertFeaturePoint( )

I want to create new vertex points in feature line  and 3dpol.

 

I have this:

  try
               {
                   if (obj.GetType() == typeof(Autodesk.AutoCAD.DatabaseServices.Polyline3d))
                   {
                       Polyline3d p3d = (Polyline3d)trans.GetObject(entRes.ObjectId, OpenMode.ForWrite);




                       for (int i = 0; i <= ListaNuevosVertices.Count - 1; i++)
                       {
                           PolylineVertex3d vertex = new PolylineVertex3d(ListaNuevosVertices[i]);
                           p3d.InsertVertexAt(idVerticeAnterior[i], vertex);
                       }

                   }
                   else
                   {
                       FeatureLine fl = (FeatureLine)trans.GetObject(entRes.ObjectId, OpenMode.ForWrite);

                       Autodesk.AECC.Interop.Land.AeccLandFeatureLine oFtrLn = (Autodesk.AECC.Interop.Land.AeccLandFeatureLine)fl.AcadObject;
                       foreach (Point3d pt in ListaNuevosVertices)
                       {
                          
                           object punt = pt;


                           oFtrLn.InsertFeaturePoint(punt, AeccLandFeatureLinePointType.aeccLandFeatureLinePointPI);
                       }
                   }

               }
               catch (System.Exception ex)
               {
                   ed.WriteMessage(
                     "\nException: {0}",
                     ex.Message
                   );
               }
               

 

In this code line:

oFtrLn.InsertFeaturePoint(punt, AeccLandFeatureLinePointType.aeccLandFeatureLinePointPI);

 always catches the same Exception "the value is not within the expected range" .I have translated it because I get "El valor no está dentro del intervalo esperado". Perhaps is this: " Value does not fall within the expected range.".

 

I have tried it with different point3d values but always catches  Exception.

 

With pol3d I have similar problem.

 

Thanks in advance.

 

 

 

 

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
4 REPLIES 4
Message 2 of 5
joantopo
in reply to: joantopo

Solved XD:

 

  else
                   {
                       FeatureLine fl = (FeatureLine)trans.GetObject(entRes.ObjectId, OpenMode.ForWrite);

                       Autodesk.AECC.Interop.Land.AeccLandFeatureLine oFtrLn = (Autodesk.AECC.Interop.Land.AeccLandFeatureLine)fl.AcadObject;
                       foreach (Point3d pt in ListaNuevosVertices)
                       {
                           double[] punto = new double[3];
                           punto[0] = pt.X;
                           punto[1] = pt.Y;
                           punto[2] = pt.Z;
                        
                           oFtrLn.InsertFeaturePoint((object)punto, AeccLandFeatureLinePointType.aeccLandFeatureLinePointPI);
                       }
                   }

 Jeff said me it a week ago. I didn´t remeber it.

 

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 3 of 5
Jeff_M
in reply to: joantopo

Just as with editing the elevation, the COM Featureline InsertFeaturePoint expects an array of 3 doubles passed as an object.

 

double[] punt = pt.ToArray();

oFtrLn.InsertFeaturePoint((object)punt, AeccLandFeatureLinePointType.aeccLandFeatureLinePointPI);

 

As for the Polyline3d.InsertVertexAt(), make sure that the index vertex is correct. 

Jeff_M, also a frequent Swamper
EESignature
Message 4 of 5
joantopo
in reply to: Jeff_M

Yes, I don´t like to find the proper index vertex.

Luckly that feature lines doesn´t need it.

 

I´m trying to do an utility for project COGOpoints in 3dpol or feature line and create new vertex in orthogonal.

In command line, the user select if he wants offset right,left or both and value of offset and if he wants new COGOPoints in those new vertex.

Vertex and points have elevation of point projected.

 

However,it can be sometimes  there were two solutions(projected point) if that point is in near in the edge.I have to close and open again database each time I add new vertex in feature line.

 

 

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

You shouldn't ned to open/close for each vertex added to a featureline. Don't open it for write, as you are not editing the .NET object. The COM methods take care of any required open/cose of the object so you just need to pass the AcadObject opened for read.

Jeff_M, also a frequent Swamper
EESignature

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

Post to forums  

Rail Community


 

Autodesk Design & Make Report