ht1480 发表于 2023-2-15 17:26:59

文本标注封闭多段线的边长和面积

首先感谢前辈们的函数。这个是用前辈的函数东拼西凑起来的功能。

还需要完善,角度相同的两段边长可以合并标注,两节点重合的多余节点删除,异形的图形面积不在圈内等等。
小白一个,凑个贴子数
(vl-load-com)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;函数部分
(setq *ACAD*(vlax-get-acad-object)
      *DOC*   (vla-get-ActiveDocument *ACAD*)
      *DOCS*(vla-get-Documents *ACAD*)
      *MS*    (vla-get-modelSpace *DOC*))
(defun C:bbc( / osmbak all pianyiliang zigao i ent obj1 lst n m p1 p2 an ds zxd bpt js)
(setvar "dimzin" 0)
(setq osmbak(getvar "osmode"))
(setvar "osmode" 0 )
(setq all (ssget '((0 . "LWPOLYLINE,POLYLINE"))));;获取多线段图元
(setq pianyiliang 0.30);;设置偏移量
(setq zigao 0.5);;;设置字高
(LayerExist "bc");;;创建bc图层
(setq i 0)
(repeat (sslength all)
(setq ent (ssname all i));;取得图元名
   (setq obj1 (vlax-ename->vla-object ent));;;多线段的对象属性
                  (entmake
                  (list '(0 . "TEXT")
                  (cons 1 (rtos (vla-get-area obj1) 2 2));;;(vla-get-area obj)提取到面积属性
                  (cons 10 (GetCentroid ent));;;(GetCentroid ent)质心点坐标,未采用几何中心
                  (cons 40 (* zigao 1.3))
                  (cons 11 (GetCentroid ent))
                  (cons 72 1)
                  (cons 73 2)
                  (cons 7 "宋体")
                  (cons 8 "bc")
                  ;(cons 50 an)   
                  ))
         (setq lst (mqb:getpt ent));;取得坐标点表
   (setq n 0)
   (setq m(length lst))
    (repeat m
;;;;(nth(rem(+ i(setq m(length lst)))m)lst)取列表第i个元素,主要用在首尾衔接
       (setq p1 (nth(rem(+ n m)m)lst))
       (setq n(+ 1 n))
       (setq p2 (nth(rem(+ n m)m)lst))
       (setq an (angle p1 p2))
       (setq ds (distance p1 p2))
       (setq zxd (polar p1 an (* ds 0.5)))
       (if (and (> an 1.62316)(< an 4.76475))
         (setq an(+ an pi))
       )
      (setq bpt(polar zxd (+ an 1.5708) pianyiliang))      
       (if (PtInPts lst bpt)
         (entmake
                  (list '(0 . "TEXT")
                  (cons 1 (rtos ds 2 2))
                  (cons 10 bpt)
                  (cons 40 zigao)
                  (cons 11 bpt)
                  (cons 72 1)
                  (cons 73 2)
                  (cons 7 "宋体")
                  (cons 8 "bc")
                  (cons 50 an)   
               ))
         (progn
          (setq bpt(polar zxd (- an 1.5708) pianyiliang))
            (entmake
                  (list '(0 . "TEXT")
                  (cons 1 (rtos ds 2 2))
                  (cons 10 bpt)
                  (cons 40 zigao)
                  (cons 11 bpt)
                  (cons 72 1)
                  (cons 73 2)
                  (cons 7 "宋体")
                  (cons 8 "bc")
                  (cons 50 an)   
               ))
         ))
      (setq js (append js (list an ds)))
    )
(setq i(+ 1 i))
)
;(setq js nil)
;( * 0.5 pi)
;(angtof "273")
;(angtos 2.3)
(setvar "osmode" osmbak)
)

;;146 [功能] 质心
;;示例 (GetCentroid (car(entsel)))
(defun GetCentroid (poly / AXERR CEN PL REG VA)
   (setq pl(vlax-ename->vla-object poly);;(setq pl (*En2Obj* poly)
      va (vlax-make-safearray vlax-vbObject '(0 . 0))
)
(vlax-safearray-put-element va 0 pl)
(setq axErr (VL-CATCH-ALL-APPLY 'vla-addregion (list *MS* va)))
(if (VL-CATCH-ALL-ERROR-P axErr)
    nil
    (progn
      (setq reg (car (vlax-safearray->list (vlax-variant-value axErr)))
            cen (vla-get-centroid reg)
      )
      (vla-delete reg)
      (vlax-safearray->list (vlax-variant-value cen))
    )
)
)

;;获取坐标函数图元名
(defun mqb:getpt(getptss / ptlst)
(setq ptlst (vl-remove-if 'not (mapcar '(lambda (x) (if (= (car x) 10) (cdr x))) (entget getptss))))
)
;; 判断图层是否存在(不存在则创建);;(LayerExist "dim")
(defun LayerExist (LayerName)
(if (tblobjname "LAYER" LayerName) ;(tblsearch "LAYER" "3")也可判断图层3是否存在
    nil
    (entmake (list
      '(0 . "LAYER")
      '(100 . "AcDbSymbolTableRecord")
      '(100 . "AcDbLayerTableRecord")
   ;'(6 . "CONTINUOUS") ;线型
   ;'(62 . 3)   ;颜色
      '(70 . 0);图层状态
      (cons 2 LayerName) ;图层名
      )
    )
)
)
;;以文字中心位置输出函数
(defun mqb:EntmakeText (PT STR Textheigh);以文字中心位置输出函数
(entmake
    (list '(0 . "TEXT")
   (cons 1 str)
   (cons 10 pt)
   (cons 40 Textheigh)
   (cons 11 pt)
   (cons 72 1)
   (cons 73 2)
   (cons 7 "宋体")   
    )
)
)
;;[功能] pt是否在点集包围范围内
(defun PtInPts (pts pt / P1 P2)
(setq
    pts (MAPCAR
   '(LAMBDA (p1 p2) (REM (- (ANGLE pt p1) (ANGLE pt p2)) PI))
   (CONS (LAST pts) pts)
   pts
)
)
(equal (ABS (APPLY '+ pts)) PI 1e-8)
)
;生成文字样式
(defun mqb:create-st (/ textstyles textstyle)
(setq textstyles (vla-get-textstyles *DOC*))
;(setq textstyle1 (vla-add textstyles "方正中等线_GBK"))
;(setq textstyle2 (vla-add textstyles "方正细等线简体"))
;(setq textstyle3 (vla-add textstyles "方正中等线简体"))
(setq textstyle4 (vla-add textstyles "宋体"))
;(vla-setfont textstyle1 "方正中等线_GBK" :vlax-false :vlax-false 1 0)
;(vla-setfont textstyle2 "方正细等线简体" :vlax-false :vlax-false 1 0)
;(vla-setfont textstyle3 "方正中等线简体" :vlax-false :vlax-false 1 0)
(vla-setfont textstyle4 "宋体" :vlax-false :vlax-false 1 0)
(setvar "cmdecho" 0)
(vl-cmdf "_.style" "" "" "" "1.0" "" "" "" "")
(princ)
)
(mqb:create-st)


(DEFUN C:6(/ osmbak txth p1 p2 p3 d1 a1 a2 p4 p5) ;单线标注
(command "layer" "m" "0" "")
                  (setq osmbak(getvar "osmode"))
                  (setvar "osmode" 1 )
                  ;(setq txth (getreal "输入注记字高:"))
                  (setq p1 ( getpoint "\n      点一下起点: "))
                  (setq p2 ( getpoint p1 "\n       点一下终止点: "))
                  (setvar "osmode" 0)
                  (setq p3 ( getpoint p2 "\n   点取标注点:"))
                  (setq d1 ( distance p1 p2 ))
(setq txth(+ 0.25 (* d1 0.003)))
                  (setq a1 ( angle p2 p1 ))
                  (setq a2 ( angle p2 p3 ))
                  (setq p4 ( polar p1 (- a1 pi ) (/ d1 2 )))
                  (if ( <= a2 a1 )
                        ( setq p5 ( polar p4 ( - a1 (/ pi 2)) (+ 0.05 (* txth 0.5))))
                           )
                  (if ( >= a2 a1 )
                        ( setq p5 ( polar p4 ( + a1 (/ pi 2)) (+ 0.05 (* txth 0.5))))
                           )
(LayerExist "bc")
(entmake
    (list '(0 . "TEXT")
   (cons 1 (rtos d1 2 2))
   (cons 10 p5)
   (cons 40 txth)
   (cons 11 p5)
   (cons 72 1)
   (cons 73 2)
   (cons 7 "宋体")
   (cons 8 "bc")
   (cons 50 (- a1 pi))   
    ))
                  (setvar "osmode" osmbak)
                  (princ)
                  )data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAATAAAAEKCAYAAACVGgk4AAAXI0lEQVR4Ae2dDZarIAxGuy4X5HpcTTczi2EOahStVayCCdw55z2tPwjJl5tIbft6vV6Of9gADaABoxrAcUYdR+Ih+aIBgheAowE0YFgDOM+w88jAVGG1awCAATA0gAbMasBsx2vPPIyf6gsNkHkAOBpAA4Y1gPMMO48MTBVWuwYAGABDA2jArAbMdrz2zMP4qb7QAJkHgKMBNGBYAzjPsPPIwFRhtWsAgAEwNIAGzGrAbMdrzzyMn+oLDZB5ADgaQAOGNYDzDDuPDEwVVrsGABgAQwNowKwGzHa89szD+Km+0ACZB4CjATRgWAM4z7DzyMBUYbVrAIABMDSABsxqwGzHa888jJ/qCw2QeQA4GkADhjWA8ww7jwxMFVa7BgAYAEMDaMCsBsx2vPbMw/ipvtAAmQeAowE0YFgDOM+w88jAVGG1awCAATA0gAbMasBsx2vPPIyf6gsNkHkAOBpAA4Y1gPMMO48MTBVWuwYAGABDA2jArAbMdrz2zMP4qb7QA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VWWi0adDt8XWW+8aLrcFnOpXNY6JPhnLmjhMAvC5ZR/NwSR4/7jB5gOfz/VxUyc9aWcshY9VzFvntc02iBdtBYgykSEQbQLZ6I9M6r9d13+gOWYuSY/OZkTNa8BKj39O+sJsxzcCi7GcdP4lG/rw7wxUXjOmhrWcNuJayWMy+QUuBQkC0OsfjwNt/lnDSmMftdnMeH/0Bohxw6oL7hT2fBIQwIrY5SulmXO7DNpcEFsDKwWQadMcFM11+HLAIdL7fX43xNawurt9NHC/Bh6yaTEDAWwPV5O/QgZYEYMX4IfxLhgPaAbQjAXYGljYnxi8oAGMd8F4ACwAmLfjGmJrWK33Y3vi76IGMOBFAwKxDYgJuLAt8ZVYAxg4sYEB3Apw2JuYu1EDGPNGYwIrYIUG8moAgAEwNIAGzGrAbMfJdHkzHfbG3ho1AMDIvmgADZjVgNmOa8wG9IkqBQ3k1QAAI/uiATRgVgNmO06my5vpsDf21qgBAEb2RQNowKwGzHZcYzagT1QpaCCvBgAY2RcNoAGzGjDbcTJd3kyHvbG3Rg0AMLIvGkADZjVgtuMaswF9okpBA3k1AMDIvmgADZjVgNmOk+nyZjrsjb01agCAkX3RABowqwGzHdeYDegTVQoayKsBAEb2RQNowKwGzHacTJc302Fv7K1RAwCM7IsG0IBZDZjtuMZsQJ+oUtBAXg0AMLIvGkADZjVgtuNkuryZDntjb40aAGBkXzSABsxqwGzHNWYD+kSVggbyagCAkX3RABowqwGzHSfT5c102Bt7a9QAACP7ogE0YFYDZjuuMRvQJ6oUNJBXAwCM7IsG0IBZDZjtOJkub6bD3thbowYAGNkXDaABsxow23GN2YA+UaWggbwaAGBkXzSABmxq4B/Y9n+3jqecFQAAAABJRU5ErkJggg==

ht1480 发表于 2023-2-16 11:32:53

kfh 发表于 2023-2-15 22:09
字体高度怎么设置?

我自己用的小工具,不需要改字高所以没有加设置的功能,你不经常改字高的话可以把
(setq pianyiliang 0.30);;设置偏移量
(setq zigao 0.5);;;设置字高,这两行代码删掉
不经常改字高的话就写
(if (= shezhizg nil) (setq zigao 0.5)(setq zigao shezhizg))
(setq pianyiliang (* zigao 0.6))
想改字高时就在命令行里输入(setq shezhizg *字高的数字值*)
改的特别频繁的话你就改成
(setq zigao (getreal "请输入字高:"))
(setq pianyiliang (* zigao 0.6))
这样每次标注前会提示输入字高

ht1480 发表于 2023-2-17 09:32:24

BHL-DONG 发表于 2023-2-17 09:25
不知道为啥,我是按ctrl+a复制的,加载进去就显示语法错误,不过楼主你发的就没有问题

复制代码时我也遇到过,最常见的有两点
1、复制选择时,代码最末尾的括号给漏掉了。
2、粘贴到编辑器里时有时是中文输入状态,括号那些符号是中文的符号,代码就报错。

ht1480 发表于 2023-2-15 17:30:46

效果图看不到

magicheno 发表于 2023-2-15 19:11:48

感谢大佬分享~

kfh 发表于 2023-2-15 22:09:06

字体高度怎么设置?

BHL-DONG 发表于 2023-2-16 09:41:33

加载进cad显示语法错误

ht1480 发表于 2023-2-16 11:38:15

BHL-DONG 发表于 2023-2-16 09:41
加载进cad显示语法错误

也许是你没有复制完整吧

hzyhzjjzh 发表于 2023-2-16 12:46:18

感谢大佬分享~{:1_1:}

BHL-DONG 发表于 2023-2-17 09:25:34

ht1480 发表于 2023-2-16 11:38
也许是你没有复制完整吧

不知道为啥,我是按ctrl+a复制的,加载进去就显示语法错误,不过楼主你发的就没有问题
页: [1] 2
查看完整版本: 文本标注封闭多段线的边长和面积