pline画角码易出错
www.dimcax.com
pline画角码易出错
简单的一个铝合金角码程序,如果当前图纸中有类似的多义线曾经出现过,
则该程序一般不会出错,但是如果是新建的图纸用这个程序做肯定出错,不知为何.
难道需要初始化pline的什么参数不成?请高手赐教
;铝合金角码
(defun c:ljm ()
(sub-ljm)
(prin1)
)
(defun sub-ljm ()
(setvar "cmdecho" 0)
;指定插入点,宽,高,厚
(setq p1 (getpoint "\n 插入点:"))
(setq l1 (getreal "\n 宽<20>:"))
(if (null l1)
(setq l1 20)
)
(setq l2 (getreal "\n 高<20>:"))
(if (null l2)
(setq l2 20)
)
(setq thk (getreal "\n 厚<3>:"))
(if (null thk)
(setq thk 3)
)
;角码的6个点
(setq p2 (polar p1 0 l1))
(setq p3 (polar p2 (/ pi 2) l2))
(setq p4 (polar p3 pi thk))
(setq p5 (polar p4 (* pi 1.5) (- l2 thk)))
(setq p6 (polar p5 pi (- l1 thk)))
;pline
(command "pline" p1 p2 p3 p4 p5 p6 "c")
)
d
不知是出的什么错?从程序看仅仅是提示串中\n后多了空格,有可能在键盘输入时出错。
踅摸
d
难道getpoint与绘图边界有关系吗?
d
有哪些函数与绘图边界有关系呢?
d
当此程序在与所画尺寸的角码尺寸比较接近时则程序不会出错,如果尺寸相差过大则程序绘出几条重叠在一起的直线,不知道是什么大原因?
d
在画图前加一行(command ".zoom" "w" p1 p3),画线后加(command ".zoom" "p")
踅摸