12. File operations

File operations are a group of procedures that enable the use of computer mass memory (disk devices) and peripheral devices (printer, plotter) to write or read drawings or blocks, export drawings to files in DXF format (for exchange with other CAD programs) or its printout using a printer or plotter. The procedures enable the use of all the computer's mass storage resources, including network resources, which means, in particular, extending the resources with disk devices of other computer units, e.g. connected to the network. File functions are available in the option / File / of the main menu:

12.1. Saving a drawing in file

Saving a drawing in a disk file is one of the basic functions of AlfaCAD. This function allows you to successively create a drawing in many program sessions, archive drawings, create libraries of typical or repetitive drawings, and finally create copies of drawings by saving them to various directories on various devices. This enables, among other things, the transfer of drawings between different computer stations.

All information about the drawing and editing variables are stored in the drawing disk file, allowing for multiple editing of the same drawing on one or more computer workstations.

12.1.1. Upgrading a drawing

When saving to disk, each drawing must have a name under which - in the form of a disk file - it is saved in any directory of one of the available devices. After starting AlfaCAD the disk file name of the newly created drawing is not declared. Selecting the / Save / function / File / main menu option initiates a file selection dialog window that allows you to adopt the appropriate disk device, directory and file name for the drawing being created (as in p. 12.1.2.).

When updating a drawing with a known name (file name), the disk function / Save / does not initiate the dialog box, but saves the drawing in a file with a known name and then returns to editing the drawing. When updating a drawing, the name of the saved drawing set is displayed in the top line of the screen. The name of the drawing is known if the editing of the drawing was preceded by the disk function / Open drawing / that performed the procedure of reading the drawing from the disk file, or if the name of the existing drawing set was given as a parameter when starting AlfaCAD.

After saving the drawing in file, the saved drawing takes the given file name. With subsequent updates, the program saves drawing without the need to name it again.

12.1.2. Saving the drawing as another file

The disk function / Save As / allows you to save a drawing to a disk file of any name, in any directory of one of the available devices, regardless of whether the name of the drawing file was previously defined or not. Generally, the function is used to make a copy of a drawing in a file with a name different from the previously defined drawing file name (this also applies to directories and disk devices).

After saving the drawing to disk, the saved drawing takes the new given file name. With subsequent updates, the program saves drawing without the need to re-name it.

12.1.3. Editing the nameplate (title block)

Each drawing is described with the title block (nameplate) containing the information necessary to identify a given drawing in a disk directory. The name of a drawing set usually does not allow for its full identification, especially in the case of large projects. The drawing nameplate can be used in future software applications that generate e.g. a drawing list, a list of components etc.

The title block consists of 16 fields with any 16-character name. Each field can contain a string up to 255 characters long. The field names can be defined by the user. It is recommended to enter the names of the fields which have their equivalents in the drawing title block placed on technical drawings, e.g .:

In the newly created drawing, the names of the nameplate fields and their original values are initialized based on prototype drawing. If the prototype drawing does not exist or is ignored, the field names and values are initialized from the ALFACAD.INI configuration file. In this set, in the group of parameters [NAMEPLATE], the prototype of the table can be saved in the form of lines:

field_name = field_value e.g .:

[PLATE]

Project unit: Now Moon Ltd

Investment (1): Fra Mauro Moonbase

Investment (2): Landing platform

Object (1): 6 KV photovoltaic power station

Object (2): Project number: M-1-2024

Drawing number: 5-10

Figure (1): Main power diagram

.... etc.

The menu / File / contains the option / Title block edit / the selection of which allows you to edit the values of the table fields or change the names of the fields.

A dialog box containing a list of parameters for each field of the nameplate is initiated. The indicated row of the nameplate is copied to the edit lines - " Parameter name " and " Parameter value " respectively. Clicking with cursor on one of these lines initiates the editing of the name or value in the manner generally accepted in AlfaCAD.

All parameters lines can be changed multiple times in any order.

The program allows you to read its nameplate from another drawing and adopt its contents to the current drawing . To do this, press the "Import" button and select the appropriate file in the same way as in the / File // Open drawing / function and then the " OK " button . The nameplate taken from another drawing will replace the current one. It can be re-edited as described above.

Selecting the " OK " field ends the nameplate edition along with accepting the changes made. In order to discontinue the introduced changes and restore the previous content of the nameplate, press the " Esc " button.

12.2. Reading a drawing from file

The file function / Open drawing / allows you to read a drawing from a disk file from any directory of one of the available disks or network devices.

If a non-existing file name is given in open file dialog window, a new drawing with the given name will be initiated based on default prototype file, but it's name will be already determined, so in file function / Save / it will be saved in the file of a given name.

The user may specify a file name with an extension, although it is not recommended. The program assign the standard ".ALF" drawing file name extension.

12.3. Entry and Return. Advanced functions for accessing drawings


In order to get quick access to the created drawings (especially drawings such as electrical diagrams), you can use the text of the "File name" type.

If we place a text of the "File name" type, representing the file name of the next drawing (diagram), then after updating the current drawing and executing the function / File // Tree // Enter / and selecting the text containing the file name, the current file will be closed and the linked one will be opening. The procedure is not finished, and the program is waiting for the next file name text indication (to open another linked file) or pressing {ESC} or {LMB}.
The
/ File // Tree // Return / function allows you to return to a drawing at a higher hierarchy level, up to the original drawing. The program remembers back to the last 500 drawing files.
If we execute the function
/ File // Tree / once, also newly created drawings in a given session are added to the hierarchical tree, which allows you to return to previously edited drawings without specifying or indicating the name of the file. This is particularly important when performing many drawings simultaneously, e.g. control schematic diagrams, without the necessity to open many drawing windows at the same time.

If the function / Enter / or / Return / is selected and current drawing was edited but was not saved, the appropriate message is visible and program is waiting to confirm saving or ignoring, or {RMB} or {Esc} to abandon the function.

12.4. Save a drawing in DXF format


AlfaCAD can co-operate with other CAD programs. “DXF” format is a commonly used drawing format (DXF is a trademark of AutoDesk Inc.) to exchange drawings between different CAD applications. To re-edit a drawing created in AlfaCAD using a another CAD program, you need to export drawing into the file using the function : / File // Export // DXF /.

DXF format is a text representation of the full graphic form of a drawing. AlfaCAD saves the actual values ​​in the DXF file with an accuracy of 6 decimal places.

Before starting the save, the program asks for the name of the DXF file, proposing a name consistent with the name of the source (current) drawing but with the .DXF extension.

Drawing layer names are assigned according to the source drawing layer names, with some restrictions:

(these reservations are necessary due to the requirements of some graphics programs, especially AutoCAD).

AlfaCAD defines the line types in the DXF file that correspond to the line types available in AlfaCAD. Line weights are fixed for each primitive according to the values stored in the [LINES-DXF] group in the ALFACAD.INI configuration file.

The color numbers correspond to the DXF standard.

The size of the drawing sheet is represented by the variables $ LIMMIN and $ LIMMAX, which, however, does not necessarily limit the working area of the drawing in various graphics programs.

Objects that do not have their representation in DXF format are replaced with blocks composed of other objects that give the same graphic effect (eg ellipse, elliptical surface).

Blocks

Many professional graphics programs (eg AutoCAD) allow you to build complex block structures. Blocks can consist not only of graphic primitives but also of other blocks, and the blocks can be rotated at any angle, scaled, inserted once or multiple times, or creating a circular or rectangular pattern. Any complex block structure can be represented in DXF format.

AlfaCAD also allows you to create blocks of virtually any complexity, but their structure differs from that of the blocks represented in DXF format. These differences result from the rules generally accepted in the AlfaCAD program for creating multi-level block structures and the editing functions that allow for easy editing of complex blocks. Therefore, when saving a drawing in DXF format, the block structure is fully preserved (also multi-level), except that each block appears as a single, unique block, similar to AlfaCAD.

Block names in DXF format take the names consistent with the original names with the restrictions:

(these reservations are necessary due to the requirements of some graphics programs, especially AutoCAD).

12.5. Reading files in DXF format

The program can read drawings saved in DXF format compatible with AutoCAD: r.9 or newer, and in DWG format from AutoCAD R14 to the v2015.

The program automatically recognizes the DXF and DWG version in the drawing.

12.5.1. DXF conversion setup

After calling the function / File // Import // DXF / or / File // Import // DWG / and indicating (entering) the name of a file in DXF or DWG format, the drawing conversion parameters dialog box is initiated. The dialog box is always opened when a drawing in DXF format is loaded, and in case of drawing in DWG format is loaded, when its conversion to temporary DXF format was successful.

The dialog box contains the following information:

If the DXF file was created with AutoCAD, the units should match the drawing units interpretation in ACAD.

If the file was created in AlfaCAD, set [mm] as the units.

If the DXF file comes from ACAD, the conversion scale should match the expected drawing scale.

For files created with AlfaCAD programs, use a scale of 1: 1.

12.5.2. Drawing format. Prototype drawing.

There is no information about the drawing sheet format in the DXF file. Hence, the prototype drawing PROTOTYPE.AXF is initiated , in which objects read from the DXF set are inserted, while the point <0.0> of the DXF drawing is shifted to the point <0.0> of the global AlfaCAD coordinate system. For this purpose, the program uses the EXTMIN values saved in the DXF file.

EXTMIN (X, Y) values are correctly defined in the DXF file if (after various editing operations), before saving the DXF file, the ZOOM / EXTENDS (ZOOM / Range) function will be performed as a result of which the EXTMIN (X, Y) values will be updated and EXTMAX (X, Y) .

The prototype drawing PROTOTYPE.AXF can be freely modified (similarly to the standard prototype drawing PROTOTYPE.ALF).

After reading the DXF file, the current drawing has no default name, it should be given the first time the drawing is saved to disk.

12.5.3. Converting line types

The program automatically recognizes the following line types:


- ACAD:


- AlfaCAD

The program also recognizes line types whose pattern names contain one of the type identifiers:

- quasi - ACAD:


Unrecognized lines are interpreted as solid lines.

12.5.4. Converting font patterns

The program converts font patterns according to the list of equivalents included in the ALFACAD.INI configuration file in the [Fonts-DXF] group

An example of the group of variables (standard values) is presented below.

The name of the variable is the name of the DXF font, the variable values are:

AlfaCAD font name, width factor.

[Fonts-DXF]
POLTECH = POLTECH, 1.428571429;
POLTECH1 = POLTECH1, 0.588235294;
ROMAN = ROMAN, 1;
BLOCK = BLOCK, 1;
FUTURA = FUTURA, 1;
SYSTEM = SYSTEM, 1;
SYSTEM1 = SYSTEM1, 1;
COMPLEX8 = ROMANC, 1;
COMPLEX = ROMANC, 1;
CYRILLIC = ROMANC, 1;
CYRILTLC = ROMANC, 1;
GOTHICE8 = ROMANC, 1;
GOTHICG8 = ROMANC, 1;
GOTHICI8 = ROMANC, 1;
GOTHICE = ROMANC, 1;
GOTHICG = ROMANC, 1;
GOTHICI = ROMANC, 1;
GREEKC = ROMANC, 1;
GREEKS = ROMANC, 1;
ISO8 = ROMANS, 1;
ITALIC8 = ITALICC, 1;
ITALICC8 = ITALICC, 1;
ITALICT8 = ITALICT, 1;
MONOTXT8 = ITALICT, 1;
ISO = ROMANS, 1;
ITALIC = ITALIC, 1;
ITALICC = ITALICC, 1;
ITALICT = ITALICT, 1;
MONOTXT = SYSTEM, 1;
ROMANC8 = ROMANC, 1;
ROMAND8 = ROMAND, 1;
ROMANS8 = ROMANS, 1;
ROMANT8 = ROMANT, 1;
SCRIPTC8 = SCRIPTC, 1;
SCRIPTS8 = SCRIPTS, 1;
SIMPLEX8 = SYSTEM, 1;
ROMANC = ROMANC, 1;
ROMAND = ROMAND, 1;
ROMANCE = ROMANCE, 1;
ROMANT = ROMANT, 1;
SCRIPTC = SCRIPTC, 1;
SCRIPTS = SCRIPTS, 1;
SIMPLEX = SYSTEM, 1;
SYASTRO = ROMANS, 1;
SYMAP = ROMANS, 1;
SYMATH = ROMANS, 1;
SYMETEO = ROMANS, 1;
SYMUSIC = ROMANS, 1;
TXT8 = SYSTEM, 1;
TXT = SYSTEM, 1;
DUPLEX = ROMAND, 1;
STANDARD = SYSTEM, 1;
CIBT ____ = POLTECH, 1;
COBT ____ = POLTECH, 1;
EUR _____ = ROMANC, 1;
EURO ____ = ITALICC, 1;
PAR _____ = ROMANC, 1;
ROM _____ = ROMAND, 1;
ROMB ____ = ROMAND, 1;
ROMI ____ = ITALICC, 1;
SAS _____ = FUTURA, 1;
SASB ____ = FUTURA, 1;
SASBO ___ = FUTURA, 1;
SASO ____ = FUTURA, 1;
SUF _____ = ROMANC, 1;
TE ______ = FUTURA, 1;
TEB _____ = FUTURA, 1;
TEL _____ = FUTURA, 1;
CIBT ____ = POLTECH, 1;
COBT ____ = POLTECH, 1;
EUR _____ = ROMANC, 1;
EURO ____ = ITALICC, 1;
PAR _____ = ROMANC, 1;
ROM _____ = ROMAND, 1;
ROMB ____ = ROMAND, 1;
ROMI ____ = ITALICC, 1;
SAS _____ = FUTURA, 1;
SASB ____ = FUTURA, 1;
SASBO ___ = FUTURA, 1;
SASO ____ = FUTURA, 1;
SUF _____ = ROMANC, 1;
TE ______ = FUTURA, 1;
TEB _____ = FUTURA, 1;
TEL _____ = FUTURA, 1;


Unrecognized fonts are converted to POLTECH.

12.5.5. Diacritics

The standard of Polish diacritical marks in the DXF file (when reading and writing) is defined by the " Diacritics DXF " variable from the [Directory] group of the ALFACAD.INI configuration file:

Diacritics DXF= 2; 0- Other, 1-Latin2, 2-Acad14 for Windows

12.5.6. Colors conversion

All 255 colors of the ACAD palette are transformed into the 255 AlfaCAD color palette.

The program includes " BYLAYER " and " BYBLOCK " color declarations for graphic primitives and block elements.

12.5.7. Layers

The program preserves the names and attributes (visibility and freeze flags) of all 255 layers, while layer 255 is always invisible and is used to store standard library blocks.

12.5.8. Blocks and attributes

The program maintains the block structure of the drawing, keeping the names of the library blocks as well.

The names of original (original) blocks have a space added at the beginning of the name (these blocks are stored on invisible layer 255).

Child blocks (copies of originals placed on overlay layers) have a period appended to the beginning of their name.

The program takes into account text attributes placed in blocks (text variables) and updates them on subsequent insertions.

AlfaCAD works with multi-level (compound) blocks without limitation of the number of levels.

12.6. Memory usage

Information about the amount of available RAM, usage of memory by the current drawing and other information can be obtained by selecting the option / Info / function menu / File / .

The program displays the following information:

Approaching the value of "Drawing data size" to the value of "memory Size for the drawing" indicates that the program resources are exhausted and therefore there may be limitations on the size of the drawing. If the memory is full, the program communicates about the memory limit, ignoring any attempts to introduce new objects. Limiting RAM for a drawing is important when working with multiple drawings open in multiple AlfaCAD windows simultaneously. When working with a single drawing, this value can be set freely.

The program can use up to 2 GB of RAM.