- 积分
- 4977
- 明经币
- 个
- 注册时间
- 2003-12-14
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
发表于 2022-4-4 17:16:11
|
显示全部楼层
您拿19楼的改改就是了,就是那么几个函数转圈圈
- (defun c:tt (/ en f i lst n pt pt1 pt1a pt2 pt2a r ss)
- (setq ss (ssget '((0 . "arc"))))
- (repeat (setq i (sslength ss))
- (setq n (* 3 i)
- en (ssname ss (setq i (1- i)))
- r (rtos (cdr (assoc 40 (entget en))) 2 3)
- pt1 (vlax-curve-getstartpoint en)
- pt1a (mapcar '+
- pt1
- (vlax-curve-getfirstderiv
- en
- (vlax-curve-getparamatpoint en pt1)
- )
- )
- pt2 (vlax-curve-getendpoint en)
- pt2a (mapcar '-
- pt2
- (vlax-curve-getfirstderiv
- en
- (vlax-curve-getparamatpoint en pt2)
- )
- )
- pt (trans (inters pt1 pt1a pt2 pt2a nil) 0 1)
- pt1 (trans pt1 0 1)
- pt2 (trans pt2 0 1)
- lst (cons (strcat (itoa n)
- ","
- (rtos (car pt) 2 3)
- ","
- (rtos (cadr pt) 2 3)
- ","
- r
- ",心"
- )
- lst
- )
- lst (cons (strcat (itoa (1- n))
- ","
- (rtos (car pt2) 2 3)
- ","
- (rtos (cadr pt2) 2 3)
- ","
- r
- ",末"
- )
- lst
- )
- lst (cons (strcat (itoa (- n 2))
- ","
- (rtos (car pt1) 2 3)
- ","
- (rtos (cadr pt1) 2 3)
- ","
- r
- ",首"
- )
- lst
- )
- )
- (entmake
- (list '(0 . "circle") (cons 10 (trans pt 1 0)) (cons 40 1))
- )
- (entmake (list '(0 . "text")
- '(100 . "AcDbEntity")
- '(100 . "AcDbText")
- (cons 10 (trans pt 1 0))
- (cons 1 (itoa n))
- (cons 40 1)
- )
- )
- (entmake (list '(0 . "text")
- '(100 . "AcDbEntity")
- '(100 . "AcDbText")
- (cons 10 (trans pt2 1 0))
- (cons 1 (itoa (1- n)))
- (cons 40 1)
- )
- )
- (entmake (list '(0 . "text")
- '(100 . "AcDbEntity")
- '(100 . "AcDbText")
- (cons 10 (trans pt1 1 0))
- (cons 1 (itoa (- n 2)))
- (cons 40 1)
- )
- )
- )
- (setq f (open "d:\\1.csv" "w"))
- (foreach n (cons "序号,X=,Y=,半径,点类别" lst)
- (write-line n f)
- )
- (close f)
- )
|
|