I am looking for a way for drawing elements by coordinates.
I want to set The SRID for the elements .
is there anybody do it before??
I am looking for a way for drawing elements by coordinates.
I want to set The SRID for the elements .
is there anybody do it before??
Can you please share the details of your requirements along with source file and desired file that you want to create and we may assist you further in this regard.
you can imagine I have list of coordinates in the WGS84 as SRID.
I just want to draw them in a .DXF file.
I regret to share that at present the requested support is not available in API. However, I have created a ticket with ID CADNET-1349 as investigation to further investigate if we can offer the support in API or not. This thread has been linked with the issue so that you may be notified once the issue will be fixed.
You can consider to achieve using drawing polygons:
using (CadImage cadImage = new CadImage())
{
CadPolyline polyline = new CadPolyline();
polyline.ChildObjects.Add(new Cad3DVertex(){LocationPoint = new Cad3DPoint(-5, -5, 0)});
polyline.ChildObjects.Add(new Cad3DVertex() { LocationPoint = new Cad3DPoint(-5, 10, 0) });
polyline.ChildObjects.Add(new Cad3DVertex() { LocationPoint = new Cad3DPoint(20, 10, 0) });
polyline.ChildObjects.Add(new Cad3DVertex() { LocationPoint = new Cad3DPoint(20, -5, 0) });
polyline.Flag = CadPolylineFlag.CLOSED_POLY;
List<CadBaseEntity> entities = new List<CadBaseEntity>();
entities.Add(polyline);
cadImage.Entities = entities.ToArray();
cadImage.UpdateSize();
CadRasterizationOptions rasterizationOptions = new CadRasterizationOptions();
PdfOptions pdfOptions = new PdfOptions();
cadImage.Save(outPath, pdfOptions);
}
The following examples is regarding creating 2D-polylines:
CadLwPolyline cadLwPolyline = new CadLwPolyline();
cadLwPolyline.Coordinates = new List<Cad2DPoint>();
cadLwPolyline.Coordinates.Add(new Cad2DPoint(-5d, -5d));
cadLwPolyline.Coordinates.Add(new Cad2DPoint(-5d, 10d));
cadLwPolyline.Coordinates.Add(new Cad2DPoint(20d, 10d));
cadLwPolyline.Coordinates.Add(new Cad2DPoint(20d, -5d));
cadLwPolyline.Flag = CadLwPolylineFlag.Closed;
cadLwPolyline.ConstantWidth = 0.1;
As a note: the coordinates are in 2D/3D space so they should be converted from WGS84 (latitude and longitude) to UTM (Northing/Easting) or other system.
Can you please share if we may close this issue on our end or there is any further feedback from you in this regard.