Cadconvert
Cadconvert
CADConvert
GUIDE
www.cad-schroer.com
All rights reserved. No part of this documentation may be reproduced in any manner (print, photocopy or other) without the written
permission of CAD Schroer GmbH.
CAD Schroer GmbH has made its best effort to ensure that the information in this document is accurate and reliable, but cannot
guarantee the accuracy, timeliness, reliability or completeness of any of the information contained herein. CAD Schroer GmbH
will not make any warranty nor accept legal responsibility or liability of any kind for consequences resulting from errors or omis-
sions.
All other brand or product names are trademarks or registered trademarks of their respective owners.
August 2009
CAD Schroer GmbH CAD Schroer France SAS CAD Schroer Italia SRL
Fritz-Peters-Str. 26-30 17, Rue du Docteur Lebel Piazza Della Resistenza 26
47447 Moers 94300 Vincennes 20021 Bollate MI
TABLE OF CONTENTS
Preface 5
Index 83
PREFACE
Book Conventions
The following table illustrates and explains conventions used in writing about MEDUSA applica-
tions.
Convention Example Explanation
Menu Choose Zoom from the View menu Indicates a command, function or
Add button button that you can choose from a
Choose the tool Creates thin solid lines. menu, dialog or tooltray.
Syntax acos 0.345 User input,
The ciaddobj command commands, keywords and
Return or Control-g keys to press on a keyboard.
SyntaxBold Enter command> plot_config Where system output and user input
are mixed, user input is in bold.
SyntaxItalic tar -cvf /dev/rst0 filename Supply an appropriate substitute for
each variable; for the given example
replace filename with an actual file
name.
Filename&path medusa\med2d\m2d\src\ Shows path and filenames.
UPPERCASE MEDUSA or CADCONVERT Names of products.
italic left mouse button Indicates the buttons to press on a
Drafting User Guide mouse and names of books.
bold A temporary group is a collection of ... Emphasize text.
Please note: Illustrations showing menus and forms are taken from a window system.
The display for other platforms can differ slightly.
Online documentation for each book is provided in HTML format. You can view this online
documentation in the installation directory, on the CD-ROM, or directly by calling it up within the
MEDUSA user interface.
Installation Directory
1. Navigate to the directory where MEDUSA is installed.
<MEDUSA installation directory>/meddoc/doc/<language>/ (Unix)
<MEDUSA installation directory>\meddoc\doc\<language>\ (Windows)
where <language> is either english, german or french.
2. Click on the file mainmenu.htm.
3. Click the book title you want to view.
CD-ROM
1. Navigate with your HTML browser to the CD-ROM into the following directory.
<CDROM_mount_point>/doc/<language>/ (Unix)
<CDROM_Drive>:\doc\<language>\ (Windows)
2. Click on the file mainmenu.htm.
3. Click the book title you want to view.
MEDUSA Interface
1. Click left on the entry Help inside the main menu.
2. Choose MEDUSA Documentation from the pulldown menu.
A browser opens showing the mainmenu.htm listing all available documents.
Printing Documentation
A PDF (Portable Document Format) file is included for each online book. See the first page of
each online book for the document name which corresponds to the PDF file name (e.g. HTML
title is Drafting User Guide, PDF file is drafting.pdf). Check with your system administrator if you
need more information. You must have Acrobat Reader installed to view and print PDF files. If
you don‘t have the Acrobat Reader, you can download it for free from the Adobe homepage:
http://www.adobe.com/products/acrobat/readstep.html
Introduction
The CADConvert program builds the base for the MEDUSA-DXF/DWG interface. The converter
enables 2D MEDUSA-drawings to be converted into DXF/DWG-data and vice versa. Therefore
the program can be used in four ways:
• MEDDXF : Translates 2D MEDUSA-sheets to DXF-data
• DXFMED : Translates DXF-data to 2D MEDUSA-Sheets
• MEDDWG : Translates 2D MEDUSA-sheets to DWG-data
• DWGMED : Translates DWG-data to 2D MEDUSA-Sheets
DXF/DWG-data not produced by AutoCAD may not meet the DXF/DWG-standard and can
produce unexpected results. The converter has been developed fault tolerant to read in non
DXF/DWG-standard files but it is not able to compensate all deviations.
In some cases MEDUSA and AutoCAD work completely different, making it impossible to
regenerate the same data using a loop-translation (e.g. MEDUSA-DXF-MEDUSA or DXF-
MEDUSA-DXF). The converter is designed in a way to cover the properties of the target
system. For loop-translation following has to be considered:
• MEDUSA line and text types are maintained during an export/import cycle.
If lines or texts with free style are exported into AutoCAD and then re-imported into
MEDUSA, they will be free styles again having the appropriate line or text type
exported before, unless the type was explicitely mapped onto another MEDUSA style
during import.
• Standard prims of MEDUSA are maintained during an export/import cycle.
Standard prims are exported to AutoCAD as blocks and they are re-imported as
MEDUSA prims again (in earlier revisions prims changed into groups with graphic
elements). This is not valid for user defined prims. For mapping of prims see
“Configuration”, “Default Mapping DXFMed/DWGMed”“Symbol Mapping” on page 28.
URL text properties are exported to DXF/DWG and also imported back into MEDUSA.
Starting CADConvert
You can start CADConvert from within MEDUTIL using the commands listed below for the
appropriate interface.
The interfaces mentioned in “Running CADConvert within MEDUTIL” can be called within the
MEDUSA user interface with the functions File -> Open and File -> Save as and then choosing the
extension of the AutoCAD file.
Please note: The following explanations are valid for a Windows system.
It is similar on a UNIX system. You only have to use the usual path conventions
(slash / instead of backslash \) and the executable is cadconvert instead of
cadconvert.exe.
For starting CADConvert offline inside a console (DOS box) do the following steps:
1. Open a console (DOS box).
2. Inside the console start the login.bat from your user project.
3. Then type in the command:
You also can do the steps for running the login.bat and starting CADConvert in a Batch file,
which then looks like following:
call E:\user_proj\login.bat
E:\medusa\CADCONVERT\M2D\RUN\cadconvert.exe @e-
macro E:\user_proj\med_dwg.mac
List Conversion
You can convert automatically several files, which are compiled in a list, using one command.
1. Create a directory and insert any files, which should be converted. In our example the
directory is called sheet_dir. It contains MEDUSA sheets with file extension she.
2. To create the list automatically open a console (DOS box) and type in the following:
dir /s /b E:\sheet_dir\*.she > E:\sheet_dir\list.txt
The list file, here called list.txt, is inserted into the specifyed directory, E:\sheet_dir. It
contains all files of the E:\sheet_dir directory with extension .she.
In section “Starting Offline inside a Console” on page 8 the example of a macro is given, which
converts a MEDUSA file into DWG format. For the list conversion in our example the macro
convert_meddwg.mac has been created in the directory E:\userproj. It looks like as follows:
@e- meddxf
@e- modin med
The batch file, convertjob.bat, used for running the login.bat and starting CADConvert, looks for
the list conversion as follows:
call E:\user_proj\login.bat
E:\medusa\CADCONVERT\M2D\RUN\cadconvert.exe @e-
macro E:\user_proj\convert_meddwg.mac
CONFIGURATION
This chapter explains all the configuration and mapping files used by CADConvert.
• Settings .................................................................................... 12
• Medstyle................................................................................... 43
Settings
By default the settings for CADConvert, which are transferred to the graphic user interface, are
made in one of the following files (depending on the language):
• English: <medusa>\cadconvert\cfg\cadconvert.cfg
• German: <medusa>\medchangeger\cadconvert\cfg\cadconvert.cfg
• French: <medusa>\medchangefra\cadconvert\cfg\cadconvert.cfg
• Japanese: <medusa>\medchangeja\cadconvert\cfg\cadconvert.cfg
Further more it is possible to use another directory containing the configuration file than the
default directory. This can be done by setting the environment variable
CADCONVERT_CUSTOM=e:\customer\<xyz>. The value of the variable has to be a valid
directory, which contains the cadconvert.cfg file at minimum. If the directory is invalid or the
cadconvert.cfg file does not exist, the following error message is displayed:
Setting from CADCONVERT_CUSTOM environment variable ignored, because
specified directory or file cadconvert.cfg doesn’t exist!
It follows an example of the cadconvert.cfg file. Keywords are described in the chapter “List of
Commands” on page 47.
Which mapping file is used for the conversion is described in the entries to Linestyle and
Textstyle Mapping. Mapping files are explained in the chapters “Default Mapping DXFMed/
DWGMed” on page 20 and “Default Mapping MedDXF/MedDWG” on page 31.
MAPLOG = off
MAPFILE = cadconvert.map
ERRLOG = off
ERRFILE = cadconvert.err
-- MEDUSA Settings
PROJECT = ${MED_PROJ}
CODEPATH = ${MED_PROJ}\m2d\bin\code.bin
DDLPATH = ${MED_PROJ}\med\bin\ddl.bin
PRIMPATH = ${MED_PROJ}\m2d\bin\prims.bin
-- Linestyle Mapping
MEDDXF_LINESTYLE_MAP = ${CADCONVERT}\cfg\med2dxf_lstyle.map
DXFMED_LINESTYLE_MAP = ${CADCONVERT}\cfg\dxf2med_lstyle.map
-- Textstyle Mapping
MEDDXF_TEXTSTYLE_MAP = ${CADCONVERT}\cfg\med2dxf_tstyle.map
DXFMED_TEXTSTYLE_MAP = ${CADCONVERT}\cfg\dxf2med_tstyle.map
MEDMED_TEXTSTYLE_MAP = ${CADCONVERT}\cfg\med2med_tstyle.map
-- Symbol(Prim) Mapping
-- SYMBOLMAP = ${CADCONVERT}\cfg\dxf2med_symbol.map
-- Layerstatus Mapping
-- MEDDXF_LAYERSTAT_MAP = ${CADCONVERT}\cfg\med2dxf_layerstatus.map
-- MEDUSA Stylefile
STYLEPATH = ${MED_PROJ}\m2d\bin\styles.xml
COLOURPATH = ${M2D_PROD}\m2d\src\colours.map
BOLDNESSPATH = ${MED_PROJ}\m2d\bin\boldness.map
CONVSPACE = MODEL
CONVSPACE = ALL_PAPER
HIDDENLAYER = on
LINEWEIGHT_DEFAULT = 0.0
PROXY = BLOCK
SPLINEAPPROX = CONIC
DXFIN_CHARSET = ANSI_1252
FORCE_DXFIN_CS = OFF
XREF = OFF
USETRUECOLOR = OFF
OVERWRITE = ON
Settings for the conversion of MEDUSA to AutoCAD and vice versa respectively can also be
made inside the graphical user interface of MEDUSA by using the Options DXF/DWG-Interface
dialog.
Please note: Modifications, which you make in this dialog and confirm them with OK, are only
active during this work session. With a restart the settings are taken from the
cadconvert.cfg file (see “Settings” on page 12). Since the cadconvert.cfg will be not
overwritten automatically, MEDUSA reverts to the last saved settings of the file.
i.e. If you want to change settings permanently, you have to change them in the
cadconvert.cfg.
Choose the entry Options from the main menu and then Interfaces > DXF/DWG.
Figure 1 The Interfaces Pulldown Menu
The first tab provides the settings for the conversion from MEDUSA to DXF/DWG.
OK
Assumes modified settings for the duration of the work session.
Cancel
Changes are not assumed. The last specified settings, which have been approved
with OK are active.
Reset
Takes the default settings from the cadconvert.cfg file.
The second tab contains the settings for the conversion from DXF/DWG to MEDUSA.
The functions of the buttons comply with the ones described on the previous page.
Keywords inside the dialogs are described in the chapter “List of Commands” on page 47.
True Color
Usually AutoCAD has 256 base colors, the so called AutoCAD-Color-Index (ACI), which are
defined as RGB values. However since AutoCAD 2004 an additional True Color can be defined,
which can have any RGB value from the whole color palette of 16,7 million colors. If existent,
the True Color value is leading against the ACI color value.
During conversion for both directions, import and export, the option USETRUECOLOR can be
set in order to transfer these True Color values. For example, if you export a MEDUSA drawing,
after an import of the drawing as a DXF or DWG file the same colors as before will be displayed
in MEDUSA. If the option USETRUECOLOR is off, the ACI color value will be used.
When importing from AutoCAD, the True Color is taken, if it was defined in AutoCAD. If there is
no color with appropriate RGB values in MEDUSA, the color will be added to the MEDUSA color
catalog. If there is an appropriate value, the color existing in MEDUSA will be used. MEDUSA
can manage 256 colors. If this amount is exceeded, that color will be taken which matches best.
When exporting, an AutoCAD file with RGB values will be written, if the option
USETRUECOLOR is switched on. This will be not done, if the MEDUSA color comes close to
an ACI color, then this one will be taken.
Mapping
Instead of a color number an RGB value can be defined for a True Color in the column Colour
of the mapping table, if a certain True Color is to be mapped. This is possible for input and
output.
True Color values are handled in the same way as usual color values.
Inside the graphical user interface MEDUSA uses font names instead of font numbers, which
are used internally only. CADConvert needs font numbers for mapping. The assignment of font
names to font numbers is done in the code.dat file which is located in the directory
med2d\m2d\src.
where
<no>
is an integer number
<name>
is the font name
If you want to define a certain font for mapping on the site of MEDUSA look into the directory
med2d\m2d\src either at the code.dat file or the font.map file for the number of a certain font name.
Details on font assignments are given in the MEDUSA Customization Guide, chapter „Decortext
Fonts“, „Numbering Fonts“.
General Practice
Basically lines and texts are converted from AutoCAD into MEDUSA in that way, that the same
style names are used. If no appropriate MEDUSA style name is found for a AutoCAD style
name, conversion is performed according to the definition in the appropriate mapping table (see
“Line Style Mapping” on page 21 and “Text Style Mapping” on page 25).
Layers are numbered in sequence as they appear in the DXF/DWG-file. The numbering starts
using the baselayer that can be set in dxf2med_lstyle.cfg located in subdirectory cfg. The states of
a layer (invis, frozen,...) are not taken into account.
Attributes
DXF/DWG-attributes can be visible, invisible, constant or variable. In MEDUSA all attributes are
translated as text attributes and added to the respective structure. To be consistent with the
MEDUSA naming conventions, the attribute names are stripped to 6 characters. If the
converted name already exists, a figure is appended to the name until a unique name is found.
If for example the attributes NUMBER_A, NUMBER_B and NUMBER_C are used within the
DXF-file, then CADConvert changes NUMBER_A to NUMBER, NUMBER_B to NUMBE1 and
NUMBER_C to NUMBE2.
Properties which are locked in the MEDUSA style are not taken from the mapping.
For color of lines numbers are used on the side of MEDUSA. These numbers represent a
certain coloring. The assignment of numbers to properties can be found in the file:
<installation path MEDUSA>\med2d\m2d\src\colours.map
Differing from standard and in dependency of name, layer and color, DXF lines can be assigned
to a defined MEDUSA line with a defined layer.
This can be done with the file dxf2med_lstyle.map in the subdirectory cfg.
File Syntax
-- Linestyle Mapping Autodesk DXF --> MEDUSA
CSGCONVTYPE : CSGDXF2MED4
CSGMAPPINGTYPE : CSGLINESTYLEMAPPING
CSGBASELAYER : <int>
-- AutoCAD : MEDUSA
-- LineStyle : Layer : Colour : Bold : LineStyle : Layer : Colour : LineType : Bold : Transfer :
-------------+---------+--------+------+------------+----------+--------+----------+------+---------+
<str> : <str> : <int> : <re> : <str> : <int> : <int> : <str> : <re> : 1 / 2 :
Please note: The first two entries are internal keywords which specify the kind of file.
You may not change these entries.
The line style mapping file has the following main definitions:
• CSGCONVTYPE marks the conversion type and is CSGDXF2MED4.
• CSGMAPPINGTYPE marks the mapping type. For line mapping it is
CSGLINESTYLEMAPPING.
• CSGBASELAYER is the number of the basis layer, e.g. 500. This entry is optional.
Below the main definitions you find a table. On the left hand side the columns for AutoCAD line
definitions are given, which are mapped to the MEDUSA line styles on the right.
• LineType gives lines by its internal names (e.g. L0). LineType is always associated
with the MEDUSA LineStyle and therefore it matters for the Free Line Style only.
• Bold gives boldness by thickness values (e.g. 0.18).
Global setting:
• Transfer can be 1 for transferring elements and 2 for no transfer.
You can insert the following value types into the columns:
<str> = string
<int> = integer
<re> = real
< > = no entry. Any table cell can be empty. If a cell in the input section (DXF/DWG) is
empty, it matches any property of a DXF element. If a cell in the output section
(MEDUSA) is empty, it is filled during the scan, or, if scanning is finished, the default
value is inserted.
Columns are separated by colons. You can comment out a column with two dashes (--).
A mapping table should be structured in that way, that on top of the table the special line types
are defined and in the bottom the common definitions are given. This is because scanning the
table is done from top to bottom (see ”Mapping Procedure” below).
Mapping Procedure
CADConvert determines all qualities of a DXF/DWG element and puts them into an imaginary
table. The table is scanned from top to bottom and from left to right, and each entry is evaluated
for matching with a table entry inside the mapping table (see “Example” on page 23).
A DXF/DWG element table entry matches with a mapping table entry, if the elements quality is
the same or if the mapping table has an empty table cell.
Once a DXF/DWG element table entry matches with a mapping table entry, the appropriate
MEDUSA definitions are used. Characteristics that are not explicitly mapped are set to the
default but they can be overwritten in the following scan, they are not occupied.
Several lines of the mapping table can match the properties of the DXF/DWG input element.
Note that already set MEDUSA definitions are not overwritten. Only those MEDUSA settings
can be overwritten which still have default values meaning that they are not occupied.
If all input DXF/DWG qualities are found in the mapping table or if all entries of the mapping
table were checked, then scanning is finished for the current DXF/DWG element and the next
one is evaluated.
Please note: Mapping does not create new MEDUSA line styles.
Mapping can be done on existing MEDUSA styles only.
Properties are only taken if they are not protected inside the MEDUSA style.
Example
The table below gives the mapping used for this example:
--AutoCAD : MEDUSA
--LineStyle: Layer : Colour: Bold :LineStyle : Layer : Colour: LineType : Bold : Transfer :
-----------+---------+-------+------+-----------------+-------+-------+----------+------+----------+
:dimension: : : : 4 : : : : 1
continious : : : :solid_thin : 21 : : L0 : : 1
dashed : : : :dashed_short_thin: : : L3 : : 1
:machine : : : : 256 : @DEF : : : 1
:basement : 6 : : : 64 : @NUM : : : 1
:basement : 7 : 0.18 : : 60 : : : @SRC : 1
:basement : 5 : : : 58 : : : : 1
: : : :@FRE : : : L4 : : 1
The following table shows some DXF/DWG elements, one per line, on the left hand side. On the
right you see the resulting MEDUSA line styles, which are created according to the mapping
table given above.
AutoCAD MEDUSA
The value Default in the table above stands for the appropriate default value of the MEDUSA
style, which always has defaults for layer, color, line type and boldness. In case of Free Style
boldness is set to zero, meaning minimum thickness.
In detail a DXF element is mapped like following, taking the last DXF/DWG element as
example. The input element is dashed basement 7 0.18.
1. CADConvert starts scanning through the mapping table looking for dashed in the 1st
row.
The first cell is empty, meaning that it matches. The second cell contains dimension
which does not match and CADConvert aborts evaluating this row.
2. CADConvert goes on looking for dashed in the 2nd row.
The first cell contains continuous, meaning no match and CADConvert goes on
scanning the next row.
3. CADConvert looks for dashed in row 3.
In this row dashed is found and now the other two table entries are evaluated. Both
are empty, meaning that also these entries match. Now CADConvert takes the defined
properties of the appropriate line style and writes the entries into the table.
At this time the MEDUSA style settings are:
dashed_short_thin Default Default L3 Default.
4. CADConvert goes on looking for dashed in the 4th row of the mapping table.
The left table entry is empty, meaning that it matches.
CADConvert looks for the 2nd table cell, basement, but it finds machine, meaning no
match. Scanning this row is finished with that.
5. CADConvert goes on looking for dashed inside the next row (5).
Again the left table cell is empty, meaning that it matches.
a. CADConvert looks for basement in the 2nd cell.
Now basement is found and so it matches.
Differing from standard and in dependency of name, layer and color, DXF/DWG texts can be
assigned to defined MEDUSA texts with a defined MEDUSA text style, text type, font, layer,
color and boldness. This can be done with the file dxf2med_tstyle.map located in subdirectory cfg.
File Syntax
-- Textstyle Mapping AutoCAD -> MEDUSA
CSGCONVTYPE : CSGDXF2MED4
CSGMAPPINGTYPE : CSGTEXTSTYLEMAPPING
CSGBASELAYER : 500
--AutoCAD : MEDUSA
--TextStyle: FontFile: Layer: Color: Bold: TextStyle : Layer: Color: TextType: Font: Bold: Transfer:
-----------+---------+------+------+-----+-----------+------+------+---------+-----+-----+---------+
: : : : 0.18:plain_large: : @DEF : : : 0.5 : 1 :
: : : : :plain_large: : @SRC : : : @SRC: 1 :
<str> : <str> : <str>: <int>:<rea>: <str> : <int>: <int>: <str> :<int>:<rea>: 1 / 2 :
Please note: The first two entries are internal keywords which specify the kind of file.
You may not change these entries.
The text style mapping file has the following main definitions:
• CSGCONVTYPE marks the conversion type and is CSGDXF2MED4.
• CSGMAPPINGTYPE marks the mapping type. For text mapping it is
CSGTEXTSTYLEMAPPING.
• CSGBASELAYER is the number of the basis layer, e.g. 500. This entry is optional.
Below the main definitions you find a table. On the left hand side the columns for AutoCAD line
definitions are given, which are mapped to the MEDUSA line styles on the right.
Global setting:
• Transfer can be 1 for transferring elements and 2 for no transfer.
You can insert the following value types into the columns:
<str> = string
<int> = integer
<rea> = real
< > = no entry. Any table cell can be empty. If a cell in the input section is empty, it matches
any property of a DXF element. If a cell in the output section is empty, it is filled during
the scan, or, if scanning is finished, the default value is inserted.
The following special values can be set in the MEDUSA section:
@FRE creates a Free Text Style which is characterized in that way that it has no name. This
keyword can be set for TextStyle only.
@SRC states that the input value is used also in the output. If there is no equivalent value in
MEDUSA, the closest value is used. If you use @SRC for TextStyle and if there is no
equivalent value in MEDUSA, the following styles will be generated:
• acad_ttf_text for all text elements with a True Type font, and
Columns are separated by colons.You can comment out a column with two dashes (--).
A mapping table should be structured in that way, that on top of the table the special text types
are defined and in the bottom the common definitions are given. This is because scanning the
table is done from top to bottom. For details on the mapping procedure see “Mapping
Procedure” on page 23.
Example
The table below gives the mapping table used for this example:
--AutoCAD : MEDUSA
--TextStyle: FontFile: Layer: Color: Bold: TextStyle : Layer: Color: TextType: Font: Bold: Transfer:
-----------+---------+------+------+-----+------------+------+------+---------+-----+-----+---------+
example1: :text : : 0.18:plain_large : : @DEF : : : 0.5 : 1 :
: :com : 7 : 0.2 :plain_large : : @SRC : : : @SRC: 1 :
hints : : : : :plain_large : : : T1 : : : 1 :
: :title : : : : 2 : : : : 1 : 1 :
company : : : : :plain_small : 17 : : T1 : 1 : : 1 :
number : : : 4 : :circle : 11 : : TC1 : : : 1 :
The following table shows some DXF elements, one per line, on the left hand side. On the right
you see the resulting MEDUSA style, which is created according to the mapping table above.
AutoCAD MEDUSA
TextStyle Layer Color Bold TextStyle Layer Color TextType Font Bold
As you can see the last DXF element matches with no line of the mapping table and therefore
this element is assigned to the free style in MEDUSA.
The value Default in the table above stands for the appropriate default value of the MEDUSA
style, which always has defaults for layer, color, line type and boldness. In case of Free Style
boldness is set to zero, meaning minimum thickness.
Special Text
For a clear definition of special texttypes (e.g. underlined text, text in a box, ...) a second
mapping table is recommended. This is the table med2med_tstyle.map located in the subdirectory
cfg.
-- ACAD : MEDUSA
--Texttype: underlined : overlined : boxed : circle : sausage
----------:------------:-----------:----------:----------:--------
<string> : <string> : <string> : <string> : <string> : <string>
The following table is delivered as a standard. You can change and extend it.
Symbol Mapping
In MEDUSA you can have prims consisting of one or more line elements. When converting a
MEDUSA drawing into AutoCAD, prims are converted to blocks with a certain nomenclature.
For example, a prim PAP in MEDUSA gets the block name MEDPRIM_LAY6_PAP_ in AutoCAD,
if it is on layer 6, or MEDPRIM_LAY90_SUP_EAR_ is a superprim with picture EAR on layer 90.
To re-create prims or superprims from blocks in AutoCAD during the translation to MEDUSA,
there exists a mapping file dxfmed_symbol.map, containing the assignment of block names and
prims and superprims respectively. The path to the mapping file has to be set in the
configuration file cadconvert.cfg (see “Settings” on page 12).
Example Table:
The block names can contain wildcards. * stands for several signs and ? represents one sign.
Point Mapping
The path to the mapping file has to be set in the configuration file cadconvert.cfg (see “Settings”
on page 12).
Example Table:
-- Point Mapping
--POINTMAP = ${CADCONVERT}\cfg\dxf2med_point.map
CSGCONVTYPE : CSGDXF2MED4
CSGMAPPINGTYPE : CSGPOINTMAPPING
Raster Images
With the conversion, referenced raster images of a DXF/DWG file are transferred to MEDUSA.
Precondition for the import is, that the referenced image(s) is (are) located in the same directory
as the DXF/DWG file.
With the conversion of raster images only rectangular clipping of images and rotation by steps
of 90 degrees is possible. Shearing is not transferred (see also chapter “Limitations” on
page 81).
General Practice
Basically lines and texts are converted from MEDUSA to AutoCAD in that way, that the same
style names are used. If no appropriate AutoCAD style name is found for a MEDUSA style
name, conversion is performed according to the definition in the appropriate mapping table (see
“Line Style Mapping” on page 31 and “Text Mapping” on page 35).
If additional definitions of MEDUSA linestyles (STY >5, so called user-styles) in the MEDUSA
code-file are made, these definitions have also to be done in the file medstyle.cfg located in
subdirectory cfg. The syntax in this file is the same as in the MEDUSA code-file (see <install
path to MEDUSA>\med2d\m2d\src\code.dat).
Text height and text width are taken from the code-file definition. Using the online parameter
MEDTEXT, you can determine which font-file is used for the graphical representation in
AutoCAD.
During conversion the states of a layer (invis, frozen,...) are not taken into account. Therefor an
additional Layer Status Mapping can be used (see “Layer Status Mapping” on page 38).
Attributes
MEDUSA attributes are converted to constant hidden text attributes in DXF/DWG. Since there is
no way to attach attributes to single elements in DXF/DWG, only clump-linked MEDUSA
attributes can be converted.
For color of lines numbers are used on the side of MEDUSA. These numbers represent a
certain coloring. The assignment of numbers to properties can be found in the file:
<installation path MEDUSA>\med2d\m2d\src\colours.map
Differing from standard and in dependency of name and layer MEDUSA lines can be assigned
to defined DXF lines with defined layer, color and linestyle. This can be done with the file
med2dxf_lstyle.map located in subdirectory cfg.
File Syntax
-- Linestyle Mapping MEDUSA -> AutoCAD --
CSGCONVTYPE : CSGMED42DXF
CSGMAPPINGTYPE : CSGLINESTYLEMAPPING
CSGBASELAYER : 500
-- MEDUSA : AutoCAD
-- LineStyle : Layer : Color : LineType : Bold : LineStyle : Layer : Color : Bold : Transfer :
-------------+-------+-------+----------+------+-----------+-------+-------+------+----------+
<str> : <int> : <int> : <str> : <re> : <str> : <int> : <int> : <re> : 1 / 2 :
Please note: The first two entries are internal keywords which specify the kind of file.
You may not change these entries.
The line style mapping file has the following main definitions:
• CSGCONVTYPE marks the conversion type and is CSGMED42DXF.
• CSGMAPPINGTYPE marks the mapping type. For line mapping it is
CSGLINESTYLEMAPPING.
• CSGBASELAYER is the number of the basis layer, e.g. 500. This entry is optional.
Below the main definitions you find a table. On the left hand side the columns for AutoCAD line
definitions are given, which are mapped to the MEDUSA line styles on the right.
Global setting:
• Transfer can be 1 for transferring elements and 2 for no transfer.
You can insert the following value types into the columns:
<str> = string
<int> = integer
<re> = real
< > = no entry. Any table cell can be empty. If a cell in the input section is empty, it matches
any property of a MEDUSA element. If a cell in the output section is empty, it is filled
during the scan, or, if scanning is finished, the default value is inserted.
Columns are separated by colons.You can comment out a column with two dashes (--).
A mapping table should be structured in that way, that on top of the table the special line types
are defined and in the bottom the common definitions are given. This is because scanning the
table is done from top to bottom. For details on the mapping procedure see “Mapping
Procedure” on page 23.
Example
The table below gives some MEDUSA input elements on the left and the resulting AutoCAD
elements after conversion on the right. For the DXF output the closest possible DXF value is
calculated from the MEDUSA input value, given as best match (BM) in the table below.
MEDUSA AutoCAD
Special Mappings
The line styles of the following special mappings are „imaginary“ line style for CADConvert.
They are used for the graphical translation of the elements Prim, Point function and Superline.
• Linestyle mapping for Prims
MEDUSA DXF
LineStyle Layer Color Bold Layer Color Linestyle
LPRM 241 Surface
• Linestyle mapping for Point functions
MEDUSA DXF
LineStyle Layer Color Bold Layer Color Linestyle
LFUN 0 FUNV
• Linestyle mapping for Superlines
MEDUSA DXF
LineStyle Layer Color Bold Layer Color Linestyle
LSUP 0 Superline
• Linestyle mapping for the graphical part of, for example, boxed or underlined texts
MEDUSA DXF
LineStyle Layer Color Bold Layer Color Linestyle
LTXT 0 Textline
Text Mapping
Differing from standard and in dependency of text, font and layer MEDUSA texts can be
assigned to defined DXF texts with a defined DXF layer, color style and font. This can be done
with the file med2dxf_tstyle.map located in subdirectory cfg.
File Syntax
-- Textstyle Mapping MEDUSA -> AutoCAD --
CSGCONVTYPE : CSGMED42DXF
CSGMAPPINGTYPE : CSGTEXTSTYLEMAPPING
CSGBASELAYER : 500
-- MEDUSA : AutoCAD
-- TextStyle: Layer: Color: TextType: Font: Bold: TextStyle: Font: Layer: Color: Bold: Transfer:
------------+------+------+---------+-----+-----+----------+-----+------+------+-----+---------+
<str> : <int>: <int>: <str> :<int>: <re>: <str> :<str>: <str>: <int>: <re>: 1 / 2
Please note: The first two entries are internal keywords which specify the kind of file.
You may not change these entries.
The text style mapping file has the following main definitions:
• CSGCONVTYPE marks the conversion type and is CSGMED42DXF.
• CSGMAPPINGTYPE marks the mapping type. For text mapping it is
CSGTEXTSTYLEMAPPING.
• CSGBASELAYER is the number of the basis layer, e.g. 500. This entry is optional.
Global setting:
• Transfer can be 1 for transferring elements and 2 for no transfer.
You can insert the following value types into the columns:
<str> = string
<int> = integer
<re> = real
< > = no entry. Any table cell can be empty. If a cell in the input section is empty, it matches
any property of a MEDUSA element. If a cell in the output section is empty, it is filled
during the scan, or, if scanning is finished, the default value is inserted.
Columns are separated by colons.You can comment out a column with two dashes (--).
A mapping table should be structured in that way, that on top of the table the special text types
are defined and in the bottom the common definitions are given. This is because scanning the
table is done from top to bottom. For details on the mapping procedure see “Mapping
Procedure” on page 23.
Example
The table below gives the mapping table used for this example:
-- MEDUSA : AutoCAD
-- TextStyle : Layer: Color: TextType: Font: Bold: TextStyle: Font : Layer : Color: Bold: Transfer :
-------------+------+------+---------+-----+-----+----------+-------+--------+------+-----+---------+
: : : T1 : 1 : : :MEDTEXT: : @NUM : @SRC: 1
: 2 : : : : : :MEDTEXT:titlebox: 3 : : 1
: 11 : : T1 : : : :MEDTEXT:hints : : : 1
: : : TC1 : : : :MEDTEXT:partlist: 4 : : 1
: : : TR1 : 0 : : :MEDTEXT:company : 5 : : 1
The following table gives some MEDUSA input elements on the left and the resulting AutoCAD
elements after conversion on the right. For the DXF output the closest possible DXF value is
calculated from the MEDUSA input value, given as best match (BM) in the table below. For Font
the default is usually the parameter MEDTEXT (see “Settings” on page 12).
MEDUSA AutoCAD
TextStyle Layer Color TextType Font Bold TextStyle Font Layer Color Bold
Note that in the last row of the table the MEDUSA input element does not match any line inside
the mapping table and therefore the AutoCAD- TextStyle is used as MEDUSA style name.
TextStyle Layer Color TextType Font Bold TextStyle Font Layer Color
(*) For the assigned DXF font the filename has to be used. This can be found under the
following path:
C:\winnt\fonts
You can only use Windows true type fonts (*.TTF) or AutoCAD fonts (*.SHX), no Windows
bitmap fonts (*.FON)!
Special Text
For special texttypes such as underlined text and text in a box, the online parameter MEDTEXT
(see “Settings” on page 12) is also significant. Most of these texttypes can be displayed in DXF/
DWG by special characters. When the parameter MEDTEXT is set to medtext, this conversion
is processed automatically, otherwise only underlined text is converted.
For a correct presentation in AutoCAD, the text shape file medtext.shx located in the
subdirectory font has to be copied to the AutoCAD installation. A complete data exchange
should always include this text shape file.
If the parameter SPECTEXT_AS_PIC is set to ON inside the file cadconvert.cfg (see “Settings” on
page 12), special texts are transferred as blocks. A block contains text and lines respectively
circles.
In AutoCAD layers can have the states frozen, off or locked. To set these states in AutoCAD by
the translation from MEDUSA, there exists a mapping file med2dxf_layerstatus.map. In this file
you can make the settings. The path to the mapping file has to be set in the configuration file
cadconvert.cfg (see “Settings” on page 12‘).
Example Table:
CSGCONVTYPE : CSGMED42DXF
CSGMAPPINGTYPE : CSGLAYERSTATUSMAPPING
The files which define the mapping between MEDUSA and AutoCAD are available as text files,
which can be edited inside the graphical user interface of MEDUSA.
This section gives you the dialogs. Below each dialog you will find a link to the section which
gives detailed explanations on the entries of the appropriate mapping table.
Please note: The Interfaces -> DXF/DWG Mapping Tables function is only available in the Admin mode.
Choose the entry Options from the main menu and then Interfaces -> DXF/DWG Mapping Tables.
Figure 4 Open Mapping Tables
The dialog CADConvert Mapping Tables opens. The first tab you see is DXF -> MED Line (see “Mapping
Lines, DXF to MEDUSA” on page 40).
Save
stores the settings into the corresponding mapping files. In the next session of
MEDUSA these settings are used.
Cancel
closes the dialog without applying the parameters of the mapping tables.
Reset
restores the current data to the last saved data in the corresponding mapping file.
For details on the parameters see “Default Mapping DXFMed/DWGMed”, “Line Style Mapping”
on page 21.
For details on the parameters see “Default Mapping DXFMed/DWGMed”, “Text Style Mapping”
on page 25.
For details on the parameters see “Default Mapping DXFMed/DWGMed”, “Text Style Mapping”,
“Special Text” on page 28.
For details on the parameters see “Default Mapping MedDXF/MedDWG”, “Line Style Mapping”
on page 31.
For details on the parameters see “Default Mapping MedDXF/MedDWG”, “Text Mapping” on
page 35.
Medstyle
The presentation of broken line styles is fundamental different in MEDUSA and AutoCAD. In
AutoCAD it depends from the zoom factor and resolution but not in MEDUSA.
To make the presentation of these lines in AutoCAD equal to MEDUSA, the user has the
possibility to make an entry in the file cadconvert/cfg/medstyle.cfg. Open the file in an editor and
insert a new style description as given in the example below.
Example:
It is possible to change the configuration of CADConvert via MEDUSA User Interface. For this,
you need a specific directory structure.
Directory Structure
It is searched for all subdirectories of all cc_custom folders in all directories in the product list.
This folders must contain a cadconvert.cfg file. It is used for the configuration and mapping of
CADConvert.
Figure 6 Directory Structure
custom product
cc_custom
A B C
User Interface
By default the input field of the dialog displays the path to the cadconvert.cfg file of the
MEDUSA installation directory, respectively, if the environment variable
CADCONVERT_CUSTOM is set, it is the path to the directory defined by that variable
which is displayed.
Using the arrow, you can display a list of all existing folders of your user product, which
are located within the cc_custom directory and contain a cadconvert.cfg file.
2. Choose the path to the desired cadconvert.cfg file, by selecting the accordant directory.
3. Click on Apply to use the file for the conversion. A click on OK additionally closes the
dialog.
Now, when you open the Options DXF/DWG Interface dialog via Options > Interface >DXF/DWG, the path
to the desired cadconvert.cfg file is displayed on both index cards.
Figure 10 Options Dialog with Path to the used cfg File
When you open the mapping tables via Options > Interfaces > DXF/DWG Mapping Tables, the path
defined in the chosen cadconvert.cfg file is displayed at the top of the tabs.
Figure 11 Example of a Mapping Table with Path to a User defined cadconvert.cfg File
LIST OF COMMANDS
This chapter lists all commands available for DXFMed / DWGMed and MedDXF / MedDWG.
Common Commands
The following list contains the common commands valid for both conversion types:
cd Changes the working directory
code Specifies a pathname for a MEDUSA CODE file.
ddl Specifies a pathname for a MEDUSA DDL file.
dir Lists the contents of a directory.
errfile Specifies a pathname for the error file.
errlog Controls whether a ERRLOG-file is written.
go Starts the translation.
help Displays information on the specified command.
helppath Specifies a path to the help files.
in Specifies the pathname of the input file.
linestyle Specifies the pathname of the linestyle mapping file.
list Specifies the pathname of the listing file.
ls Lists the content of an directory.
mapfile Specifies the pathname for the mapfile.
maplog Controls whether a MAPLOG-file is written.
medcode Specifies the MEDUSA Code number for the conversion.
messpath Specifies the pathname of the message file.
overwrite Controls whether or not an already existing output-file with the same name
should be over written.
prim Specifies the pathname for a MEDUSA PRIM-file.
quit Quits the program.
reset Resets the conversion adjustments to standard or to the definitions of a
configuration file.
save Writes the current settings into the cadconvert.cfg file.
show Shows the conversion adjustments.
textstyle Specifies the pathname for the textstyle-mapping-table.
usetruecolor Controls whether True Colors will be fransfered.
! is used to enter commands of the operating system under CADConvert.
cd
SYNTAX cd [Pathname]
DESCRIPTION This command will change the working directory.
If Pathname is a backslash (Windows) or slash (Unix) you change
into the root directory.
OPTIONS Pathname
Full pathname of the directory you want to change to.
EXAMPLE cd /
cd /proj
Code
DDL
Dir
SYNTAX dir
dir [Pathname]
DESCRIPTION This command lists the content of the working directory, or the
content of the directory pointed to by pathname.
OPTIONS Pathname
Full pathname of the directory, which content will be listed
EXAMPLE dir
dir ddl /medusa/proj13a/m2d/bin
Errfile
Errlog
Go
SYNTAX go
DESCRIPTION The command go starts the translation.
EXAMPLE MEDDXF> go
Help
Helppath
In
SYNTAX in [pathname]
DESCRIPTION The command in specifies the pathname of the input file you want
to translate into the output file format.
OPTIONS pathname
Full pathname of the input file to be converted. The length of the
pathname is limited to 256 signs.
EXAMPLE DXFMED> in /data/dxf/D008.dxf
MEDDXF> in /data/sheets/9876543.she
Linestyle
List
Ls
SYNTAX ls
ls [pathname]
DESCIPTION This command lists the content of the working directory, or the
content of the directory pointed to by pathname.
OPTIONS pathname
Full pathname of the directory, which content will be listed
EXAMPLE ls
ls ddl /medusa/proj13a/m2d/bin
Mapfile
Maplog
Medcode
Messpath
Overwrite
Prim
Quit
SYNTAX quit
DESCRIPTION Use quit to exit from the utility.
If you are running the utility from within MEDUTIL, for example, you
will return to the MEDUTIL prompt.
Reset
SYNTAX reset
reset [filenam ]
DESCRIPTION The command reset without filename resets the conversion
relevant settings to the values of the default file cadconvert.cfg. This
file is in the product path below the directory cfg.
This command with filename sets the settings to the values of the
named file.
EXAMPLE DXFMED> reset projects/userproj/cadconvert_usr.cfg
Save
Show
SYNTAX show
DESCRIPTION The command show displays relevant settings of the program.
Textstyle
Usetruecolor
!
SYNTAX ! [command]
DESCRIPTION To enter a command of the operating system under CADConvert,
you have to write ! in front of the command.
OPTIONS command
command of the operating system
EXAMPLE ! chmod ...
DXFMed / DWGMed
The following list contains the common commands valid for both conversion types:
cd Changes the working directory
code Specifies a pathname for a MEDUSA CODE file.
ddl Specifies a pathname for a MEDUSA DDL file.
dir Lists the contents of a directory.
errfile Specifies a pathname for the error file.
errlog Controls whether a ERRLOG-file is written.
go Starts the translation.
help Displays information on the specified command.
helppath Specifies a path to the help files.
in Specifies the pathname of the input file.
linestyle Specifies the pathname of the linestyle mapping file.
list Specifies the pathname of the listing file.
ls Lists the content of an directory.
mapfile Specifies the pathname for the mapfile.
maplog Controls whether a MAPLOG-file is written.
medcode Specifies the MEDUSA Code number for the conversion.
messpath Specifies the pathname of the message file.
overwrite Controls whether or not an already existing output-file with the same name
should be over written.
prim Specifies the pathname for a MEDUSA PRIM-file.
quit Quits the program.
reset Resets the conversion adjustments to standard or to the definitions of a
configuration file.
save Writes the current settings into the cadconvert.cfg file.
show Shows the conversion adjustments.
textstyle Specifies the pathname for the textstyle-mapping-table.
usetruecolor Controls whether True Colors will be fransfered.
! is used to enter commands of the operating system under CADConvert.
Blockname
Clumps
Convspace
dxfin_charset
dxfmed_dimension
force_dxfin_cs
Fillgap
Hiddenlayer
limit_maxsize
lineweight_default
medprecision
Move
Out
Project
Proxy
Read_papspace / Papspace
Scale
Sheetsize
Spatialfilter
Spectstyle
Splineapprox
Subclump_type
Units
xref
MedDXF / MedDWG
The following list contains the common commands valid for both conversion types:
cd Changes the working directory
code Specifies a pathname for a MEDUSA CODE file.
ddl Specifies a pathname for a MEDUSA DDL file.
dir Lists the contents of a directory.
errfile Specifies a pathname for the error file.
acadversion
Bigfont
Blocks
Clumpname
Colors
Contextcheck
dxfout_charset
dxfprecision
LTScale
meddxf_dimension
Medtext
Medtext_gdt
PM5
Out
Polyline
Project
Spectext_as_pic
superlinemode
Textbox
Textheight_zero
Unscale
LIMITATIONS
Since MEDUSA and DXF are in different CAD formats, some information may not be translated
between them. MEDUSA is designed to save as much information as possible from each of the
two formats, but there are some restrictions. The most important restrictions are described
below.
Raster Transfer
With the conversion of raster images only rectangular clipping of images and rotation by steps
of 90 degrees is possible. Shearing is not transferred.
In the current CADConvert version the AutoCAD Revision 2000 DXF element multiline is not
processed. Shapes are not processed.
Pattern hatchings are not exactly transferred into MEDUSA, they will be defined as standard
hatchings.
3D Elements are processed with X and Y values only. 3D volume elements and views are not
processed.
Width of start and end segments of poly lines are not evaluated.
In AutoCAD version R12 boldness is still unknown, nevertheless it appears in the settings of
line-style mapping. However this column is not analyzed. It is reseverd for future use.
It is not possible to convert elements from AutoCAD Inventor to MEDUSA. This data can only
be displayed with an AutoCAD internal add-on.
INDEX
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Symbols errlog 50
! 57 Example
dxf2med_lstyle.map 23
dxf2med_tstyle.map 27
A med2dxf_lstyle.map 33
acadver 72 med2dxf_tstyle.map 37
ACI 18
convspace 81
AutoCAD Inventor 82 F
AutoCAD-Color-Index 18 fillgap 64
Font assignment name to number 19
FROZEN 38
B
bigfont 72
blockname 60 G
blocks 72 go 51
Grouplabel 73
C
cadconvert.cfg 12 H
cd 49 help 51
Clumpname 73 helppath 51
clumps 60 HIDDEN 38
code 49 hiddenlayer 64
colors 73
comment 22
Configuration 11 I
Contextcheck 74 in 52
convspace 58, 61 introduction 7
D L
ddl 49 Layer Status Mapping 38
dir 50 limit_maxsize 64
DWGMED 7 limitations 81
dxf2med_lstyle.map 21 linestyle 52
dxf2med_tstyle.map 25
Linestylemapping 21, 31
DXFMED 7
lineweight_default 65
dxfmed_dimension 63
list 52
dxfmed_symbol.map 28
dxfout_charset 74 List Conversion 9
dxfprecision 75 LOCKED 38
loop-translation 7
ls 53
E LTScale 75
errfil 50 ltscale 75
M R
mapfile 53 Raster Images 29
maplog 53 raster images 81
Mapping - Grafical User Interface 39 Read_papspace 67
Mapping Procedure 23 reset 56
med2dxf_lstyle.map 31 Running CADConvert within MEDUTIL 8
med2dxf_tstyle.map 35
med2med_tstyle.map 28
medcode 54 S
MEDDWG 7 save 56
MEDDXF 7 scale 67
meddxf_dimension 75 Settings 12
medprecision 65 sheetsize 67
Medstyle 43 show 57
medtext 76 spatialfilter 68
medtext_gdt 76 Special Mappings 34
messpath 54 specialtext 28, 38
move 65 spectstyle 68
multiline 81 spline 81
splineapprox 68
Starting Offline inside a Console 8
O superlinemode 78
out 66, 77 Symbol Mapping 28
overwrite 54
T
P textbox 79
convspace 81 textheight_zero 79
papspace 67 textstyle 57
PM5 76 textstylemapping 25
polyline 77 Transfer 22, 26, 32, 36
prim 56 True Color 18
Printing documentation from Portable Document Format
(PDF) files 6
project 66, 78 U
Proxy 66 units 69
proxy 66 unscale 79
URL text properties 7
USETRUECOLOR 18
Q usetruecolor 57
quit 56 Using CADConvert within MEDUSA 8