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
| Field | Description |
| ALIAS | Alias name |
| COMMAND | Command name |
| FILE | Name of file if different than command name |
| MODE | Operational 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
| MODE | Description |
|
| 0 | Disable the command |
| 1 | Normal command loading and execution |
| 2 | Set tilemode off on execution |
| 3 | Switch to pspace on execution |
| 4 | Switch to mspace on execution |
| 5 | Combine 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
| Field | Description |
|
| CONTROL | Determines restrictions on value |
| DPVAR | Variable name |
| VALUE | Value of variable |
The following table shows the various CONTROL field settings:
DPVAR CONTROL field settings
| CONTROL | Description |
|
| 0 | No control |
| 1 | Integer value of 0 or 1 only |
| 2 | Any non-zero number only |
| 3 | Positive number only |
| 4 | Negative number only |
| 5 | Combine controls 2 and 3 |
| 6 | A string without spaces including "" |
| 7 | A string including spaces or "" |
| 99 | Special restrictions for value |
| 100 | Any 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
| Field | Description |
|
| BORDER | Name of border block used by format |
| PLST_BLK | Name of part list block used by format |
| PLST_DX | Delta X for subsequent part list column insertions |
| PLST_DY | Delta Y for subsequent part list block insertions |
| PLST_X | X coordinate of insert point for first part list block |
| PLST_Y | Y coordinate of insert point for first part list block |
| PLST0BLK | Name of initial part list block used by format |
| REV_BLK | Name of revision block used by format |
| REV_DX | Delta X for subsequent revision column insertions |
| REV_DY | Delta Y for subsequent revision block insertions |
| REV_X | X coordinate of insert point for first revision block |
| REV_Y | Y coordinate of insert point for first revision block |
| REV0BLK | Name of initial revision block used by format |
| SIZE | Size or name of format |
| SUPPL1 | Name of primary supplement block used by format |
| SUPPL1_X | X coordinate of insert point for primary supplement block |
| SUPPL1_Y | Y coordinate of insert point for primary supplement block |
| SUPPL2 | Name of secondary supplement block used by format |
| SUPPL2_X | X coordinate of insert point for secondary supplement block |
| SUPPL2_Y | Y coordinate of insert point for secondary supplement block |
| TTLBLK | Name of title block used by format |
| TTLBLK_X | X coordinate of insert point for title block |
| TTLBLK_Y | Y coordinate of insert point for title block |
| UNIT | Type of units for dimensions |
| X_LIM | Upper X coordinate of format |
| Y_LIM | Upper 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
| Field | Description |
|
| CAT | Categories associated with this type |
| DBX | Database table used by this type |
| DESCP | Description of hardware. Used by LABEL command and dialogue box |
| LSP | Lisp file used by this type. Shaft based hardware always uses "SFTHDW" |
| SLD | Slide for this type |
| SFT | Optional shaft file for this type. Used by shaft based hardware |
| STD | Standards associated with this type |
| TYPE | Hardware 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
| Field | Description |
|
| DESCP | Description of item to display in the
hardware dialogue box instead of SIZE. Also used by LABEL
command |
| LENGTH | Fixed length for item |
| LG_LIST | Table of lengths to display in the
hardware dialogue box for selection |
| MAX_LG | Maximum length to display in the hardware
dialogue box for selection |
| MIN_LG | Minimum length to display in the hardware
dialogue box for selection |
| NOM_SIZE | Nominal size of item. Used when searching
for matching size. Real or integer |
| SIZE | Size of item to display in the hardware dialogue box |
| UNIT | Units of dimensions of item. Used to set
scale of item during insertion |
| VAR_LG | Variable 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
| Field | Description |
|
| LENGTH | Length 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
| Field | Description |
|
| NON_STD | Name of non-standard hardware type |
| STD | Name 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
| Field | Description |
|
| DESCP | Description of hole. Used by LABEL command and dialogue box |
| TYPE | Hole 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
| Field | Description |
|
| CBORE_DIA | Counterbore diameter |
| CBORE_DP | Counterbore depth |
| CL_DIA | Clearance diameter for clearance holes |
| CSK_DIA | Countersink diameter |
| CSK_ANG | Countersink angle |
| DIA | Actual diameter |
| NOM_DIA | Nominal diameter of this size |
| SIZE | Hole size name |
| TAP_ANG | Angle for taper threads |
| TAP_DIA | Tap drill diameter for tapped holes |
| TAP_DP | Fixed depth of tap |
| UNIT | Units used by this record |
| PITCH | Pitch 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
| Field | Description |
|
| COLOR | Layer color |
| DESCP | Layer description |
| LAYER | Layer name |
| LINETYPE | Layer linetype |
| MODE | Layer visibility |
The value of any field can be changed to suit individual requirements.
LYRDEF MODE settings
| MODE | Description |
|
| 0 | Standard layer |
| 1 | Viewport 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
| Field | Description |
|
| DESCP | Description of layer reference |
| LAYER | layer name to use with reference |
| REF_NO | Used 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
| Field | Description |
|
| DESCP | Text in SETUP dialogue box |
| FMT_STR | Scale string that appears in title block |
| SCALE | Real 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
| Field | Description |
|
| DESCP | Size description |
| SIZE | Primary size |
| SIZE-X | Secondary size for larger sheets |
| UNIT | Units for size |
| TYPE | Type 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
| Field | Description |
|
| STANDARD | Name of standard; "ASME", "DIN", "ISO", "JIS", etc. |
| DATE | Date string; "MO/DD/YY" |
| DETMODE | Mode for details. Used by DETAIL command
0 = ISO type details
1 = ASME variation for details
2 = DIN variation for details |
| FMTPRE | Prefix for formats, STD is standard |
| GEOMODE | Mode 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 |
| SCALETBL | Table name of drawing scales |
| SECTMODE | Mode for sections. Used by AUX2D command
0 = ISO type sections
1 = ASME variation for sections
2 = JIS variation for sections |
| SH_UNIT | Units for drawing sheets, "IN", "MM", or "IN;MM" |
| SIZETBL | Table name of annotation sizes |
| SURFMODE | Mode for surface finish symbols. Used
by SURFDIM command
0 = ISO type symbols
1 = ASME variation for symbols |
| THDMODE | Mode for schematic thread representation.
0 = ISO type threads
1 = ASME variation for threads |
| TIME | Time string; "H:M:SS AM/PM" |
| VIEWTBL | Table name of view orientations |
| WELDMODE | Mode 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
| Field | Description |
|
| NON_STD | Name of non-standard tag |
| STD | Name 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
| Field | Description |
|
| DESCP | Description of view |
| TILT | Forward tilt angle of item |
| VIEW | View code integer |
| X_ROT | X-axis rotation angle of item |
| Y_ROT | Y-axis rotation angle of item |
| Z_ROT | Z-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:
- Setup a drawing to ISO standard and A3 size.
- 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.
- 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.
- 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.
- 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:
- 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.
- Save the drawing in dp_lib with a unique drawing
name.
- 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.
- Use the DBEDIT command to edit the FORMAT
table.
- Pick a record that has a SIZE field most closely matching
the new format.
- Change the value of the SIZE field to the new format name.
The first three letters should be "ALT".
- Change the TTLBLK field to match the name of the new title
block.
- 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.
- Create the new drawing format and set the base point to
the lower left corner.
- Save the drawing in dp_lib with a unique drawing
name.
- Add a new record to the FORMAT table as explained in the
previous example.
- Change the BORDER field to the new format name.
- Set the TTLBLK and SUPPL fields to nil.
- 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.