LinkCAD has extensive support for controlling the conversion process from the command line.
The following documentation explains how to apply various LinkCAD tools from the command line.
LinkCAD conversion tasks can be automated by means of command line arguments, as described in the LinkCAD help file, chapter “Customization Guide”. The following parameters are of particular interest in this context:
LcImportFormat
selects the import formatLcExportFormat
selects the export formatLcImportFile
or -i
specifies the file to importLcExportFile
or -o
specifies the converted fileLcSkipSteps
specifies which part of the LinkCAD user interface to hide (eg. -LcSkipSteps=all
)
This document describes the command line argument ToolApply
, which is used to apply a series of transformations to the imported file.
In order to apply a tool command to the loaded file, one of the following commands needs to be specified using the ToolApply
command line argument. The general syntax is:
-ToolApply=cmd1;cmd2;cmd3;...
where cmdn
is any of the command below. They will be applied in the order specified; you can even run the same command, with the same or different parameters, several times.
ToolApply
parameter.
The following lists the various commands that may be specified using the ToolApply
parameter.
This section lists all valid ToolApply
commands that can be used to specify various processing modes for the tool commands described in the next section.
nm
|um
|mil
|point
|mm
|cm
|in
|m
|ft
|pm
.This sets the units to be used by any tool following this command. You can change units as many times as needed.
-ToolApply=SetUnits(mm);JoinOpenPolylines(120)
SetUnits
, but also dpi
is possible).
Sets the resolution to be used for following tools (default is taken from ToolArcPrecValue
and ToolArcPrecUnits
if SetResolution
is not specified). You can change resolution as many times as needed.
-ToolApply=SetResolution(32);SetUnits(mm);JoinOpenPolygons(120)
-ToolApply=SetResolution(10nm);SetUnits(mm);JoinOpenPolygons(120)
NonZero
or EvenOdd
.
This selects the fill rule to be used by tools following this command, and that rely on this setting. If absent, the default is taken from the option parameter -ToolEvenOddFill
.
Link
or Split
.
This selects the hole split mode used by tools following this command, and that rely on this setting. If absent, the default is taken from the option parameter -ToolDeembedCutLines
.
Merge
or Keep
.
This specifies how to handle internal edges during a Boolean operation, such as MergeOverlappingPolygons
. If absent, the default is taken from the option parameter -ToolKeepInternalEdges
.
All|Polylines|Text|Circles|Nurbs|Donuts|DonutsSplit|Arcs
.This explodes the specified shapes to polygons. If more than one type needs to be exploded, either use All, or repeat the command for the desired types.
SetUnits
.Crops the drawing to the specified size.
-ToolApply=SetUnits(mm);CropBounds(-100,-150,900,100)
where tolerance specifies the maximum tolerance distance. The tolerance value is expressed in the units specifies using SetUnits
.
Merges zero-width polylines by performing the following steps on zero-width polylines:
JoinOpenPolylines
, in order to create closed polygons from the merged polylines
-ToolApply=SetResolution(32);SetUnits(mm);MergeZeroWidthPolylines(120)
where tolerance specifies the maximum distance between adjacent polyline end-points. The tolerance value is expressed in the units specifies using SetUnits
.
Joins open polylines, and turns them into polygons.
MergeZeroWidthPolylines
, in order to simplify polylines prior to joining them.
-ToolApply=SetResolution(32);SetUnits(mm);JoinOpenPolylines(120)
-ToolApply=SetResolution(10nm);SetUnits(mm);JoinOpenPolylines(120)
Adds with to all zero-width polylines.
Deletes all zero-width polylines.
Closes open polylines, and converts them into polygons, by adding a segement from the last to the first vertex.
Removes any duplicate shapes
Merges overlapping polygons.
De-embeds polygons. Note that you need to specify Explode(All)
before de-embedding to include other shapes in this operation.
Holes|FullNesting
.Extracts holes from polygons onto separate layers. The hole layer will be named after the original layer, with the suffix _neg appended. If such a layer name already exists, _neg1 will be used, where the number is increased as needed.
Modes:
Holes
: Extracts only holes onto separate layersFullNesting
: Extracts polygons nested inside another polygon's hole onto yet another layer. That polygon's holes are then again extracted onto another layer, and so on.
Note that you need to specify Explode(All)
before extracting holes to include other shapes in this operation.
Flattens the main cell structure hierarchy. Tools such as DeEmbedPolygons()
only perform on a per-cell basis, so prior flattening may be desired.
Forces clock-wise orientation for all polygons
Where
An error_margin of 1.0 means that all “n” vertices of the segment are within a distance “s” of the ideal arc, where “s” is maximum distance between an ideal arc and a polygonal arc with “n” vertices. If you set the margin to 2, then that distance “s” may be twice as large (the actual influence is more complex - the algorithm tests many criteria, such as continuous derivation, maximum cord length, standard deviation, …).
A value of 1.0 provides a tight arc fit (or no arc at all, if tight fitting is not possible), whereas large values of “s” (2 or 3) will include more vertices in any given arc with a looser fit. Values above 3 result in large deviations, so use with care. A good compromise is 1.5.
Where
SetUnits
.