RationalDMIS 7.1 do迴圈示例

山澗果子發表於2020-10-12
山澗果子

$$ COUNTER VALUES FOR LOOPS
DECL/LOCAL,INTGR,CMAJOR,CMINOR
$$ FEATURE NAME STORAGE
DECL/LOCAL,CHAR,512,FEATNAME
$$ STORAGE FOR DEPTH, RADIUS, AND DIAMETER
DECL/LOCAL,DOUBLE,CIR_DEPTH,CIR_RAD,CIR_DIAMETER

$$ SEED VALUES FOR RADIUS AND DEPTH
CIR_DEPTH=ASSIGN/-0.5
CIR_RAD=ASSIGN/1.000

$$ START OUTSIDE 'MAJOR' LOOP
DO/CMAJOR,1,9,1
$$ START INSIDE 'MINOR' LOOP
DO/CMINOR,0,360,5

FEATNAME=ASSIGN/CONCAT('F',STR(CMINOR))

F(FEATNAME)=FEAT/POINT,CART,CIR_RAD,0,CIR_DEPTH,-1,0,0
MEAS/POINT,F(FEATNAME),1
PTMEAS/CART,CIR_RAD,0,CIR_DEPTH,-1,0,0
ENDMES

$$ IF CURRENT ANGLE DIVIDES BY 15 LEAVING NO REMAINDER
IF/(MOD(CMINOR,15).EQ.0)
GOTO/CART,0,0,CIR_DEPTH
$$ SNSLCT/ NEXT PROBE $$
ENDIF

RECALL/DA(0)
D(ROT)=ROTATE/ZAXIS,CMINOR

ENDDO

FEATNAME=ASSIGN/CONCAT('C',CMAJOR)
CIR_DIAMETER=ASSIGN/CIR_RAD*2

F(FEATNAME)=FEAT/CIRCLE,INNER,CART,0,0,CIR_DEPTH,0,0,1,CIR_DIAMETER
CONST/CIRCLE,F(FEATNAME),BF,FA(F0)[1],FA(F10)[1],FA(F100)[1],FA(F105)[1],FA(F110)[1],FA(F115)[1],FA(F120)[1],FA(F125)[1],FA(F130)[1],FA(F135)[1],FA(F140)[1],FA(F145)[1],FA(F15)[1],FA(F150)[1],FA(F155)[1],FA(F160)[1],FA(F165)[1],FA(F170)[1],FA(F175)[1],FA(F180)[1],FA(F185)[1],FA(F190)[1],FA(F195)[1],FA(F20)[1],FA(F200)[1],FA(F205)[1],FA(F210)[1],FA(F215)[1],FA(F220)[1],FA(F225)[1],FA(F230)[1],FA(F235)[1],FA(F240)[1],FA(F245)[1],FA(F25)[1],FA(F250)[1],FA(F255)[1],FA(F260)[1],FA(F265)[1],FA(F270)[1],FA(F275)[1],FA(F280)[1],FA(F285)[1],FA(F290)[1],FA(F295)[1],FA(F30)[1],FA(F300)[1],FA(F305)[1],FA(F310)[1],FA(F315)[1],FA(F320)[1],FA(F325)[1],FA(F330)[1],FA(F335)[1],FA(F340)[1],FA(F345)[1],FA(F35)[1],FA(F350)[1],FA(F355)[1],FA(F360)[1],FA(F40)[1],FA(F45)[1],FA(F5)[1],FA(F50)[1],FA(F55)[1],FA(F60)[1],FA(F65)[1],FA(F70)[1],FA(F75)[1],FA(F80)[1],FA(F85)[1],FA(F90)[1],FA(F95)[1]

$$ STEP VALUES FOR RADIUS AND DEPTH
CIR_DEPTH=ASSIGN/CIR_DEPTH-0.150
CIR_RAD=ASSIGN/CIR_RAD-0.050
ENDDO

在這裡插入圖片描述

相關文章