tgibbo 发表于 2022-7-5 17:53:10

使用Autolisp圆角

谁能帮我解决这个小问题???
代码底部是FILLET命令。我不能太努力。这条线前后的一切都很好。
 
(defun c:qqq (/ a BarLength InsertPoint FirstBar SecondBar FirstLine
               SecondLine ThirdLine FourthLine)
(savevartoold) (reobarlayer) (setvar "Osmode" 1) (setvar "orthomode" 0)
   (setq BarLength (getreal "\nEnter New Bar Length or Use <500>"))
   (setq a "T")
   (while a
   (setvar "osmode" 1)
   (setq InsertPoint (getpoint "\nSelect Insertion Corner:"))
   (initget 33) (setvar "osmode" 513)
   (setq FirstBar (getpoint InsertPoint "\nFirst corner bar direction:")
      SecondBar (getpoint InsertPoint "\nSecond corner bar direction:"))
(progn
    (command ".pline" InsertPoint FirstBar "")
    (setq FirstLine (entlast))      
    (command ".lengthen" FirstLine"T" 500 FirstBar ""
             ".offset" 25 FirstLine SecondBar "")
    (setq ThirdLine (entlast)))
(progn
    (command ".pline" InsertPoint SecondBar "")
    (setq SecondLine (entlast))
    (command ".lengthen" SecondLine "T" 500 SecondBar ""
             ".offset" 25 SecondLine FirstBar "")
    (setq FourthLine (entlast)))
(progn
    (command ".fillet" ThirdLine FourthLine                        ;THIS IS THE COMMAND LINE I'M HAVING TROUBLE WITH;
             ".lengthen" "T" 500 ThirdLine FourthLine ""
             ".erase" FirstLine SecondLine ""))   
    (if (= FirstPoint "") (setq a nil))
   )
(resetoldvar)      
(princ)   
)
转角钢筋。pdf

tombu 发表于 2022-7-5 18:43:33

圆角修剪(或加长加长)的线条端点取决于在线条上拾取的位置。没有拾取点,它根本无法工作。计算端点并使用entmake或addline来创建它们,而不是使用所有这些命令函数。

BIGAL 发表于 2022-7-5 19:05:08

创建一些代码
 

(command ".fillet" ThirdLine FourthLine

(setq 3pt (polar insertpoint (angle insertpt firstbar) 5))
(setq 4pt (polar insertpoint (angle insertpt secondbar) 5))
(command ".fillet" 3pt 4pt
页: [1]
查看完整版本: 使用Autolisp圆角