Documentation /  Analog Insydes /  Reference Manual /  Miscellaneous Functions /

ConvertDataTo2DMathLink Module MSBG

3.13.2 DXFGraphics

Command structure of DXFGraphics.

The main purpose of importing DXF (Drawing Interchange File) is to include a schematics into a Mathematica notebook for a better understanding and documentation of circuit analysis tasks. If your schematic editor does not support the generation of DXF files it might be possible to use tools like pstoedit and hpgl2ps to convert the graphic data to DXF.

The DXF file should only contain two-dimensional graphic objects. The following DXF entities are supported by DXFGraphics:

DXF entities supported by DXFGraphics.

DXFGraphics inherits all options from Graphics. Additional options for DXFGraphics are:

Options for DXFGraphics.

Options Description

A detailed description of all DXFGraphics options is given below in alphabetical order:

FillColors

Most DXF generators are not able to convert filled graphic objects into DXF correctly. The option FillColors can be used to fill POLYLINE and CIRCLE entities by specifying a list of pairs of DXF colors and Mathematica graphic primitives. For example, FillColor -> {1, RGBColor[0, 0, 0]} will fill all converted POLYLINE and CIRCLE entities of color 1 with the Mathematica color directive RGBColor[0, 0, 0]. More fill colors can be set as lists of pairs of a DXF color and a Mathematica graphic primitive or a DXF color. If only a DXF color number is given the entity will be filled with its original color.

LayerColor

Each DXF entity belongs to a layer having its own color property. DXFGraphics takes the color of the entity if LayerColor -> False and the color of the layer otherwise.

LineDashingScale

The value given by the option LineDashingScale is directly multiplied with the DXF dashing value. The result is the argument of AbsoluteDashing used by DXFGraphics.

ShowColors

ShowColors -> True displays a legend of used colors which allows for identifying the wanted DXF colors easily.

TextSizing

If TextSizing is set to True, the text will be scaled according to the DXF data. The average size of all text primitives in the resulting Mathematica graphics object is calculated. Afterwards the text sizes are fitted such that the average equals the value of FontSize given by the option TextStyle (see below).

TextStyle

The option TextStyle specifies the default style and font options used for displaying text. The format is { -> , }. If TextStyle contains the rule TextStyle -> val, the value val denotes the average size of the font sizes if TextSizing is True.

ThicknessFunction

This option can be used for setting the line thickness. To generate a graphic using a ten times larger line thickness and a minimum line thickness of five specify ThicknessFunction -> (AbsoluteThickness[10.*#+5.]&).

ColorList

The option ColorList can be used to modify the color translation table. For example, to set the DXF color 7 to the Mathematica color white use the option ColorList -> ReplacePart[Options[DXFColor, ColorList][[1,2]], GrayLevel[1], 7].

Examples

Load Analog Insydes.

In[1]:= <<AnalogInsydes`

Import a DXF file into Mathematica.

In[2]:= DXFGraphics["AnalogInsydes/DemoFiles/Buffer.dxf"]

Out[2]=

Use the option TextStyle to fit the font size.

In[3]:= DXFGraphics["AnalogInsydes/DemoFiles/Buffer.dxf",
TextStyle -> {FontSize -> 4}]

Out[3]=

With the option FillColors certain picture elements can be filled.

In[4]:= DXFGraphics["AnalogInsydes/DemoFiles/colorcirc.dxf",
FillColors -> {{0}, {1}, {2}, {3}, {4}, {5}, {6},
{7, -1}, {8}, {9}, {20}, {30}, {33}, {40}, {60},
{70}, {80}, {100}, {110}, {120}, {140}, {150},
{160}, {180}, {190}, {200}, {220}, {230}, {240},
{250}, {251}, {252}, {253}, {254}},
TextStyle -> {FontSize -> 4}]

Out[4]=

ConvertDataTo2DMathLink Module MSBG