新手瞎闹,适用于总图尺寸.望高手们改进~- (defun c:xx1 (/ pt1 pt2 pt3 pt4 pt5 ang dis old old1)
- (setq old1 (getvar "blipmode"))
- (setvar "blipmode" 0)
- (setq lay (getvar "clayer"))
- (command "color" "bylayer")
- (command "layer" "m" "DM-尺寸标注" "c" "3" "DM-尺寸标注" "")
- (setq pt1 (getpoint "\n选择第一点:")
- pt2 (getpoint pt1 "\n选择另一点:")
- old (getvar "osmode")
- pt3(mapcar'(lambda(X Y)(/(+ X Y)2.0)) pt1 pt2);求中点
- ang (angle pt1 pt2)
- dis (distance pt1 pt2)
- pt4 (polar pt1 (+ pi ang) 1.0)
- pt5 (polar pt2 ang 1.0)
- )
- (setvar "osmode" 0)
- (drawcross pt1 ang);以P为基点,ang为角度绘制标记块
- (drawcross pt2 ang)
- (entmake (list (cons 0 "LINE") (cons 10 pt4) (cons 11 pt5)))
- (command "-text" "J" "BC" pt3 "2.5" (angtos ang) (rtos dis 2 2) "");谁能告诉我如何用entmake生成中下对齐的文字
- (setvar "osmode" old)
- (setvar "blipmode" old1)
- (command "layer" "s" lay "")
- )
|