Exports the active layout visible entities to an SVG string.
Namespace:
DXFReaderNET
Assembly:
DXFReaderNET (in DXFReaderNET.dll) Version: 20.12.2
Syntaxpublic string ToSVG(
SVGUnits Units = SVGUnits.Pixel
)
Public Function ToSVG (
Optional Units As SVGUnits = SVGUnits.Pixel
) As String
public:
String^ ToSVG(
SVGUnits Units = SVGUnits::Pixel
)
member ToSVG :
?Units : SVGUnits
(* Defaults:
let _Units = defaultArg Units SVGUnits.Pixel
*)
-> string
METHOD ToSVG(
Units AS SVGUnits := SVGUnits.Pixel
) AS STRING
Parameters
- Units (Optional)
- Type: DXFReaderNETSVGUnits
Output SVG units (width/height attributes and viewBox are expressed in these units).
Return Value
Type:
StringSVG markup as a string.
Remarks
1. Computes drawing extents of current active layout entities.
2. Explodes inserts (block references) and merges their (transformed) entities into a flat list.
3. Normalizes coordinates so the minimum extents map to (0,0) and Y is inverted to match SVG coordinate system (Y down).
4. Approximates curves (splines, arcs, ellipses, mlines) to polylines using existing MathHelper utilities.
5. Emits basic SVG primitives: line, polyline, circle, polygon, text.
Width = entity width when available, otherwise a small default (0.1 drawing units).
White (#FFFFFF) is forced to black (#000000) for visibility.
NOTE: This is a simplified exporter: no linetypes, line joins, transforms, text styling beyond size/color, hatches are not filled, z is ignored.
See Also