QWQWQWQ
发表于 2013-3-22 13:33:55
E:\GIF动画录制
QWQWQWQ
发表于 2013-3-22 13:37:23
要 这 样 的
xyp1964
发表于 2013-3-24 07:46:12
可能的效果:
tianyi1230
发表于 2013-3-25 20:46:32
院长无所不能啊,强悍,但是还是太飘忽了,远在高端仰望
669423907
发表于 2013-3-25 21:10:06
论坛早就有了:
;等分尺寸(dwg001)
(defun c:dfcc(/ ang dist dxf ent i j obj p0 p1 p2 r)
(command "undo" "be")
(setq J (getint "\n请输入等分数:")
obj (entsel "\n请选择需等分的标注:")
ent (car obj)
dxf (entget ent))
(if (and obj (> J 1) (= (cdr (assoc 0 dxf)) "DIMENSION"))
(progn (setq i 0 r 0)
(setq P0 (cdr (assoc 10 dxf))
P2 (cdr (assoc 13 dxf))
P1 (cdr (assoc 14 dxf)))
(setq ang (angle P1 P2))
(setq dist (/ (distance P1 P2) J))
(setq P2 (polar P1 ang dist))
(command "dim1" "ali" P1 P2 P0 "")
(while (< r (- J 1))
(setq P2 (polar P2 ang dist))
(command "dim" "con" P2 "" "e")
(setq r (1+ r)))
(setq i (1+ i))
(entdel ent)))
(command "undo" "e")
(princ))
cable2004
发表于 2013-3-25 22:41:56
本帖最后由 cable2004 于 2013-3-25 22:42 编辑
楼上的太简单了,只能对起点 终点都平行尺寸线的情况下使用!
tianyi1230
发表于 2013-3-25 23:44:37
defun c:df (/ang ang1-0 dimstl dist dxf ent i inter j l lay obj oldecho oldla oldmode oldsty p0 p0- p1 p2 p2- r)
(setq oldmode (getvar 'osmode)
oldla (getvar 'clayer)
oldecho (getvar 'cmdecho)
oldsty(getvar 'dimstyle)
)
(setvar 'osmode0)
(setvar 'cmdecho 0)
(while (setq obj (entsel "\n...选择需等分的标注> "))
(setq
J (getint "\n...输入等分标注数> ")
ent (car obj)
dxf (entget ent)
lay (cdr (assoc 8 dxf))
dimstl (cdr (assoc 3 dxf))
)
(if (and obj (> J 1) (= (cdr (assoc 0 dxf)) "DIMENSION"))
(progn
(setq i 0
r 0
)
(command "-layer" "s" lay "")
(command "dimstyle" "r" dimstl)
(setq P0 (cdr (assoc 10 dxf))
P2 (cdr (assoc 13 dxf))
P1 (cdr (assoc 14 dxf))
)
(setq L (distance p1 p0)
ang1-0 (angle P1 P0)
p0- (polar p0(- ang1-0(/ pi 2)) 50)
p2- (polar p2ang1-0 50)
inter (inters p0 p0-p2 p2- nil))
(if (/= L (distance p2 inter))(progn
(setq dxf (subst
(cons 13 (polar inter (- ang1-0 pi) L))
(assoc 13 dxf)
dxf) )
(entmod dxf)
(setqP2 (cdr (assoc 13 dxf)))
) );end_ if
(setq ang(angle P1 P2)
dist (/ (distance P1 P2) J)
P2 (polar P1 ang dist)
)
(command "dim1" "ali" P1 P2 P0 "")
(while (< r (- J 1))
(setq P2 (polar P2 ang dist))
(command "dim" "con" P2 "" "e")
(setq r (1+ r))
)
(setq i (1+ i))
(entdel ent)
)
)
(setvar 'clayer oldla)
(command "dimstyle" "r" oldsty)
)
(princ "\n...等分标注数=")
(princ J)
(princ "\n...[学lisp练习: 尺寸标注等分]")
(setvar 'osmode oldmode)
(setvar 'cmdecho oldecho)
(princ)
)
QWQWQWQ
发表于 2013-3-26 08:03:04
tianyi1230 发表于 2013-3-25 23:44 static/image/common/back.gif
defun c:df (/ang ang1-0 dimstl dist dxf ent i inter j l lay obj oldecho oldla oldmode oldsty p0 p0 ...
出现错误了?D:/等分标注线DF.lsp") 错误 : 参数类型错误: numberp: nil
QWQWQWQ
发表于 2013-3-26 08:07:28
669423907 发表于 2013-3-25 21:10 static/image/common/back.gif
论坛早就有了:
;等分尺寸(dwg001)
(defun c:dfcc(/ ang dist dxf ent i j obj p0 p1 p2 r)
谢谢,可以用了
q530496591
发表于 2013-3-26 09:37:42
留个记号先!还不到七个字!打够七个字!