87
« Last post by xdcad on April 09, 2024, 10:18:26 PM »
1. Intelligent, batch processing, full dwg processing does not need to be displayed on the screen.
2. The generated outsourcing dimension entity type is the same as the single-row continuous original annotation, and the starting point is.
3. Single rows composed of different types (alignment, corner) to generate corner outsourcing dimensions.
4. Intelligently determine whether outsourcing dimensions have been generated, and those that have been generated will not be processed.
. . . . .
(defun c:xdtb_dimwb (/ #dimlinepoint #rotation
#xline1point #xline2point
#ydir dimlinepnt ents i
j ss x
)
(xdrx-begin)
(xd::doc:getdouble
(xdrx-string-multilanguage
"\n外包尺寸偏移距离"
"\nOutsourcing dim offset distance"
)
"#xd-var-global-offset"
6.0
)
(if (setq ss (xdrx-ssget
(xdrx-string-multilanguage
"\n选择生成外包尺寸的标注对象<退出>:"
"\nSelect the dimension objects <Exit>:"
)
'((0 . "*dim*"))
)
)
(progn
(xdrx-runtime t)
(if (setq ents (xd::dim:group ss 3))
(progn
(setq i 0
j 0
)
(xdrx_ui_prgdlgbar
(xdrx-string-multilanguage "处理中: " "Processing: ")
(length ents)
0.5
"center"
)
(mapcar
'(lambda (x)
(xdrx_ui_prgdlgbar T)
(if (= (length x) 1)
(progn
(setq j (1+ j))
(setq x (car x))
(xdrx-getpropertyvalue
(car x)
"xline1point"
"dimlinepoint"
"ydir"
"xdir"
"rotation"
)
(xdrx-getpropertyvalue (last x) "xline2point")
(setq
dimlinepnt
(mapcar '+
#dimlinepoint
(xdrx-vector-product
#ydir
(- #xd-var-global-offset)
)
)
)
(if (or (xdrx-object-iskindof (car x) "acdbrot*")
(xdrx-object-iskindof (last x) "acdbrot*")
)
(progn (xdrx-dimension-makerotate
#xline1point
#xline2point
dimlinepnt
#rotation
)
)
(progn (xdrx-dimension-makealign
#xline1point
(xdrx-getpropertyvalue
(xdrx-getpropertyvalue (last x) "xline2")
"getclosestpointto"
#xline1point
t
)
dimlinepnt
)
)
)
(xdrx-entity-matchprop (car x) (entlast))
)
)
)
ents
)
(setq info (if (> j 0)
(xdrx-string-multilanguage
"生成了外包尺寸."
"Outsourcing dimensions generated."
)
(xdrx-string-multilanguage
"没有生成外包尺寸."
"Outsourcing dimensions were not generated."
)
)
)
(xdrx-prompt
(xdrx-string-formatex
(xdrx-string-multilanguage
"\n发现了 %d 组联排标注组,找到 %d 个单排标注,%s"
"\nFound %d Groups of linked Dim Groups, found %d single-row Dim Groups, %s"
)
(length ents)
j
info
)
)
)
)
(xdrx_ui_prgdlgbar)
(xdrx_prompt
(xdrx-string-multilanguage
"\n执行时间:"
"\nExecution time:"
)
(xdrx_runtime)
)
)
)
(xdrx-end)
(princ)
)