提取编号插件

linxiaoyun 2021.12.17 13:21 1040 0
结构设计 autolisp

在复杂的平面图上校对编号中,对属实麻烦,提取编号,将一一校对的难度降低不少。

本示例为按半圆排布。也可以分两步,先提取编号列表,然后一一查找对应位置:

思路非常简单,创建选择集后,分两次循环,第一次从中读取文字内容,以及各插入点,生成文字列表、实体名列表、插入点列表。

用各插入点计算出中心点,读取布置半圆的半径

第二次循环文字列表,生成特征文字。然后轮次连接特征文字与选择集中的文字。

	(setq i 0 n (length enlist))
	;(setq bpoint (getpoint "\n输入圆心点:"))
	(setq bpoint (wtou(mid_vertex ptlist)))
	(setq r  (getdist  bpoint "\n输入半径:"))
	(setq theta (* 1.0 (/ pi (- n 1)))) ;取半圆
	(repeat  n
	;(setq inspoint  (utow (list (car bpoint) (+ (cadr bpoint) (* i 5000)) 0)))
	;采用90°半圆环绕
	(setq inspoint (utow (polar bpoint (* i theta) r)))
    (setq en (nth i enlist))
	(setq en-txt (get-dxf 1 en ) )
	(setq i (1+ i))
	
	(setq typ (get-dxf 0 en) layname (get-dxf 8 en))
	(if (null(setq mycolor (get-dxf 62 en)))(setq mycolor 256))
	(setq fil-temp (list  (cons 0 typ)(cons 8 layname)(cons 62 mycolor ) (cons 1 (get-dxf 1 en))))
	
	;(defun make_text2( pt-text10 str layername mycolor / temp-list ucszdir)
	(make_text2 inspoint en-txt layname mycolor)

 

Last Modified·2021年12月17日 13:41

暂无评论

您尚未登录,请先才能评论。