The best way to Copy Point2dCollection.

The best way to Copy Point2dCollection.

joantopo
Mentor Mentor
810 Views
4 Replies
Message 1 of 5

The best way to Copy Point2dCollection.

joantopo
Mentor
Mentor
What is the fastest function to coy a Point2dCollection? -Loop with Foreach: foreach (Autodesk.AutoCAD.Geometry.Point2d pt in list) { NewList.Add(pt); } or: NewList(list.CopyTo(array[],0));
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
811 Views
4 Replies
Replies (4)
Message 2 of 5

Anonymous
Not applicable

I don't know why there isn't a Point2d.CopyTo method, but there is a Point3d.CopyTo. Have you tried it out?

0 Likes
Message 3 of 5

joantopo
Mentor
Mentor
Which is your release? In Civil 3D 2014 I have both.
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 4 of 5

Anonymous
Not applicable

Interesting! I'm referencing the ObjectARX for vanilla AutoCAD 2011.

 

So do you think the .CopyTo method will do the trick for you?

0 Likes
Message 5 of 5

joantopo
Mentor
Mentor
It works: Point2d[] array = new Point2d[Coll1.Count]; Coll1.CopyTo(array, 0); Point2dCollection newColl= new Point2dCollection(); newColl.AddRange(array); "CopyTo() is void, not a function and doesn´t return a collection.
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