Esko Logo Back to Esko Support
Choose your language for a machine translation:
Skip to end of metadata
Go to start of metadata


Question

What expressions can be used as calculated fields on a report or as calculated expressions for Database User Fields (Standard Edition) or Database Attributes (Enterprise Edition)?

Answer

The best place to start is the Calculated Text Table in ArtiosCAD which already includes functions for cumulative scoring values, rule lengths, hatch legends, line type legends and costing/ estimating. The expressions themselves are constructed using the Interact scripting language (not documented here) and are in a form such that when evaluated would return a value. A typical Calculated Text Table entry is shown below:

This entry is for Blank size X and uses the system text variable #MANSIZEX as the expression. One thing to note is that this dialog automatically does the conversion to a text value using the Type, Units and Format fields. The real expression that is evaluated is actually:  NUMTEXT(LENUNIT(#MANSIZEX,0),0,0,0)  which you can see by clicking the f(x) button.

It would be impossible to document a complete list of possible calculated expressions purely based on the fact that expressions can be customized, combined and/ or nested to produce an infinite number of expressions. We can, however, list the different categories of the available expressions and expand on some of the more interesting ones.

Calculated expressions can be created from a combination of any of the following:

System Text Variables

System Text Variables all start with the # character and end with the $ character and evaluate to a text value. A typical example is #GRAIN$ which returns either the text Horizontal or Vertical based on the grain direction of the design. The table below lists the available System Text Variables. 

Variable

Description

#ACADREV$Returns the current ArtiosCAD version number as a string (ArtiosCAD 16.0)

#ARGFNM$

List arguments from command line.

#BFORmat$

Format used for blueprints.

#CFN$

Standard name.

#CONsole$

Always returns “X”.

#Date$

Current date.

#DIGitiser$

Returns empty string.

#DIRectory$

Current directory.

#DPRSNAME$

Returns die press name.

#DSIDE$

Returns “Die Knife Side” or “Die Back Side”.

#EFILE$

Command file name which errored.

#ELINE$

Command text buffer.

#Error$

System error code (six characters error code).

#EVAR$

Variable name which error.

#EXEcute$

Subroutine name what currently is executing.

#EXEPATh$

Subroutine full path name (separated by space) what currently is executing.

#FORmat$

Text representation of a format code.

#GRAIN$

Returns “Horizontal” or “Vertical” grain.

#INCludes$

Names of included designs.

#ITEM$

Print item name. If design has no print items returns filename.

#ITEMOV$

List of item numbers of overlays selected by the current print item. This is only defined if there is an LPVARITEM oneup, otherwise return blank.

#JUStify$

Justification used for blueprints.

#Message$

System error message.

#NAMENOEXT$

Returns filename with no .ARD or .MFG extension.

#ONEUP$

Returns name of current workspace or LPVAR workspace if set.

#OPTBEEp$

Not used.

#OPTBRIdge$

Returns ON if bridges are on.

#OPTCOMp$

Returns ON if complement is on.

#OPTCP$

Returns ON if follow current position is on.

#OPTCURsor$

Always returns ON.

#OPTFOLlow$

Returns ON if follow is on.

#OPTMPLOt$

Returns ON if plot inside the menu is on.

#OPTORIgin$

Returns ON if follow origin is on.

#OPTSEEd$

Used for LaserPoint menus. Returns ON if seed menu cursor option is on.

#PARTNAME$Returns the part name of the current active part when working in a Canvas

#PATh$

Subroutine path name in command file.

#PATHNAME$

Returns full pathname of the current workspace.

#PATHNOEXT$

Returns pathname with no .ARD or .MFG extension.

#PLOtters$

List the plotter drivers found (with version letters).

#PPRSNAME$

Returns printing press name.

#PROcess$

List IDs of user pipes.

#PROJECTS$

Returns comma separated list of projects for the current print item.

#PULldown$

Used for LaserPoint menus. Names of pulldown menus.

#PUNch$

List names of punch drivers.

#SEArch$

List directories sued for search.

#Section$

Current section name.

#SELection$

Menu selection text.

#SIDE$

Returns “Inside” or “outside” side.

#SIDEP$

Returns “Unprinted” or “Printed” side.

#STYle$

Current plotting style name.

#SYStem$

Current computer system.

#TERminal$

Not used.

#Time$

Current time.

#TMPPATH$Returns the path to current Windows temp directory (ArtiosCAD 16.0)

#UNIT$

Returns “inches” or “millimeters” units.

#UNITAB$

Returns “in” or “mm” abbreviated units.

#UTCTIME$Returns UTC time - number of milliseconds since midnight January 1, 1970 (ArtiosCAD 16.0)

#VERLS$

Version number document was saved last.

Version number           Return value

1.x-3.1x                     ArtiosCAD 1.x-3.1x
3.25-4.2x                   ArtiosCAD 3.25-4.2x
4.41-5.2x                   ArtiosCAD 4.41-5.2x
6.0-6.33                     ArtiosCAD 6.00-6.33
 x.xx                           ArtiosCAD x.xx

#Workspace$

Current workspace name.

System Numeric Variables

System Numeric Variables all start with the # character and evaluate to a numeric (float/real) value. A typical example is #MANSIZEX which returns the numeric value for the blank size in the x direction in the current units. The table below lists the available System Numeric Variables.

Variable

Description

#A

Angle of current position marker in degrees.

#ACCept

Used for LaserPoint menus. Return 1 if the last exit button used onto the stack was ACCEPT, else return 0.

#ALIgned

Not used. Always return 0.

#APERTUREX

Width of aperture in design in current units.

#APERTUREY

Height of aperture in design in current units.

#AREA

For design: Area of design in square inches or square mm. For manufacturing: Area of designs on the sheet.

#AREAH

For design: Area minus holes of design in square inches or square mm. For manufacturing: Area of designs on the sheet minus holes.

#AREAN

For design: Area minus unnicked holes of design in square inches or square mm. For manufacturing: Area of designs on the sheet minus unnicked holes. A unnicked holes has no nicks. A nicked hole has one or more nicks, or wave or zigzag special rule with nicks

Introduced with 21.07

#AREANH

For design: Area of nicked holes of design in square inches or square mm. For manufacturing: Area of the nicked holes in designs on the sheet. A nicked hole has one or more nicks, or wave or zigzag special rule with nicks

Introduced with 21.07

#BITMAPPED

Not used. Always return 1.

#BRDCSTFT

Board cost per 1000 square feet.

#BRDCSTKG

Board cost per kilogram.

#BRDCSTLBS

Board cost per pound.

#BRDCSTM

Board cost per 1000 square meters.

#BRDWTG

Board weight in grams per square meter.

#BRDWTLBS

Board weight in lbs per 1000 square feet.

#BRLEN

Balance rules length in current units.

#BTYPe

Current Interact BDEFAULT TYPE for text, dimensions, arrows

#C

Current item number in current section.

#CANcel

Used for LaserPoint menus. Returns 1 if the last exit button used onto the stack was CANCEL, else returns 0.

#CBLEN

Coating blanket cut length in current units.

#CBSIZEX

Returns coating blanket width in mm.

#CBSIZEY

Returns coating blanket height in mm.

#CLENgth

Default mask length for construction lines.

#CTYPe

Default line type for construction lines.

#CUTSIZEX

Knife-to-knife size X of designs in layout in current units.

#CUTSIZEY

Knife-to-knife size Y of designs in layout in current units.

#CWIDth

Default mask width for construction lines.

#CWIDTHWG

Counter width with grain in current units.

#CWIDTHXG

Counter width cross grain in current units.

#DBIMGtype

Type of design image written to database:

1 – bitmap,

2 – windows enhanced metafile,

3 – run length encoding

Currently supporting bitmaps only, returns 1.

#DEFAULT

Returns 1e21 

#DELIM

Returns delimiter from GET .. DN command.

#DESCENTERXDesign: Center X of the design or part in current units, Layout: 0
#DESCENTERYDesign: Center Y of the design or part in current units, Layout: 0
#DESLEFTXDesign: Left X of the design or part in current units, Layout: 0
#DESLOWERYDesign: Lower Y of the design or part in current units, Layout: 0

#DIEBLEN

Die burn length in current units.

#DIESIZEX

Die width in mm.

#DIESIZEY

Die height in mm.

#DKNIFE

Returns length of double knife to remove without changing the workspace.

#ELINE

Line number in command file where error occurred.

#EPOS

Buffer position where error occurred.

#FLINEAT

Start angle in degrees of the next item from section :TEMPOUTPUT or file DUPITEM.ARD.

#FLINEFIN

End angle in degrees of the next item from section :TEMPOUTPUT or file DUPITEM.ARD.

#FLINELEN

Length in current units of the next item from section :TEMPOUTPUT or file DUPITEM.ARD.

#FLINEPOI

Pointage in current units of the next item from section :TEMPOUTPUT or file DUPITEM.ARD.

#FLINERAD

Radius in current units of the next item from section :TEMPOUTPUT or file DUPITEM.ARD.

#FLINETYPE

Line type of the next item from section :TEMPOUTPUT or file DUPITEM.ARD.

#FOLlow

Maximum gap for FOLLOW command in current units.

#FOLLOWANG

Follow angle in degrees last used.

#FWSBLEN

Front waste separator burn length in current units.

#FWSCALE

Returns current file window scale.

#FWSSIZEX

Returns front waste separator width in mm.

#FWSSIZEY

Returns front waste separator height in mm.

#FWYSCALE

Returns current file window Y scale.

#GUTTERX

Analyze a straight layout and returns gutter in X in current units. Returns 0 if it is not a straight layout of one design with consistent gutters.

#GUTTERY

Analyze a straight layout and returns gutter in Y in current units. Returns 0 if it is not a straight layout of one design with consistent gutters.

#I

Units factor to convert current units to inches.

#I1UP

Number of oneup set by LPVARITEM command.

#ITEM

Number of item set by LPVARITEM command.

#ITEMDEL

Used for Intelligent layout. Delivered quantity.

#ITEMORD

Used for Intelligent layout. Ordered quantity.

#ITEMSCRAP

Scrapped overrun quantity.

#KGSLTON

Number of kilograms in a long ton.

#KGSSTON

Number of kilograms in a short ton.

#L

Last item number in current section.

#LASER1

Laser line type 1.

#LASER2

Laser line type 2.

#LASER3

Laser line type 3.

#LASER4

Laser line type 4.

#LASER5

Laser line type 5.

#LASER6

Laser line type 6.

#LASER7

Laser line type 7.

#LASER8

Laser line type 8.

#LASER9

Laser line type 9.

#LASER10

Laser line type 10.

#LASER11

Laser line type 11.

#LASER12

Laser line type 12.

#LASER13

Laser line type 13.

#LASER14

Laser line type 14.

#LASER15

Laser line type 15.

#LASER16

Laser line type 16.

#LASER17

Laser line type 17.

#LASER18

Laser line type 18.

#LASER19

Laser line type 19.

#LASER20

Laser line type 20.

#LBSFTGM

Factor to convert pound per square foot to gram per square meter.

#LBSKG

Factor to convert pounds to kilograms.

#LENCHOP

Chop knives length in current units.

#LENRULE

Total length of rules in current units.

#LENRULEXP

Total length of rules with special rules expended in current units.

#LENSTRIP

Stripping rules length in current units.

#LOWBLEN

Lower stripping board burn length in current units.

#LOWSIZEX

Lower stripping board width in mm.

#LOWSIZEY

Lower stripping board height in mm.

#LPEMULATE

Returns 1, when running in LaserPoint emulation mode. Used for interact standards from ArtiosCAD.

#LPOIntage

Default pointage for current view.

#LPVARNEXE

Not used. Always returns 0.

#LTYPe

Default line type for current view.

#M

Units factor to convert current units to mm.

#MANSIZEWG

For design: Blank size with grain of design in current units. For manufacturing: Layout size with grain in current units.

#MANSIZEX

For designs: Blank size X of the design in current units. For manufacturing: same as #CUTSIZEX.

#MANSIZEXG

For design: Blank size cross grain of design in current units. For manufacturing: Layout size cross grain in current units.

#MANSIZEY

For design: Blank size Y of the design in current units. For manufacturing: same as #CUTSIZEY.

#MDISPLAY

Return true if menu displayed.

#MKRT

Used for Intelligent Layout cost center. Returns make ready time for the current cost center.

#MKRTA

Used for Intelligent Layout cost center. Returns make ready time for additional print items for the current cost center.

#MOUSEMOD

Returns modifier key used with mouse; 0 – none; 1 – Ctrl key.

#MSIZE

Maximum of #MANSIZEX, #MANSIZEY used for scale on rebuild dimension text size.

#NBACK

Analyze a straight layout and returns number of designs back. Returns 0 if it is not a straight layout of one design with consistent gutters.

#NCC

Used for Intelligent layout. Returns number of cost centers.

#NCOLOR

Number of colors.

#NCROSS

Analyze a straight layout and returns number of designs across. Returns 0 if it is not a straight layout of one design with consistent gutters.

#NDESIGNS

For manufacturing only: Number of different designs on the sheet.

#NDESIGNSA

For manufacturing only: Number of different designs in the layout.

#NDPRESSCC

Used for Intelligent layout. Returns number of the die press cost centers.

#NEXt

Used for LaserPoint menus. Return 1 if the last exit button used onto the stack was NEXT, else return 0.

#NINKS

Used for Intelligent layout. Returns number of inks.

#NITEM1CC

Used for Intelligent layout. Returns number of the first item cost center.

#NITEMS

For manufacturing: Number of different print items on the sheet. For design: Number of print items in the design.

#NITEMSA

For manufacturing: Number of print items in the layout. For design: Number of print items in the design.

#NOTINIT

Returns 1 if current menu was not initialized, else returns 0.

#NPARameter

Number of parameters passed to subroutine.

#NPPRESSCC

Used for Intelligent layout. Returns number of the printing press cost centers.

#NQUANTITY

Used for Intelligent layout. Returns number of ordered quantities.

#NREDO

Number of redo levels.

#NSELected

Number of items selected.

#NSELDERROR

Number of bad points connected with dimensions.

#NSELGERROR

Number of bad points connected with geometry.

#NUNDO

Number of undo levels.

#NUP

Number designs on a sheet.

#NUPD

Number of specified design on a sheet.

#NUPP

Number of specified print item on a sheet.

#ORIent

Character rotation in degrees for blueprint items.

#OUTSCALE

Not used. Always return ½.

#OVErview

Used for LaserPoint menus. Return 1 if the last exit button used onto the stack was OVERVIEW, else return 0.

#PICKUPANG

Returns angle in degrees for the transform rotate command set by PICKUP command. Used for multiple commands with large selection.

#PICKUPSX

Returns scale X set by PICKUP command. Used for multiple commands with large selection.

#PICKUPSY

Returns scale Y set by PICKUP command. Used for multiple commands with large selection.

#PICKUPX

Returns X coordinate of pickup point in current units set by PICKUP command. Used for multiple commands with large selection.

#PICKUPY

Returns Y coordinate of pickup point in current units set by PICKUP command. Used for multiple commands with large selection.

#PID

Returns 5 digits process identification number obtained from the system.

#PREvious

Used for LaserPoint menus. Return 1 if the last exit button used onto the stack was PREVIOUS, else return 0.

#PUTDOWNX

Returns X coordinate of putdown point in current units set by PUTDOWN command. Used for multiple commands with large selection.

#PUTDOWNY

Returns Y coordinate of putdown point in current units set by PUTDOWN command. Used for multiple commands with large selection.

#REInit

Used for LaserPoint menus. Return 1 if the last exit button used onto the stack was REINIT, else return 0.

#RESet

Used for LaserPOint menus. Return 1 if the last exit button used onto the stack was RESET, else return 0.

#REZOOM

Return true if can re-zoom.

#RUN

Used for Intelligent Layout cost center. Run length for the current cost center. For sheet cost centers, returns the number of sheets (not including make ready sheets). For design cost centers, returns the number of this design. For print item cost centers, returns the number of this print item.

#RUNTIME

Used for Intelligent Layout cost center. Returns run time of the current cost center (slightly recursive definition).

#SCAle

Scale factor for current plot.

#SCCUT

Line type for sample counter cut.

#SCPEN

Line type for sample counter pen.

#SCREASE

Line type for sample creases.

#SCRoll

Number of lines in current text window.

#SCROUT

Line type for sample router.

#SCROUT2

Line type for sample cross grain router.

#SCUT

Line type for sample cuts.

#SEED

Number of next reverse video position.

#SELection

Number of last selection in a menu.

#SHTLEFTXBottom left of sheet for canvas sheet dimension geometry tool
#SHTLOWERYBottom left of sheet
#SHTMARLSheet left margin
#SHTMARBSheet bottom margin
#SHTMARRSheet right margin

#SHTMART

Sheet top margin

#SHTSIZEX

Sheet size X in current units.

#SHTSIZEWGSheet size with grain in current units.

#SHTSIZEXG

Sheet size cross grain in current units.

#SHTSIZEY

Sheet size Y in current units.

#SHTTRIMB

Sheet bottom trip in current units.

#SHTTRIML

Sheet left trim in current units.

#SHTTRIMR

Sheet right trim in current units.

#SHTTRIMT

Sheet top trim in current units.

#SIZe

Default character size for current view.

#SIZE40

Dimensions size for 40 inch or 1 meter design.

#SLAnt

Slant angle in degrees for blueprint items.

#SPCUT

Line type for sample partial cuts.

#SPEN1

Line type for sample pen 1.

#SPEN2

Line type for sample pen 2.

#SPEN3

Line type for sample pen 3.

#SPEN4

Line type for sample pen 4.

#SRCREASE

Line type for sample reverse crease.

#SRCUT

Line type for sample reverse cut.

#SRXCREASE

Line type for sample reverse cross grain crease.

#SQMSQFT

Factor to convert square meter to a square foot.

#SXCREASE

Line type for sample cross grain creases.

#TERMKEY

Returns key used to terminate last MPROMPT.

1 – Return key

2 – Esc key

3 – Ctrl key

4 – Up key

5 – Down key

6 - Other

#TEXTSIZE

Returns text size of the current plot.

#UPPSIZEX

Returns upper stripping board width in mm.

#UPPSIZEY

Returns upper stripping board height in mm.

#VERsion

Command file version number.

#VERLS

Version number document was saved last.

Version number           Return value

1.x-3.1x                     3.00
3.25-4.2x                   3.25
4.41-5.2x                   4.41
6.0-6.33                     6.00
 x.xx                           x.xx

#WASTEBLK

Waste on blank area of design in percents.

#WASTEHBLK

Waste plus holes on blank area of design in percents.

#WASTEHSHT

For manufacturing only: Area of designs minus holes / sheet area in percents.

#WASTESHT

For manufacturing only: Area of designs / sheet area in percents.

#WEIGHTKG

Weight of one carton (board only) in kilograms.

#WEIGHTLBS

Weight of one carton (board only) in pounds.

#X

X coordinate of the document current position in current units.

#XPENDING

Returns 1 if a message/event is waiting to be processed, else returns 0.

#Y

Y coordinate of the document current position in current units.

#ZOOMSCALE

Scale of zoom window.

Interact Functions

The Interact scripting language has a wide variety of functions which can accept any number of input arguments and return a variety of values. Although we have not published a complete list of Interact Functions.

Function

Description

BLKBRDSIZX

Returns the width of the blanker board.

1 - Lower blanker board

2 - Upper blanker board

BLKBRDSIZY

Returns the height of the blanker board.

1 - Lower blanker board

2 - Upper blanker board


A separate document listing the functions which access the numerous database fields can be found using the link below. 

Direct Workspace Variables

Besides the typical StyleMaker variables (e.g.: L, W, D), ArtiosCAD stores various bits of information in workspace variables. This is typically any non-geometric data like board information, colors, fonts, and various database information (although directly accessing database information variables is not recommended). There is no complete list of variables due to the ability to create user defined variables, however, there is a way to dump the complete list of variables in a design using the Help > Diagnostic > List Workspace feature. In regards to calculated expressions, the Calculated Text Table already contains most of the items which are directly access via workspace variables. A typical example of the board caliper using the workspace variable CAL is shown below:

Article information
Applies to

 ArtiosCAD all versions

Created

 

Last revised

 

Author MRAN
CW Number
Contents


2 Comments

  1. Anonymous

    Say I have prompted text in a report (L, W, D) and I want to have volume calculated (LxWxD/1728). Can I change the prompted text into numbers to be calculated? 

    1. Anonymous

      no wait, think i got it. something like NUM(DWB1$)*NUM(DWB2$)*NUM(DWB3$)/1728?