keiths 发表于 2022-7-5 23:55:34

偏移量例程

建议需要按照以下内容编写一个小例程。。
 
 
 
 
命令:_offset
当前设置:擦除源=无层=源偏移GAPTYPE=0
指定偏移距离或[通过/擦除/层]:3.25
选择要偏移的对象或[退出/撤消]:
指定要偏移的边上点或[退出/多次/撤消]:
选择要偏移的对象或[退出/撤消]:*取消*
命令:
命令:_offset
当前设置:擦除源=无层=源偏移GAPTYPE=0
指定偏移距离或[通过/擦除/层]:。75
 
 
 
当做
 
基思

Tharwat 发表于 2022-7-6 00:14:27


 


(defun c:Test (/ l i s p)
(setq l (list 3.25 0.75)
       i -1
)
(while (< i 1)
   (if (and (setq s (car (entsel (strcat "\n Select object to ofsset < " (rtos (nth (setq i (1+ i)) l) 2 2) " > :"))))
            (setq p (getpoint "\n Specify point on side to offset :"))
       )
   (command "_.offset" (nth i l) s "_none" p "")
   )
)
(princ)
)

satishrajdev 发表于 2022-7-6 00:25:01

(setq A (list 3.25 0.75))<- Make list of According to your offset distance
(foreach B A
         (vla-offset
       (vlax-ename->vla-object (car (entsel "\n Select object to offset ;")))
       B
         )
)

Tharwat 发表于 2022-7-6 00:32:27

Satish,假设用户错过了对象,那么命令行的结果是什么?

keiths 发表于 2022-7-6 00:53:56

很好,谢谢。

Tharwat 发表于 2022-7-6 01:07:17

不客气。
页: [1]
查看完整版本: 偏移量例程