Customizing


SI Mechanical can be customized in the same manner as AutoCAD (see the AutoCAD Customization Manual). Programmers can refer to the Application Program Interface (API) section. For non-programmers, SI Mechanical libraries and database tables can be customized to suit your requirements.

Database Tables

The SI Mechanical database tables can be modified. See the DBEDIT command in this manual on how to modify database tables. If changes that you make to a table cause errors in SI Mechanical, you can erase the modified table and SI Mechanical will use the original table from the library file. The modified tables are normally placed in the dp_lib subirectory. The default path is c:\si-m514\dp_lib but the actual path is specified during installation of SI Mechanical.

Command Table

You can add new AutoLISP commands to SI Mechanical. The new commands can be made to load automatically by putting them in the dp_lib directory and entering the command name in the COMMAND table. Each command can have a single command alias. The COMMAND table lists all commands used by SI Mechanical. The following table describes the fields in the COMMAND table:
COMMAND table
FieldDescription
ALIASAlias name
COMMANDCommand name
FILEName of file if different than command name
MODEOperational mode of command
The COMMAND field contains the name of the function, not the file name. If the function name is C:ABC, the COMMAND field must be set to "ABC".

The FILE field can be set to nil if the command name and file name are the same. If the command name and file name are not the same, the FILE field must contain the file name. Using the above example with a function name of C:ABC, and a file name of abc.lsp, the FILE field can be set to nil or "ABC". However, if the function name is C:ABC and the file name is xxx.lsp, the FILE field must be set to "XXX".

You can have multiple commands in one file. In the above example, the file xxx.lsp could contain the C:ABC the C:XYZ commands. For C:ABC, the COMMAND field must be set to "ABC" and the FILE field set to "XXX". For C:XYZ, the COMMAND field must be set to "XYZ" and the FILE field set to "XXX". SI Mechanical will load the file only once when any command that references it is executed.

The following table shows the various MODE field settings:
MODE field settings
MODEDescription
0Disable the command
1Normal command loading and execution
2Set tilemode off on execution
3Switch to pspace on execution
4Switch to mspace on execution
5Combine modes 2 and 3
The modes can be used to control where certain entities are placed. You can make SI Mechanical place dimensions in paper space only by setting the MODE field for the DIM and DIM1 commands to 5. Likewise, you can set the MODE field to 4 to insure that dimensions are placed only in model space. A negative mode will undefine an AutoCAD command of the same name.

DPVAR Variable Table

The DPVAR table contains all of the drawing variables unique to SI Mechanical. You can add new records to the DPVAR table and use the API to access them. The table has three fields:
DPVAR table
FieldDescription
CONTROLDetermines restrictions on value
DPVARVariable name
VALUEValue of variable
The following table shows the various CONTROL field settings:
DPVAR CONTROL field settings
CONTROLDescription
0No control
1Integer value of 0 or 1 only
2Any non-zero number only
3Positive number only
4Negative number only
5Combine controls 2 and 3
6A string without spaces including ""
7A string including spaces or ""
99Special restrictions for value
100Any value allowed (read only)
The control value 99 cannot be used with user defined records. The control value 100 can be used to lock in certain variables thereby restricting users to the specified settings. For instance, you could set the DBWRITE variable to 0 and and give it a control value of 100 to prevent changes to the database with the DBEDIT command.

Format Table

The FORMAT table contains data for the standard formats that are included with SI Mechanical. You can add new formats to the FORMAT table and use the SETUP command to access them (see Format Library). The format table has the following fields:
FORMAT table
FieldDescription
BORDERName of border block used by format
PLST_BLKName of part list block used by format
PLST_DXDelta X for subsequent part list column insertions
PLST_DYDelta Y for subsequent part list block insertions
PLST_XX coordinate of insert point for first part list block
PLST_YY coordinate of insert point for first part list block
PLST0BLKName of initial part list block used by format
REV_BLKName of revision block used by format
REV_DXDelta X for subsequent revision column insertions
REV_DYDelta Y for subsequent revision block insertions
REV_XX coordinate of insert point for first revision block
REV_YY coordinate of insert point for first revision block
REV0BLKName of initial revision block used by format
SIZESize or name of format
SUPPL1Name of primary supplement block used by format
SUPPL1_XX coordinate of insert point for primary supplement block
SUPPL1_YY coordinate of insert point for primary supplement block
SUPPL2Name of secondary supplement block used by format
SUPPL2_XX coordinate of insert point for secondary supplement block
SUPPL2_YY coordinate of insert point for secondary supplement block
TTLBLKName of title block used by format
TTLBLK_XX coordinate of insert point for title block
TTLBLK_YY coordinate of insert point for title block
UNITType of units for dimensions
X_LIMUpper X coordinate of format
Y_LIMUpper Y coordinate of format

Hardware Tables

The HARDWARE command uses two types of tables to control creation and editing of hardware items. The main HARDWARE table contains a list of types and descriptions for all available hardware items. The rest of the tables contain data for the individual hardware types. The main HARDWARE table has the following fields:
Hardware group tables
FieldDescription
CATCategories associated with this type
DBXDatabase table used by this type
DESCPDescription of hardware. Used by LABEL command and dialogue box
LSPLisp file used by this type. Shaft based hardware always uses "SFTHDW"
SLDSlide for this type
SFTOptional shaft file for this type. Used by shaft based hardware
STDStandards associated with this type
TYPEHardware type code
A simple use for hardware tables would be to add company standards to the STD field. Deleting records from the HARDWARE table will prevent the use of that hardware type.

Hardware descriptions can be modified by changing the DESCP field value to include your own description. The graphic image of the hardware in the dialogue box can be changed by creating a new slide with the name indicated by the SLD field and storing it in the dp_lib directory.

Experienced programmers can add their own hardware types by creating the appropriate lisp file and database table. In order for SI Mechanical to recognize a particular type of hardware, it must be present in the HARDWARE table.

Hardware Type Tables

Each type of hardware has its own database table that contains the various sizes and dimensions for that particular type. Several common fields are of particular interest.
Hardware table fields
FieldDescription
DESCPDescription of item to display in the hardware dialogue box instead of SIZE. Also used by LABEL command
LENGTHFixed length for item
LG_LISTTable of lengths to display in the hardware dialogue box for selection
MAX_LGMaximum length to display in the hardware dialogue box for selection
MIN_LGMinimum length to display in the hardware dialogue box for selection
NOM_SIZENominal size of item. Used when searching for matching size. Real or integer
SIZESize of item to display in the hardware dialogue box
UNITUnits of dimensions of item. Used to set scale of item during insertion
VAR_LGVariable length for item. The user can supply a length during insertion
The LENGTH field is used to set an item to one specific length. For instance, particular bolt with a specific part number would have a fixed length. The MAX_LG and MIN_LG fields can be used to restrict selection in the hardware dialogue box to only a certain range of lengths. VAR_LG must be used when LG_LIST, MAX_LG, or MIN_LG are needed.

Hardware Length Tables

The hardware dialogue box displays a list of available lengths when the current hardware type has a VAR_LG field. If a hardware type table also has a LG_LIST field with a length table name, the list of default lengths can be specified in that length table. A length table has only one field with a record for each available length.
Hardware length table fields
FieldDescription
LENGTHLength value

Hardware Translation Table

The HDWTRANS table is a conversion list that SI Mechanical checks when it encounters an unknown hardware type. When a hardware item is selected and the type is not present in any of the hardware groups, SI Mechanical checks the HDWTRANS table for the non-standard type. If the non-standard type is found in the HDWTRANS table, the corresponding standard type is substituted.
HDWTRANS table
FieldDescription
NON_STDName of non-standard hardware type
STDName of standard SI Mechanical hardware type
Each record in the HDWTRANS table must contain a unique value in the NON_STD field. Different records can have the same value in the STD field.

Hole Tables

The HOLE command uses a master table called HOLETYPE that lists all available hole types. The HOLETYPE table has the following fields:
HOLETYPE table
FieldDescription
DESCPDescription of hole. Used by LABEL command and dialogue box
TYPEHole type code and database table name
Each type of hole has its own table that contains the various sizes and dimensions of that particular type. Hole tables have the following fields:
Hole data table
FieldDescription
CBORE_DIACounterbore diameter
CBORE_DPCounterbore depth
CL_DIAClearance diameter for clearance holes
CSK_DIACountersink diameter
CSK_ANGCountersink angle
DIAActual diameter
NOM_DIANominal diameter of this size
SIZEHole size name
TAP_ANGAngle for taper threads
TAP_DIATap drill diameter for tapped holes
TAP_DPFixed depth of tap
UNITUnits used by this record
PITCHPitch of threads
The value of any field can be changed to suit individual requirements. The table does not have to contain all fields or have values in all fields.

Layer Definition Table

The layer definition table specifies layer names, colors, linetypes, and modes. You can change the definition table or create a new one and set a drawing to use the new definition table with the LYRDEF DPVAR variable. The layer definition table has the following fields:
LYRDEF table
FieldDescription
COLORLayer color
DESCPLayer description
LAYERLayer name
LINETYPELayer linetype
MODELayer visibility
The value of any field can be changed to suit individual requirements.
LYRDEF MODE settings
MODEDescription
0Standard layer
1Viewport dependent visibility when TILEMODE is 0

Layer Map Table

The layer map table specifies layer names used by different parts of SI Mechanical. You can change the layer map table or create a new one and set a drawing to use the new layer map with the LYRMAP DPVAR variable. The layer map table has the following fields:
LYRMAP table
FieldDescription
DESCPDescription of layer reference
LAYERlayer name to use with reference
REF_NOUsed by program to reference layer
The REF_NO field should normally not be changed as it is used by internal SI Mechanical functions and programs. An exception would be if you want to disable automatic layer changes for a certain command. Changing the REF_NO to an unused value or deleting the record will disable it. If you just want to leave items on the current AutoCAD layer, a better method is to use "CLAYER" in the LAYER name field.

The value of a LAYER field can be changed to associate a command with a new layer name. Each LAYER in the LYRMAP table must appear in the layer definition table. "CLAYER" can be used to indicate the current layer but does not have to appear in the layer definition table.

Scale Tables

Each drafting standard has a list of available drawing scales. The name of the table that defines the list of scales for each standard is specified in the STANDARD table.
Scale tables
FieldDescription
DESCPText in SETUP dialogue box
FMT_STRScale string that appears in title block
SCALEReal number for scale

Size tables

The size table specifies the size of various annotation for a specific standard. You can change the values in the size table to make SI Mechanical use different sizes for dimensions and text. The name of the size table for each standard is specified in the STANDARD table. The size tables have the following fields:
Size table
FieldDescription
DESCPSize description
SIZEPrimary size
SIZE-XSecondary size for larger sheets
UNITUnits for size
TYPEType integer used by SI Mechanical
The TYPE fields should not be changed or deleted. SI Mechanical needs them to access the correct size.

Standard Table

The STANDARD table specifies the drafting standards available to SI Mechanical. The standard can be set by the SETUP command and is stored in the STANDARD DPVAR variable. Additional standards can be added to the table.
STANDARD table
FieldDescription
STANDARDName of standard; "ASME", "DIN", "ISO", "JIS", etc.
DATEDate string; "MO/DD/YY"
DETMODEMode for details. Used by DETAIL command
0 = ISO type details
1 = ASME variation for details
2 = DIN variation for details
FMTPREPrefix for formats, STD is standard
GEOMODEMode for geometric tolerancing. Used by GEODIM command
0 = ISO type symbols
1 = ISO type symbols with aligned composite frames
2 = ANSI variation
3 = ANSI variation with aligned composite frames
SCALETBLTable name of drawing scales
SECTMODEMode for sections. Used by AUX2D command
0 = ISO type sections
1 = ASME variation for sections
2 = JIS variation for sections
SH_UNITUnits for drawing sheets, "IN", "MM", or "IN;MM"
SIZETBLTable name of annotation sizes
SURFMODEMode for surface finish symbols. Used by SURFDIM command
0 = ISO type symbols
1 = ASME variation for symbols
THDMODEMode for schematic thread representation.
0 = ISO type threads
1 = ASME variation for threads
TIMETime string; "H:M:SS AM/PM"
VIEWTBLTable name of view orientations
WELDMODEMode for welding symbols. Used by WELDIM command
0 = ISO type symbols
1 = ASME variation for symbols
2 = JIS variation for symbols
The DETMODE, GEOMODE, SECTMODE, SURFMODE, THDMODE, and WELDMODE fields are normally set to 0 for international standards, with other options for special cases.

Tag Translation Table

The TAGTRANS table is a conversion list that SI Mechanical checks when it reads and sets attribute tags in a block.

When reading a tag in a block, and the standard tag is not present in the block, SI Mechanical checks the TAGTRANS table for occurrences of the standard tag. Each occurrence is checked to see if the corresponding non-standard tag is present in the block. If a non-standard tag is present, SI Mechanical uses the value of the non-standard tag.

When setting a tag in a block, and the non-standard tag is not present in the block, SI Mechanical checks the TAGTRANS table for the non-standard tag. If a corresponding standard tag is found in the TAGTRANS table and is present in the block, SI Mechanical will set the standard tag to the specified value.

TAGTRANS table
FieldDescription
NON_STDName of non-standard tag
STDName of standard SI Mechanical tag
Each record in the TAGTRANS table must contain a unique value in the NON_STD field. Different records can have the same value in the STD field.

View Tables

Each drafting standard references a view table. The view table determines orientation of the various views used by the AUX2D, HARDWARE, HOLE, MULTI2D, and SHAFT commands. The name of the table that defines the list of views for each standard is specified in the STANDARD table. Two tables are included with SI Mechanical. One table is for 1st angle projection, the other is for 3rd angle projection.
View tables
FieldDescription
DESCPDescription of view
TILTForward tilt angle of item
VIEWView code integer
X_ROTX-axis rotation angle of item
Y_ROTY-axis rotation angle of item
Z_ROTZ-axis rotation angle of item
The values in the DESCP field are displayed in the view orientation dialogue box. When an item is created by direct generation, the orientation data in the view table is ignored.

Format Library

Standard formats, including ASME, DIN, ISO, and JIS are included with SI Mechanical. Many companies have their own formats that they use. SI Mechanical can access these formats with the SETUP command. There are several ways to approach the task of implementing custom drawing formats.

Format Naming

The formats used by SI Mechanical must follow the correct naming conventions. The format names are in the FORMAT database table. The names consist of eight characters. The first three characters are the format group. The formats that are included with SI Mechanical begin with "ASM", "DIN", "ISO", or "JIS". The 3 characters used by a standard are specified by the FMTPRE field in the STANDARD table. The fourth character specifies the format length and only applies to roll type formats. Otherwise it is "0". The fifth character specifies whether it is a vertical or book type format, "V" or "B". Otherwise it is "0". The sixth character is either "0" or "C" and designates a continuation sheet. The seventh and eighth characters specify the format size. An ISO A3 size format would use "A3" while an ASME D-size would use "0D". The complete name of a standard A3 size format would be "ASM000A3".

Besides the standard formats, you can specify an alternate set of formats to use with any standard. The ALTFMT DPVAR variable specifies the three characters to use for the alternate formats. You can set the variable to your own code. To access the alternate formats with the SETUP dialogue box, you would pick the Alternate button in the Format group.

Modify SI Mechanical Formats

The standard formats are composed of one or more blocks. The blocks that are used to compose a format include the border, title block, and supplementary blocks. If you only need to make small changes to a format such as adding your company logo to a title block, you might want to modify the standard title blocks. You must run SETUP and then use the WBLOCK on the portion of the format that you want to change. You can also WBLOCK the entire format and use a modified version of it. The new files must be saved in the dp_lib directory. You can then make the changes to the new copy.

Modify a Standard Format

In most cases, only the title block needs to be modified to meet individual or company requirements. The following example shows how to modify a ISO A3 size format:
  1. Setup a drawing to ISO standard and A3 size.
  2. Run the SETUP command again and pick the Add/Edit... button under the size group. The name of the title block for this format is specified by the TTLBLK field. In this case it is ISO-T-A0.
  3. Use the WBLOCK command to write out a copy of the title block. Use c:\si-m514\dp_lib\iso-t-a0.dwg as the name of the block to write. Use ISO-T-A0 as the block to use. This creates a copy of the title block in the dp_lib directory.
  4. Open the file c:\si-m514\dp_lib\iso-t-a0.dwg. Use the DDEDIT command and pick the attribute that says COMPANY in the title block. Change the default to your company name. Make any other changes that you require. Save the drawing.
  5. Start a new drawing and run the SETUP command. Choose the ISO A3 size format. Your changes should show up in the title block.
SI Mechanical always looks in the dp_lib directory first when it needs a block. If it can find one there, it uses it, otherwise it attempts to retrieve it from the si-mech.lib file. If you delete the title block that you just created, SI Mechanical will use the standard title block.

You can modify other title blocks using this same procedure. The block names will be different. You can also modify the title block supplements, parts lists, and revision blocks.

Add a New Format

The amount of effort required to add a new format will depend on how closely the format matches the standard formats. A format that has the same dimensions, and part list and revision block locations will be easy to add. Some of the attributes in the format are used by SI Mechanical, so try to use them in the new format. To make a new format that uses a different title block:
  1. Create a new title block, or WBLOCK an existing title block and modify it. The base point should be set to the lower right corner. It should contain text, attributes, and line work.
  2. Save the drawing in dp_lib with a unique drawing name.
  3. To create an alternate format, you must add to the FORMAT table. Use the DPVAR command to set DBWRITE to 2. This enables database writes.
  4. Use the DBEDIT command to edit the FORMAT table.
  5. Pick a record that has a SIZE field most closely matching the new format.
  6. Change the value of the SIZE field to the new format name. The first three letters should be "ALT".
  7. Change the TTLBLK field to match the name of the new title block.
  8. Check the Alternate format box when you use the SETUP command.
SI Mechanical can also use complete formats that are not composed of multiple blocks.
  1. Create the new drawing format and set the base point to the lower left corner.
  2. Save the drawing in dp_lib with a unique drawing name.
  3. Add a new record to the FORMAT table as explained in the previous example.
  4. Change the BORDER field to the new format name.
  5. Set the TTLBLK and SUPPL fields to nil.
  6. Change any other fields as needed.
If you intend to use different parts list or revision blocks, you must draw these and store them in dp_lib. The attributes should match the parts list revision blocks that come with SI Mechanical. Optionally, you can includes the attribute tags in the TAGTRANS table. If the format has different dimensions you will have to add it to the FORMAT table. The dimensions that you use will be for a format scale of one to one. SI Mechanical will handle all scaling for you during drawing setup.

By changing the FORMAT DPVAR variable, you can change your default format. Changing the variable in the drawing has no affect on new drawings. You must use the DBEDIT command to edit the DPVAR table and change the DPVAR FORMAT variable to have a VALUE that specifies the format name. If you use a code other than "ALT", you must also change the ALTFMT DPVAR variable to match the new code. Another method is to create a prototype drawing that has the variables already set to the correct value, and use this as your default prototype drawing.

Parts List

The parts list is controlled by several fields in the FORMAT table. The PLST0BLK field is the name of an optional block used at the start of a parts list. The PLST_BLK field is the name of the block that is used to compose a parts list. They are inserted by the APTLST and PTLST commands.

Two other pairs of fields control the location of the parts list. The PLST_X and PLST_Y fields control the the insertion point of the first part list block on the format. The base point of the parts list block will be aligned with these coordinates. The PLST_DX and PLST_DY fields are used to specify the distance to the next part list block. If the parts list block is 12.0 units high, and builds upward, PLST_DY should be set to 12.0 units. If the parts list builds downward, PLST_DY should be set to -12.0 units.

Revision Block

The revision blocks are controlled by several fields in the FORMAT table. The REV0BLK field is the name of an optional block used at the start of a revision list. The REV_BLK field is the name of the block that is used to compose a revision list. It is inserted by the REVS command.

Two other pairs of fields control the location of the revision blocks. The REV_X and REV_Y fields control the the insertion point of the first revision block on the format. The base point of the revision block will be aligned with these coordinates. The REV_DX and REV_DY fields are used to specify the distance to the next revision block. If the revision block is 7.0 units high, and builds upward, REV_DY should be set to 7.0 units. If the revision blocks build downward, REV_DY should be set to -7.0 units.