- (defun C:qxtopl ( / aa dis dist len n pt pt0 pt1 ptlist ss)
- (princ "\n 选择所要修改的曲线:")
- (setq ss (ssget '((0 . "SPLINE")))
- ss (ssname ss 0)
- aa (getint "\n 分为段数<10>[10/50/100]:")
- n 1
- )
- (if (= aa nil)
- (setq aa 10)
- )
- (setq pt0 (vlax-curve-getStartPoint ss)
- pt1 (vlax-curve-getEndPoint ss)
- len (vlax-curve-getDistAtPoint ss pt1)
- dis (/ len aa)
- ptlist (list pt0)
- )
- (repeat aa
- (setq dist (* n dis))
- (setq pt (vlax-curve-getPointAtDist ss dist))
- (setq ptlist (cons pt ptlist))
- (setq n (+ n 1))
- )
- (entmake (append (list '(0 . "LWPOLYLINE") '(100 . "AcDbEntity") '(100 . "AcDbPolyline") (cons 90 (length ptlist)))
- (mapcar '(lambda (pt)(cons 10 pt)) ptlist ))
- )(princ)
- )
|