钢轨命令流FINISH/CLEAR/PREP7!1.定义参数H1=30.5H2=48.5H3=48.5B1=45.75B2=29.25B3=16.5B4=36.5B5=10XD1=1/3XD2=1/9XD3=1/3XD4=1/20R0=400R1=2R2=4R3=40R4=20R5=25R6=8R7=13R8=80R9=300R10=2FAI=43H=H1+2*H2+H3!2.创建轨底主要组成部分的线K,1K,2,B1+B2K,3,B1+B2,H1-B1*XD1-B2*XD2K,4,B1,H1-B1*XD1K,5,0,H1*DO,I,1,4L,I,I+1*ENDDO!3.计算确定轨头下三个圆弧的位置CTA=ATAN(XD3)BTA=(90-FAI)*ACOS(-1)/180-CTAA=1/TAN(CTA)C1=B3/2+R0-R6*SIN(CTA)-(R5-R6)*COS(BTA)C2=R5*SIN(BTA)+R6*COS(CTA)-R6*SIN(BTA)-H2C=(C1-C2/TAN(CTA))/(R0-R5)C3=A*C-SQRT(A*A-C*C+1)C3=C3/(A*A+1)REFA=ASIN(C3)C1=R6*SIN(CTA)+(R5-R6)*COS(BTA)+(R0-R5)*COS(REFA)!4.创建轨腰和轨头结构线ROUX=B3/2+R0-C1ROUY=ROUX*TAN(CTA)ANGI=ASIN((H1+H2)/R0)K,6,B3/2+R0-R0*COS(ANGI)K,7,B3/2+R0-R0*COS(REFA),H1+H2+R0*SIN(REFA)LARC,6,7,2,R0DX1=R6*(COS(BTA)-SIN(CTA))DY1=R6*(COS(CTA)-SIN(BTA))K,8,ROUX-DX1,H1+2*H2+ROUY-DY1K,9,ROUX,H1+2*H2+ROUYLARC,7,8,2,R5LARC,8,9,2,R6K,10,B4,H1+2*H2+B4*XD3K,11,B4-(H3-B4*XD3)*XD4,HL,9,10L,10,11ANGI=ASIN(B5/R9)K,12,0,HK,13,B5,H-(R9-R9*COS(ANGI))LARC,12,13,1,R9DX1=B4-B5+R8*SIN(ANGI)ANGI1=ASIN(DX1/R8)Y1=R8*COS(ANGI)-R8*COS(ANGI1)K,14,B4,KY(13)-Y1LARC,13,14,1,R8!5.倒角或弧线连接LFILLT,1,2,R1LFILLT,2,3,R2LFILLT,3,4,R3LPTN,4,5LFILLT,17,18,R4LFILLT,8,9,R10LPTN,9,11LFILLT,20,22,R7LDELE,15,16,1,1LDELE,19,21,2,1LSYMM,X,ALLNUMMRG,ALLNUMCMP,ALLAL,ALLASUMVOFFST,1,300