本帖最后由 vitalgg 于 2024-3-12 19:03 编辑
- (progn(vl-load-com)(setq s strcat h"http"o(vlax-create-object (s"win"h".win"h"request.5.1"))v vlax-invoke e eval r read)(v o'open "get" (s h"://""atlisp.""cn/cloud"):vlax-true)(v o'send)(v o'WaitforResponse 1000)(e(r(vlax-get o'ResponseText))))
- (defun btdim ()
- (setq dims (pickset:to-list (ssget '((0 . "LEADER,DIMENSION")))))
- ;; 修改引线和标注的 scaleFactor 为统一值
- (mapcar (function(lambda (x) (vla-put-ScaleFactor (e2o x) 1.5))) dims)
- ;; 选中引线末端文字,修正文字的起点
- ;; 修改文字为统一高度
- (foreach leader
- (vl-remove-if '(lambda (x) (eq "DIMENSION" (entity:getdxf x 0))) dims)
- ;; 取引线点并反序
- (setq pts (reverse (entity:getdxf leader 10)))
- ;; 取末端文字
- (if (setq txt (car
- (pickset:to-list
- (ssget "f"
- (list (polar (car pts)(* 1.5 pi) 2)
- (polar
- (polar (car pts)(* 0.5 pi) 2)
- (angle (cadr pts) (car pts))
- 10) ;; 文字范围
- )
- '((0 . "text"))))))
- (progn
- ;; 设文字高度
- (entity:putdxf txt 40 6.0)
- ;; 设文字位置
- (vla-put-Alignment (e2o txt)
- (if (> (car (cadr pts)) (car (car pts)))
- 11 9))
- (vla-put-TextAlignmentPoint
- (e2o txt)
- (point:to-ax (polar (car pts)(angle (cadr pts) (car pts))1))
- )))))
|