使用DMIS代码发送变量到输出

来自ArcoWiki
跳转至: 导航搜索

This code example is used to send a calculated variable to output applying a tolerance as it was a measured feature.

$$
$$Section 1: Preparing the Variable, this is to be substituted by an actual calculation of the required variable

DECL/DOUBLE,NominalValue,MeasuredValue,Deviation
NominalValue=ASSIGN/10
MeasuredValue=ASSIGN/10.5
Deviation=ASSIGN/MeasuredValue-NominalValue

$$


$$
$$Section 2: Preparing the tolerances

DECL/DOUBLE,utol,ltol
utol=ASSIGN/0.1
ltol=ASSIGN/-0.1
DECL/DOUBLE,oot
DECL/CHAR,200,msg
IF/(Deviation.GT.utol)
oot=ASSIGN/Deviation-utol
ENDIF
IF/(Deviation.LT.ltol)
oot=ASSIGN/Deviation-ltol
ENDIF
msg=ASSIGN/STR(oot,13,4)

$$


$$
$$Section 3: Creating the output string with formatting

DECL/CHAR,500,strOut,strout1
strout1=ASSIGN/'LABEL NOMINAL ACTUAL DEVIATION LOWER TOL. UPPER TOL. OOT'
strout=ASSIGN/CONCAT('DIST ',STR(NominalValue,14,4),STR(MeasuredValue,14,4),STR(Deviation,14,4),STR(ltol,14,4),STR(utol,14,4),msg)

$$


$$
$$Section 4: Sending to Output

TEXT/OUTFIL,strout1
TEXT/OUTFIL,strout

$$