Import DXF Files

CAD programs are frequently used to create scene diagrams. Most CAD drawing programs can save drawings as DXF (Drawing eXchange Format) files. The m-smac graphics programs displays graphics files in the McHenry Software Scene (.SCE) file format. A utility has been created to convert DXF files to SCE file format so that you can view your scene graphics as an underlay of the m-smac graphics while running the m-smac program.

 

Tools ŕ Import ŕ DXF.

With the prevalence of use of CAD drawing tools for creation of scene diagrams, a utility has been added to allow you to browse existing DXF files and convert the information in the DXF files to the smac Graphics (msmacgr)/smac Animation (mGraphics) .SCE (Scene) file format

Figure 45 Tools->Import->Import DXF

As you can see there are two options. Both options will import DXF files, the ‘advanced beta version’ also imports text. You should try both versions to see which version you prefer.

 

The .SCE file created by the Import DXF file command can then be added to a graphics input file by the command

Include=filename.SCE 

which will then display the graphics each time you run either of the graphics programs.

 

This option currently only converts information from ASCII DXF files (Please note that some CAD programs have an optional binary DXF file format, this format is currently not supported. Please be sure to save ASCII DXF version 12 format.)

Future releases may utilize the DXF file directly and/or allow the conversion of all the information in the DXF file to SCE file information.

For further information on the SCENE file format, please see SCENE OPTION INPUTS section in the m-smac Graphics and Animation Manual.  For further information on the Include= command, please see the OPTION=, INCLUDE= COMMANDS section in the m-smac Graphics and Animation Manual.

 

Please note that the speed of performance of the m-smac graphics programs are somewhat dependent on the amount of graphical information they are required to process and display (note that due to zoom and pan factors, large amounts of graphics information may be processed and not displayed). We recommend keeping the scene display to be converted to m-smac graphics SCE format to a minimum amount of ‘target’ information. This can be accomplished by cloning or copying your CAD file and then stripping out any information not required for use during the iterative m-smac reconstruction process. Once you finalize your reconstruction,  you can then output the smac Graphics (msmacgr) and/or smac Animation (mGraphics) graphics in DXF or many other formats for use by your CAD program.

 

To import and convert a DXF file into m-smac SCE file format:

    Select the Tools menu

    Select the Import menu option. A sub-menu will appear with three choices.

    Select the Convert DXF to SCE menu item. The following dialog box will appear:

Convert DXF to SCE dialog box

    The Select File button in the upper right of the dialog box can be used to browse your various hard drives for DXF files. Any DXF files found for a directory will be displayed in the files area located below the drive and directory selection boxes. To view a DXF file simply select the DXF file with the mouse and the file will be imported and displayed.

The following is a discussion of the Conversion Options:

 

Swap X,Y (default) - CAD drawing programs normally create drawings with Y-axis Positive upwards and the X-axis positive to the right. The SMAC program is setup with the X-axis Positive upwards and the Y-axis positive to the right. The normal conversion between the two programs is to swap the X & Y values.

 

Reverse Sign if  X Y - To accommodate the various CAD drawing programs, this option is to allow reversing the sign of the X and/or Y coordinates on conversion. This option should only be used for specialized conversions or when the standard conversion from DXF gives a mirror image.

 

More Options – brings up the more options dialog as follows;

Figure 46 DXF Import Options Dialog

Output in VEHOB format - The normal output is in SCE (Scene) file format (an Option=SCENE card is inserted at the beginning of the converted dataset and the dataset is saved as a .SCE dataset.). This option is provided to allow conversion to VEHOB (Vehicle Object) file format (an Option=Vehob card is inserted at the beginning of the output dataset and the dataset is saved as a .VEH dataset).

 

Input/Output in units - The conversion program does a straight conversion of the input file to SCE file format. No units conversions are performed. The program assumes that the input units for your DXF file are in feet. If your DXF file is in inches, select this options and the appropriate card will be inserted in the output files to indicate that input DXF file units are inches. (You can also manually insert a Set Input Scale card in the output file to designate any units (see the m-smac Graphics and Animation Manual section on SCENE and/or VEHOB options for further information.)

 

To convert the file to a SCE or VEH file format, click on the OK button. A New Scene or Vehob File dialog box will appear. The name for the SCE or VEH file will be the same prefix as your input DXF file with a SCE or VEH file extension. Note that if another file exists with the same name, the program will prompt you to confirm that you wish to overwrite the existing file. You can then type any name for the new SCE or VEH file in the File name area. Click OK and the file will be converted and saved.

 

An information dialog box will appear on completion of the conversion to verify the new file created. medit will also ask whether you wish to add the file to the currently opened Project file. (note that it is not required that you add the file to the Project file. Adding the file only provides easy access to the file in the event you wish to edit/view the file). To display the new file as an underlay for your m-smac graphics programs, smac Graphics (msmacgr) and smac Animation (mGraphics), you will need to insert the following line in your the m-smac graphics input (SA5) and m-smac animation input (SA5) files:

 

INCLUDE=datasetname.SCE or  INCLUDE=datasetname.VEH

 

Where datasetname is the new dataset name you chose for the converted file and SCE or VEH is used depending on which type of file you created.

 

In both your smac graphics file (SG5) and your smac animation file (SA5) be sure to insert the INCLUDE command line prior to the line containing the Option=End command.

Statistics – produces a dialog with information on the DXF file as follows:

Figure 47 Statistics Dialog

DXF QUESTION: I import a DXF file, but it is located away from my desired origin. How do I move the origin?

ANSWER: Most CAD programs default to put the origin of the drawing in the Lower Left corner of the page. Once these CAD drawings are saved as DXF (be sure to save as Autodesk version 12 DXF file, otherwise some parts of the drawing may not be imported) and imported into medit as a SCE or VEH object, they are sometimes located offset from the CG. One way to change the origin is to select the drawing and move it relative to the CAD origin until the CAD and SMAC origin meet. For vehicle drawings this can be accomplished by creating a rectangle of dimensions XF, -XR, YS and moving the car to be in the box.

We have also provided a move origin option for our drawings.

    For VEHOB and SCENE drawing commands, see the VEHOB or SCENE TYPE 3, Origin CALL instructions. The basic premise of the Origin call is to move all drawings relative to the Origin Call. For example, if your CAD drawing is offset by -10' and -20', you simply put a 3 -10, -20 at the beginning of the VEH or SCE file (after the Option=SCENE or Option=VEHOB) and a 3 10 20 (to reset) prior to the 9999 card (end of file) for the VEH or SCE file. Be sure to consider the current units for the SCE or VEH file (if you set the units to inches or meters at the beginning of the VEH or SCE file, put the origin command AFTER the TYPE 0, SET SCALE FACTOR command)).

    A quick way to determine what the offset should be is to open your CAD program and put the mouse/cursor at the desired origin and read off the X & Y coordinates from the CAD program. Then use these coordinates for your Move origin command (NOTE: the X & Y are swapped from CAD to SMAC (CAD Y up (forward), X to right (lateral) (Cartesian coordinates, RH rule Z positive towards viewer), SMAC X up (forward), Y to right (lateral), (aeronautical coordinates, RH rule Z (gravity) positive towards the earth)) so if the coordinates in your CAD drawing of the origin is 10, 20 then you should insert a 3 -20, -10 command in the VEH or SCE file. Then be sure to insert a 3 20 10 at the end of the VEH of SCE file (insert prior to the 9999 line) to reset. (NOTE if you do not reset the origin then all subsequent drawings will be offset by the origin amount!)

    ADDITIONAL DISCUSSION: A experienced m-smac and AutoCAD user added the following discussion upon reading the prior recommendations: When users save the drawing as DXF from AutoCAD the origin is not taken as the UCS origin but rather at the WORLD origin. Thus the smac axis or vehicle c.g. should be located at the WORLD origin. They need to set the origin to WORLD and move the scene 0,0 to the WORLD 0,0 or the vehicle c.g. to the WORLD 0,0. These people are probably using the UCS 0,0 which is usually the current origin when they draw whatever and when they bring the drawing into MSMAC it looks like the origin has been moved to another county! Also rather then recommend that users explode and save in R12 they should just trace circles, arcs and polylines prior to saving to DXF and they will save a lot of time and hassle

DXF QUESTION: How do I import directly a CAD/DXF file as a VEH object?

ANSWER: Import an overhead drawing or picture of a vehicle saved as a BMP into your CAD program. Scale the image to fit your vehicle dimensions (use XF, XR and YS to create a box to fit the car in). Then save this overhead CAD drawing of the vehicle as a DXF file. Be sure to explode the data to create segments, also save as Autodesk ver 12 DXF file (ver 14 files saved this way import without losing parts of the drawing) Then from the medit - Tools - Import - DXF (use old version) see the More option for specifying as a vehicle object and which vehicle.

Also note you can attach any VEHOB to a vehicle with the newly added Option=SetVehobNum=x: Option to set vehob for include file. Use either Option=SetVehobNum=x, Where X is the vehicle number (1,2,3=veh1 trailer, 4=veh2 trailer, 6=opt veh 3, 7=opt veh 4 OR set Type=-X in vehob file where (-1,-2,-3,-6,-7 per above). Note that all vehicle objects will be drawn in the specified vehicle until another SetVehobNum command is encountered or a –99 card is encountered in a vehob file. Also note you can attach ANY SCE or VEH file to any vehicle through use of the SetVehobnum and (for SCE files) simply edit the SCE file by adding Option=Vehob to the beginning (instead of Option=SCENE)


SMACTHP: Monitoring Acceleration