Program Interface


The SI Mechanical Application Program Interface allows programmers access to routines that control SI Mechanical and read information from the program. API functions can be used at any time while SI Mechanical is loaded in a drawing.

Catalog of SI Mechanical Global Variables

This section contains a list of global variables used by SI Mechanical and a brief description. Since SI Mechanical sets these values, they should normally be treated as read only.

L:BLKTXT

L:BLKTXT is a list of all rows from the table specified by V:BLKTXT.

L:DPVAR

L:DPVAR is a list of all DPVAR variables and values.

L:DPVARCHGLIST

L:DPVARCHGLIST is a list of DPVAR variables and values that will be reset by the current command. It is set back to nil when the command is completed normally.

L:FMTDEF

L:FMTDEF is a list of definition data for the current drawing setup. It is stored with the format as extended data.

L:GEODEF

L:GEODEF is a list of definition data for the current SI Mechanical geometric tolerancing symbol. It is stored with the symbol as extended data.

L:HATDEF

L:HATDEF is a list of definition data for the current hatch pattern used by SI Mechanical. It is stored with the hatch pattern as extended data.

L:HDWDEF

L:HDWDEF is a list of definition data for the current hardware item. It is stored with the hardware item as extended data.

L:HOLEDEF

L:HOLEDEF is a list of definition data for the current hole item. It is stored with the hole item as extended data.

L:PASTE_SEGMENT

L:PASTE_SEGMENT is a list of shaft segment data that was copied with the shaft editor. It can be pasted over an existing shaft segment while in the shaft editor.

L:SETVAR

L:SETVAR is a list of AutoCAD system variables and values that will be reset by the dp_setvar function. It is created by the dp_getvar function.

L:SFTDEF

L:SFTDEF is a list of definition data for the current shaft item. It is stored with the shaft item as extended data.

L:STRING

L:STRING is a list of all rows from the table specified by V:STRING. The list contains language dependent strings used by SI Mechanical.

L:SURFDEF

L:SURFDEF is a list of definition data for the current SI Mechanical surface finish symbol. It is stored with the symbol as extended data.

L:WELDEF

L:WELDEF is a list of definition data for the current SI Mechanical welding symbol. It is stored with the symbol as extended data.

L:XYDIM

L:XYDIM is a list of position data for datum dimensioning. It is used by the XYDIM command.

TBL:table-name

TBL:table-name is a list containing a database table. The first element in the list is a list of field names. The remaining lists are the records.

V:0

V:0 is a real number used by the CALC command to store the last calculated value.

V:ACTSHT

V:ACTSHT is the entity name of the current active drawing format.

V:BLKTXT

V:BLKTXT is a string indicating the name of a table that SI Mechanical uses for text strings for block inserts.

V:BYBLOCK

V:BYBLOCK is a string indicating the name of the English BYBLOCK symbol translated into the current language.

V:BYLAYER

V:BYLAYER is a string indicating the name of the English BYLAYER symbol translated into the current language.

V:CMDECHO

V:CMDECHO is an integer that can be 0 or 1. It controls whether SI Mechanical will turn command echoing on or off during command execution. If it is set to nil, the current setting of CMDECHO will be used. This is a debugging tool.

V:DASHED

V:DASHED is a string indicating the linetype to use for dashed lines in items created by SI Mechanical. The value is read from the ENG_STR table.

V:DATE

V:DATE is a string indicating the date that the current drawing was opened. It is set by the dp_date function.

V:DBCOLNUM

V:DBCOLNUM is an integer indicating the current database column number.

V:DBROWNUM

V:DBROWNUM is an integer indicating the current database row number.

V:DBTABLE

V:DBTABLE is a string indicating the current database table name. It does not include any file extension.

V:DBX

V:DBX is a string indicating the path to any external SI Mechanical database files.

V:DCL_ID

V:DCL_ID is an integer indicating that the main SI Mechanical DCL file is loaded. A value greater than 0 indicates that it has been loaded in the current drawing session.

V:DPHELP

V:DPHELP is a string indicating the default DPHELP subject. It will change when any SI Mechanical command is used.

V:DPVAR

V:DPVAR is a string indicating the default DPVAR subject. It will change when the DPVAR command is used.

V:DPVAR_SYNC

V:DPVAR_SYNC is an integer indicating the status of the DPVAR variables. 0 indicates that the variables are not synchronized with the drawing. 1 indicates that the variables are synchronized. When a command is terminated abnormally, DPVAR variables might not be synchronized. They will resynchronize when the next command is completed.

V:DWG

V:DWG is a string indicating the path to any external SI Mechanical drawing files.

V:FILE

V:FILE is a file handle indicating that a file is currently open.

V:FILENAME

V:FILENAME is a string indicating a file name.

V:GEODIM

V:GEODIM is a string indicating the default GEODIM command option.

V:HDWDESCP

V:HDWDESCP is a string indicating the name for the field to use for listing and labeling hardware items. If the value is nil or the field does not exist, the SIZE field is used.

V:HIDDEN

V:HIDDEN is a string indicating the linetype to use for hidden lines in items created by SI Mechanical. The value is read from the table specified by V:STRING.

V:ITEM

V:ITEM is an integer indicating the last balloon item number inserted during the current drawing session.

V:LSP

V:LSP is a string indicating the path to any external SI Mechanical LISP files.

V:MNU

V:MNU is a string indicating the path to any external SI Mechanical partial menu files.

V:PASTE_STR

V:PASTE_STR is a string indicating the current paste string in the text editor.

V:REPLACE_STR

V:REPLACE_STR is a string indicating the current replace-with string in the text editor.

V:SAT

V:SAT is a string indicating the path to any external SI Mechanical SAT files.

V:SEARCH_STR

V:SEARCH_STR is a string indicating the current search-for string in the text editor.

V:SFT

V:SFT is a string indicating the path to any external SI Mechanical shaft files.

V:SFT_IN

V:SFT_IN is a string indicating the file name of the last shaft file imported.

V:SFT_OUT

V:SFT_OUT is a string indicating the file name of the last shaft file exported.

V:SI-MECH_DBMS

V:SI-MECH_DBMS is a string indicating the database system being used by SI Mechanical. Valid strings are "ACCESS", "DBASE3", "DBASE4", "DBTABLE", and "PARADOX". The standard version of SI Mechanical uses only "DBTABLE".

V:SLD

V:SLD is a string indicating the path to any external SI Mechanical slide files.

V:SOL-2D

V:SOL-2D is a string indicating the file name of the last solid model used for 2D view generation.

V:STRING

V:STRING is a string indicating the name of a table that SI Mechanical uses for text strings in the program.

V:TAG

V:TAG is a string indicating the default TAG command option.

V:TILELYR

V:TILELYR is a string indicating the layer used when switching between paper space and model space. It is used for compatibility with SOLVIEW and SOLDRAW.

V:TIME

V:TIME is a string indicating the time that the current drawing was opened. It is set by the dp_time function.

V:TXT

V:TXT is a string indicating the path to any external SI Mechanical text files.

Catalog of SI Mechanical Functions

This section contains a list of the LISP accessible functions in SI Mechanical and a brief description. The functions are loaded from the SI Mechanical library. SI Mechanical loads the base functions at startup and others as needed. If you intend to use any functions others than the base functions, you will have to load the appropriate file first. See dp_load.

(acos value)

This function returns the arcos of value as an angle expressed in radians.

(asin value)

This function returns the arcsin of value as an angle expressed in radians.

(tan angle)

This function returns the tangent of angle as a real, where angle is expressed in radians.

(ap_box x y z)

This function creates a solid box with its lower-left corner anchored at the origin of the UCS.

x, y, and z are the lengths of the box's sides extending along the X, Y, and Z axes, respectively. If successful, this function returns the entity name of the solid.

(ap_cylinder rx ry h)

This function creates a cylinder with the center of one end at the origin of the UCS. The cylinder is positioned so that its central axis (height) coincides with the positive Z axis.

rx and ry are the radii along the X and Y axes. Entering the same value for rx and ry creates a circular cylinder, while entering different values results in an elliptical cylinder. h is the height of the cylinder. If successful, this function returns the entity name of the solid.

(ap_dup_obj ename)

This function creates a new object that is a duplicate of an existing object.

ename is the entity name of the object to duplicate. If successful, this function returns the entity name of the duplicated object.

(ap_extrude_pline pts h taper)

This function creates a solid by extruding (adding height to) a 2D Polyline.

pts is a list of 2D points. If the third coordinate of any point is 1, that point becomes the endpoint of an arc with the previous two points being the start point of the arc and a point along the arc. h is the height of the extrusion taper is the angle in radians the extrusion sides will slope in from the axis normal to the plane of the region. If successful, this function returns the entity name of the extruded solid.

(ap_intersect ss)

This function creates a composite solid that is the intersection (common volume) of two or more solids in selection set ss.

ss can be an entity name, a selection set, or a list of entity names. If successful, this function returns the entity name of the composite solid.

(ap_post_obj ename)

This function posts (displays) objects on the current layer of your drawing.

ename is the entity name of the object. If successful, this function returns T.

(ap_revolve_pline pts angle axis)

This function creates a solid by revolving (rotating) a 2D Polyline about an axis.

pts is a list of 2D points. If the third coordinate of any point is 1, that point becomes the endpoint of an arc with the previous two points being the start point of the arc and a point along the arc. angle is the angle in radians that the polyline is revolved. axis is a pair of points that defines the axis of revolution. If successful, this function returns the entity name of the revolved solid.

(ap_scale_obj ename scalefac point)

This function scales (changes the size of) an object.

ename is the entity name of the object. scalefac is the value by which the object is scaled and must be a positive number. point is the base point about which the object is scaled. If pt is nil, the point 0,0,0 is used. If successful, this function returns T.

(ap_sphere r)

This function creates a solid sphere. The sphere is positioned with its center at the origin of the UCS.

r is the radius of the sphere and must be a positive number. If successful, this function returns the entity name of the solid sphere.

(ap_subtract ss1 ss2)

This function creates a solid that is the result of subtracting one set of solids from another.

ss1 and ss2 can be entity names, selection sets, or lists of entity names. ss2 is subtracted from ss1 to form the resulting composite solid. If successful, this function returns the entity name of the composite solid.

(ap_torus rad0 rad1)

This function creates a torus with the center at the origin of the UCS. The torus is positioned so that its central axis (height) coincides with the positive Z axis. rad0 and rad1 are the radii of the path of revolution and the revolved section. If successful, this function returns the entity name of the solid.

(ap_union ss)

This function creates a composite solid by joining together two or more solids.

ss can be a selection set or a list of entity names. If successful, this function returns the entity name of the composite solid.

(dp_assoc item list)

This function is similar to the assoc function except that list can contain both atoms and lists.

(dp_balloon point ename)

This function inserts a balloon annotation into a drawing. point is the insertion point for the balloon. If point is nil, you are prompted for the insert point. ename is the name of the entity that the balloon applies to. If ename is nil, you are prompted to select an entity.

(dp_blkchk command ename edata)

This function checks the block ename for compatibility. command is the name of the command that is checking the block. edata is a list of entity definition data including group codes 8, 10, 50, and 210 data.

(dp_chkdpvar dpvar value)

This function checks the validity of value for dpvar. It returns T if a valid value is present and nil otherwise.

(dp_chklay integer-or-string)

This function returns the correct layer name when passed an integer from the layer map (see LYRMAP data file). Optionally, you can pass a layer name from the layer definition file (see LYRDEF data file). If the layer does not exist in the database, nil is returned.

(dp_cmdchk command-name)

This function will switch between tilemodes, model space, and paper space based on the requirements of SI Mechanical commands. The string must be a valid SI Mechanical command (see COMMAND data file).

(dp_cmdecho)

This function sets the CMDECHO system variable to the value of V:CMDECHO.

(dp_cmdend)

This function is used at the end of all commands. When undo control is in affect, it ends the undo group so that the entire command can be undone with the AutoCAD U command. It also attempts to reset any changed AutoCAD system variables and synchronize any changed DPVAR variables.

(dp_ctr_mk point rad)

This function draws a center mark at the specified point. The rad argument is used when an extended center mark is required.

(dp_ctr_upd new-item old-item)

This function draws a center mark and center line on new_item. If old_item is specified, the center mark and center lines will be deleted from it. This function works with any hardware, hole, or shaft item.

(dp_ctrline ename)

This function draws center lines and center marks on a hardware, hole, or shaft item. ename is the entity name of the item.

(dp_date)

This function returns a string for the current date. The string may differ depending on the setting of the STANDARD DPVAR variable. For example:

"02-25-57" - ASME representation
"2:25:57" - ISO representation

(dp_dbaddcol col-name value)

This function adds a column to the current database table. col-name is the name of the new column. value is the value applied to each cell in the new column.

(dp_dbaddrow row-list)

This function adds a row to the current database table. row-list is a list of values for the cells in the row. The row is added to the beginning of the table.

(dp_dbdelcol)

This function deletes the current column from the current database table.

(dp_dbdelrow)

This function deletes the current row from the current database table.

(dp_dbeditrow)

This function displays a dialogue box for editing of the current row in the current database table.

(dp_dbftr)

This function sets the first row in the current database table.

(dp_dbgetcell)

This function returns the value of the cell specified by the current database table, row, and column.

(dp_dbgetcol)

This function returns a list of all values in the current database table under the current column.

(dp_dbgetkeys)

This function returns a list of all field names in the current table.

(dp_dbgetrow)

This function returns a list of all cells in the current row in the current database table.

(dp_dbheader)

This function sets the text to display in the header of a database dialogue box. It is only used within a database dialogue box.

(dp_dbmember0 col table)

This function returns T if col exists in table, otherwise nil is returned.

(dp_dbmember1 value col table)

This function returns value if col in table contains value, otherwise nil is returned.

(dp_dbmember2 new-col value col table)

This function returns the cell value from new-col in table. value is the key for the col. If no match is found, cell value of first row is returned.

(dp_dbmodcol col-name)

This function renames the current column to col-name in the current table.

(dp_dbmodrow new-row)

This function replaces the current row with new-row in the current table.

(dp_dbsetcol field)

This function sets the current column based on the field name.

(dp_dbsetrow value)

This function sets the row to one that has the current column set to value.

(dp_dbsettable table)

This function sets table to be current and returns the table as a list if it exists. If no table is found, or the table is not valid, the function terminates.

(dp_dbwritetable)

This function writes the current table from memory to disk.

(dp_del_nth n list)

This function returns list with element n deleted.

(dp_dimlfac)

This function returns the correct linear units scale factor.

(dp_dimscale)

This function returns the dimension scale that SI Mechanical will use.

(dp_dome hgt t-wd side hd-dia dia wd type)

This function returns a list of coordinate information used by the dp_xrcssi, dp_xrcssia, and dp_xrcssii functions to draw a screw head recess. hgt is the overall head height. t-wd is the recess width at the top of the screw. side is the side height of the screw head. hd-dia is the head diameter. dia is the recess diameter. wd is the recess width. type is the recess type, either "I", "IA", or "II".

(dp_dpvar_sync)

This function synchronizes the DPVAR variables with the drawing.

(dp_dpvarlist dpvar-list)

This function presents a dialogue box of variables specified by dpvar-list. If dpvar-list is nil, all variables will be in the dialogue box. A list of variables and any changed values is returned.

(dp_edit_prim ename bit)

This function takes the ename of an SI Mechanical hardware, hole, or shaft item and displays the appropriate dialogue box to edit the item. The entity name of the new item is returned. If bit is 1, the original item is deleted.

(dp_error_0)

This function loads a general purpose error handler. It will attempt to undo any operations back to the start of the calling function.

(dp_error_1)

This functions loads an error handler that will attempt to reset AutoCAD variables to their prior setting.

(dp_error_2)

This functions loads an error handler that will attempt to reset AutoCAD variables to their prior setting and will attempt to close an open file stored under V:FILE.

(dp_ff_or_quit filename)

This function will return a valid file name from the AutoCAD search path or terminate the calling function.

(dp_fmtchg ename sdata)

This function displays a dialogue box for creating or editing a drawing setup with a format. ename is the entity name of the format to edit. If ename is nil, a new setup will be created. sdata is a list of symbol definition data.

(dp_fmtdraw ename sdata)

This function creates a drawing setup with a format. ename is the entity name of a setup to replace. If ename is nil, a new setup will be created. sdata is a list of symbol definition data.

(dp_gear_pts tmax unit pitch pang teeth type)

This function returns a list of points for gear generation. tmax can be an integer or nil. nil indicates a complete set of points for one tooth segment, 0 indicates a gear blank, and a larger integer indicates the maximum number of teeth to show on a gear. pang is the pressure angle in radians. type can be 0, 1 or a list of the addendum and dedendum. unit can be either "IN" or "MM" and must be present for type 0 and 1. unit is used to scale the numbers as well as set the proper addendum and dedendum.

(dp_geochg ename sdata)

This function displays a dialogue box for creating or editing a geometric tolerancing symbol. ename is the entity name of the symbol to edit. If ename is nil, a new symbol will be created. sdata is the list of symbol definition data.

(dp_geodim option point 72-code 73-code)

This function inserts a geometric tolerancing symbol at the specified point. option indicates the type of symbol, such as "DFS", "DTS", "FCF", or "PTS". 72-code and 73-code correspond to AutoCAD's text justification group codes. If any argument is nil, you will be prompted for the missing information.

(dp_geodraw edata sdata)

This function creates a geometric tolerancing symbol in the drawing. edata is a list of entity definition data including group codes 8, 10, 50, and 210. sdata is a list of symbol definition data.

(dp_geofix sdata)

This function updates SI Mechanical 4 and earlier GEODIM symbol definition data to the most recent format. sdata is the old symbol definition data. A new data list is returned.

(dp_getattr ename tag)

This function returns the value of an attribute by passing the entity name and tag name.

(dp_getdpvar dpvar)

This function returns the current value of a DPVAR variable.

(dp_getgps ename descp)

This function returns a list of groups that contain ename. The string descp limits the search to groups with a matching description. If descp is nil, all groups are searched. If none are found, nil is returned.

(dp_gettags ename)

This function returns a list of attribute tags associated with a block. If none are found, nil is returned.

(dp_getvar (list variable1 variable2...))

This function stores the current values of AutoCAD system variables. The last values saved by dp_getvar can be restored with dp_setvar.

(dp_gp_items group type)

This function returns a list of entities that belong to the group specified by the entity name, group. The string type limits the search to only certain SI Mechanical items, such as "CTRLINE", "HARDWARE", "HOLE", or "SHAFT" items. If type is nil, all entities are returned. If none are found, nil is returned.

(dp_group_10 point)

This function returns a point converted to the arbitrary plane point stored in the AutoCAD drawing database. If the current construction plane is the world coordinate system, the point is returned unchanged.

(dp_group_50 angle)

This function returns an angle converted to the arbitrary plane angle stored in the AutoCAD drawing database. If the current construction plane is the world coordinate system, the angle is returned unchanged.

(dp_group_210)

This function returns the current extrusion direction.

(dp_hatchg ename sdata)

This function displays a dialogue box for creating or editing a hatched area. ename is the name of the hatch pattern to edit. If ename is nil, a new hatch pattern will be created. sdata is a list of symbol definition data.

(dp_hdwchg ename sdata)

This function displays a dialogue box for creating or editing hardware items. ename is the name of the symbol to edit. If ename is nil, a new symbol will be created. sdata is a list of symbol definition data.

(dp_hdwdraw edata sdata)

This function creates a hardware item in the drawing. edata is a list of entity definition data including group codes 8, 10, 50, and 210. sdata is a list of symbol definition data.

(dp_hdwsld sdata)

This function creates a slide file of a hardware item. sdata is a list of symbol definition data for the hardware.

(dp_hdwtable type)

This function searches the hardware group for the specified hardware type and returns the name of the database table. If the specified type cannot be found, nil is returned.

(dp_help subject)

This function displays a dialogue box with help on subject.

(dp_hex-int hex)

This function converts the string hex to an integer and returns the value.

(dp_holechg ename sdata)

This function displays a dialogue box for creating or editing hole items. ename is the name of the symbol to edit. If ename is nil, a new symbol will be created. sdata is a list of symbol definition data.

(dp_holedraw edata sdata)

This function creates a hole item in the drawing. edata is a list of entity definition data including group codes 8, 10, 50, and 210. sdata is a list of symbol definition data.

(dp_holefix sdata)

This function updates SI Mechanical 2 and earlier HOLE symbol definition data to the most recent format. sdata is the old symbol definition data. A new data list is returned.

(dp_i_entsel)

This function returns a list identical to the entsel function if a single entity has been preselected.

(dp_initialize)

This function initializes SI Mechanical and is then set to nil.

(dp_insert dwg-name switch)

This function retrieves a drawing from the library file or the si-mech/dp_lib directory and starts the insert command. The dwg-name must not contain the path. The insert command continues normally once the drawing is located. switch can be 0, 1, or 2.

0 - use block from drawing table if available
1 - use block from disk if available
2 - translate block if not in table

(dp_int-hex int)

This function converts the integer int to a hexadecimal string and returns the value.

(dp_item_modes)

This function presents a dialogue box used to configure how hardware, hole, and shaft items are drawn.

(dp_item_posn ename view)

This function positions an entity using the view number from the current view table.

(dp_itemclip ename start end)

This function clips a two-dimensional block specified by ename. start and end are the starting and ending distance along the blocks X axis.

(dp_itemucs ename)

This function aligns the UCS with the item specified by ename.

(dp_label ename)

This function returns a list of strings describing ename which can be a hardware or hole item .

(dp_listpos item list)

This function returns an integer indicating the position of the first item in list. If none are found, nil is returned.

(dp_load lsp-file)

This function loads a lisp file from the library file or the si-mech/dp_lib directory. lsp-file must not contain the path or extension.

(dp_load_dpvars)

This function loads the DPVAR variables into the drawing.

(dp_mergeblk new blocks)

This function merges a list of blocks and creates a new block in the block table using the string new as the block name.

(dp_mlay integer-or-string)

This function creates and sets the correct layer when passed an integer from the layer map (see LYRMAP data file) and returns the layer name. Optionally, you can pass a layer name from the layer definition file (see LYRDEF data file). If the layer cannot be created, nil is returned.

(dp_ms_nest_entsel prompt)

This function is similar to the entsel function except that it switches to model space for object selection. The objects can be nested items in blocks. prompt can be nil or a string.

(dp_msentsel prompt)

This function is similar to the entsel function except that it switches to model space for object selection. prompt can be nil or a string.

(dp_newsize ss)

This function updates any hardware and hole items in selection set ss to reflect the current setting of the ITEMSIZE dpvar variable. If an item is not available in the current size, it will not be changed.

(dp_newtype ss)

This function updates any hardware and hole items in selection set ss to reflect the current setting of the HDWTYPE and HOLETYPE dpvar variables. If the item size is not available in the current type, it will not be changed.

(dp_nlay integer-or-string)

This function creates the correct layer when passed an integer from the layer map (see LYRMAP data file) and returns the layer name. Optionally, you can pass a layer name from the layer definition file (see LYRDEF data file). If the layer cannot be created, nil is returned.

(dp_nospace string)

This function returns string with all leading and trailing spaces stripped off.

(dp_page_shift code chr page)

This function returns a string to display a special character using either "BIGFONT" or "UNICODE" as indicated by the code string. chr is the character from the ASCII 8 bit character set. The returned value is shifted by page, a hexadecimal string indicating the code page to use.

(dp_phatch point)

This function hatches an area surrounding point using parameters set by the system variables HPANG, HPDOUBLE, HPNAME, HPSCALE, and HPSPACE.

(dp_phatdraw point sdata)

This function draws a hatch pattern in the drawing. The point is a point inside the boundary to be hatched. sdata is a list of symbol definition data.

(dp_polar_trim circle ename)

The function trims any portion of ename that lies outside of circle, where circle is the entity name of a circle in the drawing. Some entity types cannot be trimmed.

(dp_ptlst)

This function inserts a parts list block into the active sheet.

(dp_purgegps descp)

This function deletes unused groups from the current drawing. The string descp limits the search to groups with a matching description. If descp is nil, all groups are searched. The number of deleted groups is returned.

(dp_revs)

This function inserts a revision block into the active sheet.

(dp_rotate_x ename angle)

This function rotates an object about the current X axis. ename is the entity name of the object to rotate. angle is the rotation angle in radians. If successful, this function returns T.

(dp_rotate_y ename angle)

This function rotates an object about the current Y axis. ename is the entity name of the object to rotate. angle is the rotation angle in radians. If successful, this function returns T.

(dp_rotate_z ename angle)

This function rotates an object about the current Z axis. ename is the entity name of the object to rotate. angle is the rotation angle in radians. If successful, this function returns T.

(dp_rtos real dimstyle)

This function will convert a real number to a string, taking into consideration all current AutoCAD system variables, including dimension variables. If dimstyle is nil or does not exist, the current dimension style is used.

(dp_run command-name)

This function will load and run any valid SI Mechanical command.

(dp_script list)

This function executes the list of entries as a temporary script file.

(dp_set_thd thread)

This function presents a dialogue box of different thread representations and returns the selected type (see THREAD DPVAR variable). thread is an optional integer indicating the initial thread setting.

(dp_setattr ename tag newvalue)

If the specified attribute tag is located in the block ename, this function will set the value to newvalue.

(dp_setdpvar dpvar value)

This function sets a DPVAR variable to a new value. If the value is not compatible with dpvar, nil is returned.

(dp_setsht ename)

This function activates the drawing sheet specified by ename.

(dp_settings)

This function sets applicable AutoCAD system variables based on the current SI Mechanical drawing setup.

(dp_setvar var-name-list)

This function is used to reset values for variables stored using dp_getvar. If passed a list of AutoCAD system variables, dp_setvar will try to reset just those in the list. If passed nil, all variables stored with dp_getvar will be restored.

(dp_sftchg ename sdata)

This function displays a dialogue box for creating or editing shaft items. ename is the name of the symbol to edit. If ename is nil, a new symbol will be created. sdata is a list of symbol definition data.

(dp_sftdraw edata sdata)

This function creates a shaft item in the drawing. edata is a list of entity definition data including group codes 8, 10, 50, and 210. sdata is a list of symbol definition data.

(dp_sftin sft-file)

This function reads in a shaft sft-file and returns the data in list form.

(dp_sftitem shaft types)

This function presents a dialogue box showing features inside of a shaft. shaft can either be the entity name of a shaft or shaft symbol definition data. When a feature is selected in the dialogue box, the definition data for that item is returned along with the quantity present in the shaft. types is a list of strings for the type of features to display. Valid strings are "GEAR", "HDW", "HOLE", "KWY", "PUL", "REC", "SEG", "SFT", "SPLN", "SPRKT", and "THD".

(dp_sftobjs)

This function defines SHAFT feature objects as lists. It also defines functions to handle SHAFT feature objects.

(dp_sld sld-name)

This function returns the full path for the slide sld-name. If no file is found, the slide name to load from the SI Mechanical slide library is returned.

(dp_sol_array sol qty ang)

This function creates a solid array of sol. qty is the number of items and ang is the angle between each item. This function returns the entity name of the created solid.

(dp_sol_cbore dia dp hgt)

This function creates a solid counterbore. hgt is the Z coordinate of the start of the recess. This function returns the entity name of the created solid.

(dp_sol_csk dia ang hgt)

This function creates a solid countersink. hgt is the Z coordinate of the start of the recess. ang is the included angle in degrees. This function returns the entity name of the created solid.

(dp_sol_drill dia dp hgt)

This function creates a solid drilled hole. hgt is the Z coordinate of the start of the hole. This function returns the entity name of the created solid.

(dp_sol_gear unit pitch pang teeth type thkns)

This function creates a solid gear. This function returns the entity name of the created solid. See dp_gear_pts for more information on the function arguments.

(dp_sol_hdw_body pts dia pitch lg thd-lg unit)

This function creates a solid threaded screw blank. pts is a list of points describing the profile of the screw head. unit is either "IN" or "MM". thd-lg is the length of the threaded portion. If thd-lg is nil, the thread length is calculated. lg is the screw length. This function returns the entity name of the created solid.

(dp_sol_hdw_hex wd dp hgt)

This function creates a solid hex recess. hgt is the Z coordinate of the start of the recess. This function returns the entity name of the created solid.

(dp_sol_hdw_i dia wd dp hgt edge)

This function creates a solid type I recess. hgt is the Z coordinate of the start of the recess. edge is the height of the edge of the slot at the full diameter. This function returns the entity name of the created solid.

(dp_sol_hdw_ia dia wd dp hgt edge)

This function creates a solid type IA recess. See dp_sol_hdw_i for information on the arguments.

(dp_sol_hdw_ii dia wd dp hgt edge)

This function creates a solid type II recess. See dp_sol_hdw_i for information on the arguments.

(dp_sol_hdw_sl wd dp hgt lg)

This function creates a solid slotted recess. hgt is the Z coordinate of the start of the recess. This function returns the entity name of the created solid.

(dp_sol_hdw_spln flutes dia1 dia2 wd dp start)

This function creates a solid spline. hgt is the Z coordinate of the start of the recess. This function returns the entity name of the created solid. See the dp_spln_pts function for an explanation of the other arguments.

(dp_sol_post id edata scale sdata command)

This function posts a solid as an SI Mechanical item. edata is a list of entity definition data including group code 8 data. sdata is a list of symbol definition data. command is the name of the command that is posting the solid.

(dp_sol_prof ss 3d tan)

This function returns a list of entity data from a solid selection set ss. If 3d is 0, 2D wire frame entities are returned, while 1 indicates 3D wire frame entities. If tan is 1, tangent lines are included. The list returned contains two sublists, a solid line list and a hidden line list.

(dp_sol_proj_ask)

This function displays a dialogue box to warn that the selected 2D view must be projected from a solid even though a direct generation was requested. Setting the EXPERT AutoCAD system variable to a value greater than 0 suppresses the warning.

(dp_sol_satin sat-file)

This function creates a solid from an SAT file specified by sat-file.

(dp_sol_sprkt pitch teeth thkns)

This function creates a solid sprocket profile. This function returns the entity name of the created solid.

(dp_sol_tap dia pitch dp hgt)

This function creates a solid tap body. hgt is the Z coordinate of the start of the tap. pitch is the pitch distance. This function returns the entity name of the created solid.

(dp_solid)

This function is used to initialize creation of a temporary solid.

(dp_sort list)

This function returns the list of items sorted numerically or alphabetically.

(dp_spln view bottom top pts)

This function draws a 2D or 3D spline from the pts list. view is an integer for the view, 2 or 3. bottom and top are the Z coordinates for the start and end of the spline.

(dp_spln_pts flutes dia1 dia2 wd)

This function returns a list of points for a spline type recess or shaft. flutes is the number of flutes, dia1 is the overall diameter, dia2 is the minor diameter, and wd is the width of the flutes.

(dp_sprkt_pts tmax pitch rlr-dia teeth)

This function returns a list of points for sprocket generation. tmax can be an integer or nil. nil indicates a complete set of points for one tooth segment, 0 indicates a sprocket blank, and a larger integer indicates the maximum number of teeth to show on a sprocket.

(dp_str_0 string)

This function returns a string from the string table indicated by the global variable V:BLKTXT, with string containing an integer that is the key to the table and having the following form:

"@INTEGER,TEXT,TEXT..."

The string must begin with "@" followed by an integer and optional text separated by commas.

(dp_str_1 integer string list)

This function returns a string from the string table indicated by the global variable V:STRING, with integer being the key to the table. If V:STRING is nil, string is returned. list is an optional list of text strings that will be merged with string.

(dp_str_brk strings)

This function checks the list of strings for line break control codes. The control codes are removed and an expanded list of strings is returned.

(dp_str_merge string list)

This function merges list with string. string has the following form:

"Column %0, row %1"

The % sign followed by an integer 0 through 9 indicates which item in list to merge into the string. For the previous example, list would contain two strings indicating the column and row such as:

("two" 3)

The list can contain integers, reals, and strings.

(dp_str_parse delimiter string)

This function checks the string for the delimiter string and returns a list of strings broken at the delimiter.

(dp_str_to string value)

This function returns string converted to a value of the same type as value.

(dp_str_wid string style)

This function will return the width of a text string for the specified style. The width assumes a height and width factor of one. If no valid style is found, nil is returned.

(dp_stylemake style)

This function returns a list of the font name and height. If the style does not exist, one is created.

(dp_subst_nth new-value nth list)

This function returns a list with new-value substituted for the nth item in the original list.

(dp_surfchg ename sdata)

This function displays a dialogue box for creating or editing a surface finish symbol. ename is the entity name of the symbol to edit. If ename is nil, a new symbol will be created. sdata is the list of symbol definition data.

(dp_surfdim point)

This function inserts a surface finish symbol at the specified point. If point is nil, you will be prompted for an insert point.

(dp_surfdraw edata sdata)

This function creates a surface finish symbol in the drawing. edata is a list of entity definition data including group codes 8, 10, 50, and 210. sdata is a list of symbol definition data.

(dp_symchg ename)

This function displays the appropriate dialogue box or prompt to edit the entity ename. If ename is nil, you will be prompted to select an object.

(dp_symupd ss)

This function updates all items in selection set ss to the current settings of applicable DPVAR variables and AutoCAD system variables.

(dp_tag_modes)

This function presents a dialogue box used to configure how balloons and leaders are drawn.

(dp_tagins dwg-name)

This function inserts a drawing from the library file or from the si-mech/dp_lib directory, presetting the scale and rotation angle. The scale is based on the dimscale of the drawing. dwg-name must not contain the path or extension.

(dp_tilemode switch)

This function will turn tilemode off or on by using arguments of 0 or 1 respectively.

(dp_time)

This function returns a string for the current time. The string may differ depending on the setting of the STANDARD DPVAR variable. For example, 15 minutes before midnight might be returned as:

"23:45:00"

(dp_to_str int-real-str)

The argument can be an integer, real, or a string. The value will be returned as a string regardless of the original type.

(dp_to_write_str int-real-str)

The argument can be an integer, real or a string. The value will be returned as a string regardless of the original type. It will be returned in a form suitable for writing to a file while retaining the correct type and precision. The string will be quoted, and trailing zeros will be removed on real numbers.

(dp_translate ename x y z)

This function translates (moves) an object along a vector. ename is the entity name of the object to translate. x, y, and z are the distances the object will be moved on the X, Y, and Z axes of the UCS. If successful, this function returns T.

(dp_txt_set)

This function follows the initial prompt sequence of the AutoCAD TEXT command and returns a list of group codes indicating the insert points, justification, and style. The group codes are 7, 10, 11, 72, and 73.

(dp_txtedit list bit)

This functions displays a dialogue box for editing text. It returns a list of text strings. list is a list of strings that will be displayed in the dialogue box. If list is nil, the dialogue box is initially empty. If bit is 1, the number of lines to be edited cannot be changed.

(dp_txtin list group-codes other-codes)

This function creates a paragraph of text entities in a drawing. list is a list of strings to create. group_codes is a list of group codes indicating the style, justification, and insert points. They includes codes 7, 10, 11, 72, and 73. If group_codes is nil, the dp_txt_set function will be called, prompting you for the necessary information. other_codes is an optional list of any other group codes that will be used to create the text.

(dp_ucsv)

If tilemode is off, this function will set the ucs for the current viewport to be parallel to paper space.

(dp_vslide sld-name)

This function will display any slide located in the library file or the si-mech/dp_lib directory. sld-name must not contain the path or extension.

(dp_weldchg ename sdata)

This function displays a dialogue box for creating or editing a weld symbol. ename is the entity name of the symbol to edit. If ename is nil, a new symbol will be created. sdata is the list of symbol definition data.

(dp_weldim point 72-code)

This function inserts a weld symbol at the specified point. If point is nil, you will be prompted for an insert point. 72-code corresponds to AutoCAD's text justification group code and can be 0 or 2.

(dp_weldraw edata sdata)

This function creates a weld symbol in the drawing. edata is a list of entity definition data including group codes 8, 10, 50, and 210. sdata is a list of symbol definition data.

(dp_x_clip list lower upper)

This function returns a list describing the clipped and unclipped portions of an arc, circle, or line. list describes an object to clip and has one of the following formats:

("ARC" center radius startangle endangle)
("CIRCLE" center radius)
("LINE" startpoint endpoint)

lower and upper are the lower and upper X coordinate clip limits.

(dp_x_clip '("LINE" (1.0 1.0) (2.0 1.0)) 1.5 1.75)

returns:

((("LINE" (1.5 1.0) (1.75) 1.0))) (("LINE" (1.75 1.0) (2.0 1.0)) ("LINE" (1.0 1.0) (1.5 1.0))))

The first element in the returned list is a list of hidden items. The second element is a list of visible items.

(dp_xdata_append ename xdata)

This function will append a formatted list of extended data to an entity. If passed a list containing lists of registered application data, the data will be appended to the entity. The registered data list would have the following form:

(("REGAPP1" (1000 . "abc")...) ("REGAPP2" (1000 . "abc")...))

If a single list of data for an application that is not registered is passed, dp_xdata_append will first register the application name and then append the data to the entity. The unregistered data would have the following form:

("NONREG" (1000 . "abc")...)

(dp_xdata_fmt sdata)

This function will take the sdata list of items, limited to strings, integers, and reals, and will return a list of extended data formatted for SI Mechanical.

For example:

(dp_xdata_fmt '("{" 1.00 3 "TEST" "}"))

returns the following list:

("SI-MECH" (1040 . 4.12) (1002 . "{") (1040 . 1.000)(1070 . 3) (1000 . "TEST) (1002 . "}"))

(dp_xdata_get ename)

If the entity has SI Mechanical extended data attached, this function returns a list of the data. If no data is found, nil is returned.

(dp_xdata_get_acad ename)

If the entity has AutoCAD supplied extended data attached, this function returns a list of the data. If no data is found, nil is returned.

(dp_xdata_get_other ename)

If the entity has extended data attached that does not belong to SI Mechanical, this function returns a list of the data. If no data is found, nil is returned.

(dp_xdata_list xdata)

This function returns a standard list from an extended data list.

(dp_xline start end)

This function draws an offset extension line from point start to point end. The offset is controlled by the XLINEO DPVAR variable and the DIMEXO AutoCAD system variable.

(dp_xrcssi hgt dia wd dp edge top dome)

This function draws a type I screw recess. hgt is the height of the screw head. hgt is 0 for a front view. dia is the recess diameter. width is the recess width. dp is the Z coordinate of the bottom of the recess. edge is the height of the edge of the recess at the full diameter. top is the Z coordinate for the highest portion of the slot. dome is a list of the form returned by the dp_dome function.

(dp_xrcssia hgt dia wd dp edge top dome)

This function draws a type I screw recess. See dp_xrcssi for information on the arguments.

(dp_xrcssii hgt dia wd dp edge top dome)

This function draws a type II screw recess. See dp_xrcssi for information on the arguments.

(dp_xydim type point location list)

This function draws a datum dimension to point point. type can be either "X" or "Y". The dimension will be located at point location. list is a list of points where the extension line will jog. If pt, location, or list is nil, you will be prompted for the missing information. If location is 0 and the global list L:XYDIM has been set, the location will be taken from L:XYDIM. If list is 0, the extension line will be straight.