; chevron island creater
; this use the extrim command to trim shape
; By Alan H Jan 2012
(defun C:Chevron ( / obj pt1 pt2 pt3 pt4 newpt1 newpt2 )
(acet-error-init (list
(list "cmdecho" 0
"highlight" 0
"regenmode" 1
"osmode" 0
"ucsicon" 0
"offsetdist" 0
"attreq" 0
"plinewid" 0
"plinetype" 1
"gridmode" 0
"celtype" "CONTINUOUS"
"ucsfollow" 0
"limcheck" 0
)
T ;flag. True means use undo for error clean up.
'(if redraw_it (redraw na 4))
);list
);acet-error-init
(setq obj (car (entsel "\nPick pline or circle")))
; should do a object test here
(setq whatis (cdr (assoc 0 (entget obj))))
(if (= whatis "LWPOLYLINE")
(princ)
(progn
(princ "\You have picked something other than a polyline ")
(princ "\Remake into a pline and do again ")
(setq dummy (getstring "\press any key"))
(exit)
) ; progn
) ; if
(setq pt1 (Getpoint "\nPick Line start point"))
(setq pt2 (Getpoint pt1 "\nPick end point"))
(command "line" pt1 pt2 "")
(setq gap1 (getreal "\nenter spacing 1"))
(setq gap2 (getreal "\nenter spacing 2"))
(setq pt3 (getpoint "\nPick 1st cross point"))
(setq pt4 (getpoint pt3 "\nPick 2nd cross point"))
(setq dist (distance pt3 pt4))
(setq x (fix (/ dist (+ gap1 gap2))))
(setq newpt1 (strcat (rtos gap1 2 2) ",0.0"))
(setq newpt2 (strcat (rtos gap2 2 2) ",0.0"))
(repeat x
(command "copy" "L" "" "0,0" newpt1)
(command "copy" "L" "" "0,0" newpt2)
)
(load "Extrim")
(etrim obj pt1)
(acet-error-restore)
) ; end defun
(princ)
请注意,指定圆的半径不需要引号。 谢谢大家的帮助。我很感激。
比格尔,谢谢你的雪佛龙例行节目。我和自己的关系如此密切,我决定继续坚持下去。 因此,我正在寻找帮助的这些位是一个更大的lisp的一部分,用于创建图案填充道路标记。lisp通过用户选择通常沿闭合多段线中间运行的多段线来工作。这将放置图案填充标记。通过选择闭合多段线,可以修剪图案填充标记。
Off40确定多段线外的点,以便将其传递给Extrim进行修剪,而无需选择围栏和边。
我遇到的问题与变量有关。lisp在第一次运行时就可以完美地工作。除了将输出线的宽度更改为0.1之外,它第二次似乎运行得很好。
(defun c:plpoint (/)
(vl-load-com)
(setq LP1 1)
(while LP1
(prompt "\nSelect polyline boundary: ")
(setq PSS (ssget "_:S" '((0 . "LWPOLYLINE"))))
(if (/= PSS nil)
(setq LP1 nil)
(prompt "\nNO POLYLINE SELECTED, TRY AGAIN. ")
)
)
(setq PPV (vlax-curve-getStartPoint (vlax-ename->vla-object (ssname PSS 0))))
(vl-princ-to-string PPV)
(vl-cmdf "_circle" PPV 3)
)
我运行了一些测试,发现变量outline在程序第一次完成后没有被释放。它会更改第一次运行时闭合多段线的宽度。
我知道这是一个本地化变量的问题,我已经阅读了Leemac关于这个主题的教程,但是当我把它添加到
(command "._pedit" outpline "_W" 0.1 "")
它会导致错误并使程序崩溃。
如果您能帮我解决这个问题,我将不胜感激。
(defun C:hatch_lining (/ sel1 ang coords elist midp offsetted p1 p2 p3 pline1 SUCE SUOM SUSM SUAB SUAD SUCL SUCR) 谁能告诉我这个? 以上代码是否完整?我不明白你在哪里定义了“输出线”。。。 创建(或从一开始)图案填充不是要容易得多吗? Can anyone give me a dig out with this? Is the above code complete?I don't see where you've defined "outpline"... Wouldn't it be much, much, much easier to create (or start with) a HATCH?
页:
1
[2]