请高手都进来看一下
%%1308@200(2)求面积除了下面的方法有否更好的方法
txt3为文字内容
(setq n5 (vl-string-search "%" txt3)) ;在字符串中搜索指定子串的位置号 (setq n6 (vl-string-search "@" txt3)) (setq n7 (vl-string-search "(" txt3)) (setq n8 (vl-string-search ")" txt3)) (setq tc_t7 (atof (substr txt3 (+ n5 6) (- n6 (+ n5 5))))) (setq tc_area (/ (* tc_t7 tc_t7 3.1415926) 4)) (setq tc_t8 (atof (substr txt3 (+ n6 2) (- n7 (+ n6 1)))) tc_t9 (atof (substr txt3 (+ n7 2) (- n8 (1+ n7)))) ) (setq tc_t9a tc_t8) (setq tc_gjmj5 (/ (* tc_area 200 tc_t9) tc_t8)) (if (>= tc_t7 10) (setq tc_gjmj5 (/ (* tc_gjmj5 300) 210))) ) |