基本上,我们有一个例程,它列出了一组线的几何图形,它要求一个原点(基点)以及方向(我们在等轴测中设计)。。我需要帮助编辑例程,以便在例程绘制的基点插入实心甜甜圈。这是例行程序。
- (defun c:SOCKET (/ test oldsnap oldorth p1 p2 xp1 xp2 yp1 yp2)
- (setvar "cmdecho" 0) (command "undo" "m")
- (defun drawsock (/ e1)
- (command "._pline" p3 "w" "0.0" "0.0" p4 p5 p6 "") (setq e1 (entlast))
- (setq sockgrp (ssget "l"))
- (prin1))
- (defun one () (drawsock) (prin1))
- (defun two () (drawsock)
- (command "._rotate" sockgrp "" p1 "180.0") (prin1))
- (defun three (/ px) (drawsock)
- (setq px (make_pt p1 (dtr 90.0) 0.1))
- (command "._mirror" sockgrp "" p1 px "y")
- (command "._rotate" sockgrp "" p1 "180.0") (prin1))
- (defun four (/ px) (drawsock)
- (setq px (make_pt p1 (dtr 90.0) 0.1))
- (command "._mirror" sockgrp "" p1 px "y") (prin1))
- (defun five (/ px) (drawsock)
- (setq px (make_pt p1 (dtr 90.0) 0.1))
- (command "._mirror" sockgrp "" p1 px "y")
- (command "._rotate" sockgrp "" p1 "60.0") (prin1))
- (defun six () (drawsock)
- (command "._rotate" sockgrp "" p1 "300.0") (prin1))
- (defun seven () (drawsock)
- (command "._rotate" sockgrp "" p1 "120.0") (prin1))
- (defun eight (/ px) (drawsock)
- (setq px (make_pt p1 (dtr 90.0) 0.1))
- (command "._mirror" sockgrp "" p1 px "y")
- (command "._rotate" sockgrp "" p1 "240.0") (prin1))
- (defun nine (/ px) (drawsock)
- (setq px (make_pt p1 (dtr 90.0) 0.1))
- (command "._mirror" sockgrp "" p1 px "y")
- (command "._rotate" sockgrp "" p1 "120.0") (prin1))
- (defun ten (/ px) (drawsock)
- (setq px (make_pt p1 (dtr 90.0) 0.1))
- (command "._mirror" sockgrp "" p1 px "y")
- (command "._rotate" sockgrp "" p1 "300.0") (prin1))
- (defun eleven () (drawsock)
- (command "._rotate" sockgrp "" p1 "240.0") (prin1))
- (defun twelve () (drawsock)
- (command "._rotate" sockgrp "" p1 "60.0") (prin1))
- (defun right ()
- (if (and (< xp1 xp2) (< yp1 yp2)) (three))
- (if (and (> xp1 xp2) (> yp1 yp2)) (four))
- (if (and (= xp1 xp2) (> yp1 yp2)) (six))
- (if (and (= xp1 xp2) (< yp1 yp2)) (seven))
- (prin1))
- (defun top ()
- (if (and (< xp1 xp2) (> yp1 yp2)) (nine))
- (if (and (> xp1 xp2) (< yp1 yp2)) (ten))
- (if (and (> xp1 xp2) (> yp1 yp2)) (eleven))
- (if (and (< xp1 xp2) (< yp1 yp2)) (twelve))
- (prin1))
- (defun left ()
- (if (and (< xp1 xp2) (> yp1 yp2)) (one))
- (if (and (> xp1 xp2) (< yp1 yp2)) (two))
- (if (and (= xp1 xp2) (> yp1 yp2)) (five))
- (if (and (= xp1 xp2) (< yp1 yp2)) (eight))
- (prin1))
- (defun setpnts (/ p3 p4 p5 p6)
- (setq p3 (make_pt p1 (dtr 49.10660529) 0.08267973))
- (setq p4 (make_pt p1 (dtr 90.0) 0.09375))
- (setq p5 (make_pt p1 (dtr 270.0) 0.09375))
- (setq p6 (make_pt p1 (dtr 293.41322449) 0.13621559))
- (if (= test 0) (left)) (if (= test 1) (top)) (if (= test 2) (right))
- (prin1))
- (setq oldsnap (getvar "snapstyl")) (setvar "snapstyl" 1)
- (setq oldorth (getvar "orthomode")) (setvar "orthomode" 1)
- (setq p1 (getpoint "\nOrigin point: "))
- (initget 32) (setq p2 (getpoint p1 "\nDirection of line: "))
- (setq test (getvar "snapisopair")) (setq headtype 1)
- (setq xp1 (car p1)) (setq xp2 (car p2))
- (setq yp1 (cadr p1)) (setq yp2 (cadr p2))
- (setpnts)
- (setvar "snapstyl" oldsnap) (setvar "orthomode" oldorth) (prin1))
下面是我们使用的甜甜圈命令和大小。
- (command "donut" "0" ".0670"))
我想把油炸圈饼放在正在绘制的对象的基点上。请帮忙,我会很感激的。稍后将发布快照。 |