马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
程序不稳定,多次不能完成计算.
- [FONT=courier new]
- ((defun c:zx (/ se ss n entname ent rg f xxx xxy xxx1 xxy1 xxx2 xxy2 cep)
- (setvar "CMDECHO" 0)
- (setvar "FILEDIA" 0)
- (setvar "LUPREC" 8) ;(setq se (entsel "\n 请选取欲求形心的多义线:"))
- (princ "\n请选取欲求形心的多义线")
- (setq se (ssget '(( 0 . "LWPOLYLINE"))))
- (setq n (sslength se)
- index 0
- )
- (repeat n
- (setq
- entname (ssname se index)
- ent (entget entname)
- index (+ 1 index)
- ss (assoc 0 ent)
- )
- ;(if (= "PLINE" (cdr ss))
- (progn ;if start
- (command "copy" se "" "0,0" "0,0")
- (command "region" se "")
- (setq rg (entget (entlast)))
- (command "massprop" "l" "" "y" "d:/ZZX.mpr")
- (command "erase" "l" "")
- (setq f (open "d:/ZZX.mpr" "r"))
- (read-line f)
- (read-line f)
- (read-line f)
- (read-line f)
- (read-line f)
- (read-line f)
- (read-line f)
- (setq xxx (read-line f))
- (setq xxy (read-line f))
- (close f)
- (setq xxx1 (substr xxx 25 20))
- (setq xxy1 (substr xxy 25 20))
- (setq xxx2 (atof xxx1))
- (setq xxy2 (atof xxy1))
- (setq cep (list xxx2 xxy2 0))
- (entmake
- (list (cons 0 "point") (cons 8 "temp") (cons 10 cep))
- )
- ; ) ;if end
- ) ;progn end
- ) ;repeat end
- (setvar "FILEDIA" 1)
- (setvar "LUPREC" 2)
- (princ)
- ) [/FONT]
请问我这个程序哪有问题, |