Chapter 3

Running MEN2DXF

The Mentor to DXF translation engine uses a command line interface enabling the user to call it from a script or from another program quickly and easily. To see how to run the program from the BoardStation environment go to Chapter 5.

Command Line Syntax

men2dxf [options] GEOMETRY [-comp COMPONENT] [-trace TRACE] [-dxf DXF] [-block BLOCK] 

where options are:


-st                     Show text - Forces display of all text, even if 
                        it was set to 0 width in Mentor.

-detail                 Writes additional trouble shooting details
                        to the men2dxf.log file.
                        
GEOMETRY                Is the name of one or more geometry file(s),
                        separated by spaces, to be translated. At least
                        one geometry file name must be specified.

-comp COMPONENT         Is the name of the component file to be translated. 
                        Note - if you do not specify a component file you
                        won't see your parts in the DXF file.

-trace TRACE            Is the name of the trace file to be translated.
                        Circuit traces are normally stored in this file.

-dxf DXF                Is the name of the DXF file name. If not specified 
                        on the command line, men2dxf will derive the name 
                        from the first geometry file and append .dxf to the name.

-block BLOCK            Name of the drawing, board or panel you wish men2dxf to 
                        insert as the top level block in DXF.

-log LOG                Name and location of the log file.  If not specified it
                        will be written to the current directory with the name
                        DXF_FILE_NAME.LOG.

Syntax Examples

men2dxf  geom.asc  -comp comp.asc  -dxf assembly.dxf
Translates the geometry file called geom.asc and the associated component file called comp.asc into a dxf file called assembly.dxf. Only component data that appears on the top of the board is imaged.
men2dxf -st -detail board0501.asc support.asc fixture.asc -comp board0501.cmp
-dxf rd0501.dxf
Translates the geometry files board501.asc, support.asc and fixture.asc and the associated component file called board501.cmp into a dxf file called board501.dxf.

Interactive Mode

You can run the men2dxf program in interactive mode - this will prompt you for all file names and command options. A typical session is shown below with user input in bold and comments in italics:

$ cd /drv6/mentor/siemens/try2                 The three files we wish to translate
$ ls                                           are in the current directory.
geoms_ascii siemens.com siemens.tra 

$ men2dxf

men2dxf v1.21 (05/29/97) KEY 807ac80d asmsc12
(C)1996-97 Artwork Conversion Software, Inc.
(831)426-6163 info@artwork.com http://www.artwork.com

Enter geometry file(s): geoms_ascii
Enter component file(s) [optional]: siemens.com
Enter trace file(s) [optional]: siemens.tra
DXF Output Name:  siemens.dxf

Force text on? y/n  y                             Forces the translator to show
                                                  even text with w=0
Translating geoms_ascii
Line 15488

Insert one of the following high level blocks?    Unless a high level block is
                                                  inserted the AutoCAD drawing
                                                  will appear empty.
0. none:
1. board:   pci_kurz
2. drawing: 4796475_obf
3. drawing: 4796475_oda
4. drawing: test1
5. panel:   beiblatt
6. panel:   nutzen

Select a number: <1> 2

You selected: 4796475_obf
Is this correct y/n?  y

Generating DXF output...
done writing siemens.dxf
check log file ‘men2dxf.log’ for info and warnings.
$

Layer Mapping

Boardstation geometry files define layer names such as DRAWING_1 or SILKSCREEN. The men2dxf translator will use the same layer names in the DXF file. This makes it easy for the Mentor designer and the AutoCAD designer to determine correspondence between layers.

Component Layering

Component definitions can include data on a variety of layers. If data is drawn on a generic Mentor layer such as PAD then the component insertion determines whether or not this data will appear on PAD_1 (top of board) or PAD_2 (bottom of board).
Generic Layer Top Layer Bottom Layer
BREAKOUT BREAKOUT_1 BREAKOUT_2
DRAWING DRAWING_1 DRAWING_2
GLUE_MASK GLUE_MASK_1 GLUE_MASK_2
PAD PAD_1 PAD_2
PASTE_MASK PASTE_MASK_1 PASTE_MASK_2
SILKSCREEN SILKSCREEN_1 SILKSCREEN_2
SOLDER_MASK SOLDER_MASK_1 SOLDER_MASK_2
THERMAL THERMAL_1 THERMAL_2
It is also possible to define component shapes on a specific layer such as PAD_1. In that case such a shape is only translated if the component is inserted on the top layer.

Attribute Layers

Boardstation uses attribute commands to define certain areas such as routing keepouts, via keepouts and the board outline. men2dxf maps puts such data on an appropriately named layer so that the AutoCAD designer can see where the outline originated in the Boardstation database.
Attribute                                               AutoCAD Layer
$$attribute(“BOARD_ROUTING_OUTLINE”,...)        BOARD_ROUTING_OUTLINE
$$attribute(“BOARD_PLACEMENT_KEEPOUT”,...)      BOARD_PLACEMENT_KEEPOUT

Test Point Layer

The trace file contains test point information - generally at least one test point per route. Each test point is mapped to a circle in DXF and placed on a layer called TEST_POINT.

Trace Layers

Circuit traces are added to physical layers defined as 1,2,3,...At the beginning of the trace file is a mapping table that correlates these layers with the PCB data layer names:
XRF 1 SIGNAL_1
XRF 2 SIGNAL_2

Block Insertion Layer

Block insertions that correspond to the $$add( ) in the geometry file will be inserted in DXF layer 0. Insertions generated by the comp file are inserted either into layer 1 or layer 2 depending on the layer number in the comp file entry.

Blocks

Geometry files “create” different classes of blocks, such as
$$create_board,
$$create_component
$$create_generic_part
DXF does not differentiate between various type of block definitions so all of these commands create a simple DXF block. The men2dxf program does not insert a Mentor created block unless the $$add() command has been used. However there is a command line option in men2dxf that enables you to select a block for insertion.

Components to Blocks

Because of the generic layers used in Mentor’s component definitions, men2dxf creates two DXF blocks for each component part in the geometry file - one has the data on generic layers moved to the _1 layer and the other has data on _2 layer. When the component is actually inserted on the top or bottom of the board the correct _1 or _2 version is inserted so that the data in AutoCAD appears as it would in BoardStation.

Boardstation to AutoCAD Mapping

Mentor Function DXF Entity Comment
$$add INSERT Block inserted on DXF layer 0
$$add_board_layer_block --- Not implemented yet. Creates a rectangular block for each layer. Used for artwork registration.
$$add_dimension INSERT Dimension lines, text and symbols are drawn on current defined Mentor layer ($$template_layer). Each dimension is contained in its own block using the naming convention Dn where n=1,2,3,4...4,
$$arc POLYLINE ARC
ARC
If width > 0
if width = 0
$$attribute ---- **See section on attributes
$$circle CIRCLE
POLYLINE ARC
If non-filled and width == 0
if filled or width != 0
$$create_board BLOCK There is only one create_board() definition per board design. This block is automatically inserted in the DXF file entity section.
$$create_component BLOCK These component definitions will be later referenced by the component_ascii file.
$$create_drawing BLOCK Multiple drawing definitions can exist in the same geometry file.
$$create_generic_part BLOCK ---
$$create_pin BLOCK ---
$$create_via BLOCK ---
$$layer_color --- Put into DXF layer table
$$layer_color_map LAYER Used to create color numbers in the DXF table. The specified RGB values will be mapped to one of the DXF color numbers
$$layer_line_style --- LAYER table line style in the DXF output. DXF linetype may not exactly output mentor linetype
$$page --- Units parameter is used to generate a 999 COMMENT in the DXF file
$$path POLYLINE Open polyline
$$pin INSERT There soul exist a pin definition.
$$polygon ZWC POLYLINE AutoCAD has no polygon entity so it is approximated with a zwcp
$$select_point --- Used in the translator to mark an xy position
$$template_arc --- Ignored
$$template_dimension --- Dimension defaults. Do not support the@box parameter
$$template_font --- Used in the translator to generate a font name default
$$template_layer --- Sets current layer default
$$template_line_style --- Sets current line style default
$$template_page --- Similar to $$page function
$$template_page_width --- Sets default polyline width
$$template_pointer --- Sets pointer (i.e. a dimension leader) defaults
$$template_text --- Text defaults. Ignores text box settings
$$terminal --- Pushes an XY position to stack used by functions that follow such as path.
$$text TEXT Ignores text box related information. Does not auto-mirror text drawn on the bottom layer.

Attributes

BoardStation attributes are used to convey information about geometries. They can define:
  • Component Placement outlines
  • padstack types
  • padstack clearances
  • drill holes
  • trace routining keepouts
Many attributes do not contain graphical information, so the men2dxf translator ignores them. The table below summarizes how men2dxf handles each BoardStation attribute.
Boardstation Attribute DXF Entity Comment
BOARD_PLACEMENT_KEEPOUT POLYLINE On layer BOARD_PLACEMENT_KEEPOUT
BOARD_PLACEMENT_OUTLINE POLYLINE On layer BOARD_PLACEMENT_OUTLINE
BOARD_ROUTING_OUTLINE POLYLINE On layer BOARD_ROUTING_OUTLINE
COMPONENT_DEFAULT_PADSTACK --- Marking a default PIN name. PIN name is used in the COMPONENT_PIN_DEFINITION attribute
COMPONENT_PADSTACK_OVERRIDE --- Marking a PIN name. PIN name is used in the COMPONENT_PIN_DEFINITION attribute
COMPONENT_PIN_DEFINITION INSERT Block insertion on layer 0
COMPONENT_PLACEMENT_OUTLINE POLYLINE On layer COMPONENT_PLACEMENT_OUTLINE
COMPONENT_THERMAL_OUTLINE POLYLINE On a layer COMPONENT_THERMAL_OUTLINE
DRILL_DEFINITION POLYLINE 2 polylines making a '+' symbol on the default layer
DRILL_DEFINITION_UNPLATED POLYLINE 2 polylines making a '+' symbol on the default layer
POINTER POLYLINE Draw a leader on default layer. Pointer head will be drawn by DXF POLYLINE, SOLID or CIRCLE depending on the pointer head style defined in template_pointer
ROUTING_KEEPOUT POLYLINE On layer ROUTING_KEEPOUT
VIA_KEEPOUT POLYLINE On layer VIA_KEEPOUT
PLUNGE_POINT, MILLING_PATH, MILLING_ARC POLYLINE On layer MILLING_PATH

Text Fonts from Mentor to DXF

Boardstation uses its own font files when displaying or plotting text. The MEN2DXF translator uses a resource file named “fontmap.map” that maps each Mentor font to the desired AutoCAD SHX font.

fontmap.map file can supply font mapping for many fonts, but only the first 4 fonts used in the geometry file will be mapped. All fonts used in the geometry files starting from the 5th font will be mapped to font 0.

If a given Mentor font does not have a mapped shx file defined in the fontmap.map file it is automatically mapped to the txt.shx AutoCAD font.

Fontmap.map Syntax

std             /usr/cad_util/txt.shx                   1.0
sym             /usr/cad_util/block.shx                 1.0
iges1003        /usr/cad_util/iges1003.shx              1.0

where

column 1                Mentor font name. This can be found in the
                        geometry file. Search for $$text or $$template_text
                        refer to Mentor font names.

column 2                DXF shx font name; it should provide the full
                        path to where the shx file resides

column 3                scale factor; applying a scale factor can be useful
                        if the two fonts do not match exactly in
                        size.

Location

The fontmap.map file should be located in the same directory as men2dxf.

The men2dxf log file

Each time the men2dxf program runs, it creates a log file in the current working directory named men2dxf.log. There is quite a lot of valuable information in this file and you should examine it prior to loading the resulting DXF file into AutoCAD or other program.
men2dxf v1.09 (03/07/97) KEY 807ac80d asmsc12           version and date
(C)1996-97 Artwork Conversion Software, Inc.
(831)426-6163 info@artwork.com http://www.artwork.com


Input files:                    listed are input
siemens.geo                     files you selected
siemens.com                     for translation.
siemens.tra

Output file:                    output file name
siemens.dxf                                                             

Options                         command line options
-st


High level blocks:              High level blocks are either
                                board, drawing or panel.The
                                board block is unique.

board block name = pci_kurz                                     
drawing block name(s) = 4796475_obf 4796475_oda test1
panel block name(s) = beiblatt nutzen
Block Hierarchy:          
                                       
pci_kurz                        
|
|__pmsmdb                                                 
|
|__pmsmdl                       
|
|__pass                                                         
|
|__comp.plt
|
4796475_obf
  |
  |__a2
  |    |
  |    |__ame_mat
  |    |
  |    |__ame_nil
  |    |
  |    |__ame_sol
  |    |
  |    |__acis_sync_block
  |    |
  |    |__adp_params
  |    |
  |    |__adp_sysvars
  |    |
  |    |__ad_appl_block
  |    |
  |    |__dc__blockfile
  |
  |__change_history
  |
  |__pci_connect
  |
4796475_oda

The block hierarchy shows how the various blocks are related to each other.

It is quite useful since the AutoCAD draftsman may be required to insert one or more blocks into his assembly drawing.

Translating siemens.geo

Warning: any lines that are ignored or otherwise not 
processed are listed here

Line 4: lock_windows function ignored
Line 7: point_mode function ignored
Line 88: dimension using undefined name point is ignored
Line 102: view_layers function ignored
Line 107: copy_layers function ignored
Line 23576: attribute ‘MILLING_ORIGIN’ ignored
Line 23577: attribute ‘DRILL_ORIGIN’ ignored
Line 23618: attribute ‘PLUNGE_POINT’
Line 23619: attribute ‘MILLING_PATH’
Line 23646: dimension using undefined name point is ignored
Line 23648: dimension using undefined name point is ignored
Line 23652: dimension using undefined name point is ignored

Referring to undefined ‘ame_mat’ block-an empty block is created
Referring to undefined ‘ame_nil’ block-an empty block is created

Referring to undefined‘dc__blockfile’block-an empty block is created

Translation done at Mon Mar 10 11:15:38 1997
Men2dxf ignores certain geo commands but lets you know what has been ignored and the line number.

For example on line 23652 a dimension statement had to be ignored since men2dxf could not obtain a coordinate point.

It is also possible that either the geometry or the comp file refer to data that has not been defined.

If this occurs, men2dxf reports it and creates an empty block so that AutoCAD's DXF import function will not fail.

Sending the Log File with the DXF

If you are running the men2dxf translator from your Boardstation machine and sending the file to someone else running AutoCAD or other mechanical CAD program we recommend that you include men2dxf.log file. This will aid them in assembling and using the various drawings, components and boards you have defined.

Loading the DXF File into AutoCAD

There are a couple of items to watch for when loading the DXF file produced by men2dxf into AutoCAD. These are related to AutoCAD’s handling of blocks.

AutoCAD Drawing must be Empty

The DXF file should only be loaded into a new and “empty” AutoCAD drawing. If the drawing is not empty you will see the following message in the AutoCAD command console:
Warning: not a new drawing. 
Only entities will be imported

This is a very important message but not very noticeable. However you will not get any useful data into AutoCAD since all data from Boardstation is embedded into blocks. Not only that, the error message is a bit misleading. A brand new drawing need not be “empty” if the so called prototype drawing has defined items such as layers, line types, title blocks etc...

Solution

Either modify your prototype drawing (called by default acad.dwg) so that it does not contain anything or tell AutoCAD not to use a prototype drawing when creating a new one.

What if I don’t See Anything in the Display?

It is not uncommon after running a men2dxf translation to load the DXF file into AutoCAD and see nothing at all displayed on the screen. This most commonly occurs when translating geometry files that do not contain a $$create board() statement. The reason this occurs is that a typical geom file is essentially a collection of AutoCAD blocks and the designer has not necessarily inserted those blocks into the drawing proper using the $$add() command. When AutoCAD imports such a file the block definitions are stored but nothing is inserted so nothing is displayed.

Solution

Use the block ? command to see a list of the defined blocks and insert one or more of them. The men2dxf log file is very useful since it not only gives you the exact name of high level blocks (drawings, panels and boards) but it shows in detail the hierarchy of the design - which blocks reference - making it easier for the draftsman to figure out which block should be inserted.

Example:

Step 1. Load the DXF file and see nothing? Don't panic yet!



Step 2. Type in the command: block and when prompted type: ? This will list all of the blocks in the drawing.

Step 3. AutoCAD will display a list of all block names. There may be lots of them since each dimension in geom becomes a block in DXF. Decide which one you want to insert - you may need to consult with the originator of the geom file.



Step 4. Once you've decided which block you want to view, type the command: insert and then type the block name to insert. Your block (and all those referenced by this block) will appear. Try to get the log file from th men2dxf translator. It will show you the hierarchical relationship between the various blocks.


Top - MEN2DXF Home Page