Method ExportGraph
ExportGraph(string, double)
Gets the graph of the drawing as one JSON document, as the app writes it (schema opencad2d.graph, version 1): a
node for each entity of ExportJson(string) and the edges that touch, contain, dimension and annotate.
public string ExportGraph(string layout, double tolerance)
Parameters
layoutstringThe layout to take (
Modelfor model space), or null for model space and every layout.tolerancedoubleHow near two ends must be to touch, in millimetres; above nought.
Returns
- string
The JSON text.
Exceptions
- CadRemoteException
Thrown when the drawing is closed, has no layout of that name, or the tolerance is not above nought.
ExportGraph(string, double, int)
Gets the graph of the drawing as ExportGraph(string, double) does, cut at a number of edges: the first
maxEdges edges of the whole graph in its order (kind, source, target), with truncated true and
edgesFound in the text where there were more.
public string ExportGraph(string layout, double tolerance, int maxEdges)
Parameters
layoutstringThe layout to take (
Modelfor model space), or null for model space and every layout.tolerancedoubleHow near two ends must be to touch, in millimetres; above nought.
maxEdgesintThe most edges to keep; above nought.
Returns
- string
The JSON text.
Exceptions
- CadRemoteException
Thrown when the drawing is closed, has no layout of that name, or the tolerance or the cap is not above nought.