hosyn 发表于 2022-7-5 22:56:04

我们如何连接选定的bl

如何通过lisp将选定的块与pline连接。。。。。。。。。。

BIGAL 发表于 2022-7-5 23:01:44

measure会做到的。或分割

neophoible 发表于 2022-7-5 23:05:07

我希望这回答了你的问题。一、 首先,他根本不理解这个问题。如果问题尚未解决,请发布一张DWG,精确描述您试图实现的目标。

hosyn 发表于 2022-7-5 23:11:39

thnx到bigal和neophibl
我的问题是,当我们在图形中定位某个块时,现在需要命令,当我们在运行该命令后选择该块时,该块将连接在一起(该命令的基础)
可以是lisp或宏..)

hosyn 发表于 2022-7-5 23:13:50

thnx到bigal和neophibl
我的问题是,当我们在图形中定位某个块时,现在需要命令,当我们在运行该命令后选择该块时,该块将连接在一起(该命令的基础)
可以是lisp或宏..)

neophoible 发表于 2022-7-5 23:17:56

因此,看起来您只需要绘制一条具有单个直线段的样线,其端点是两个选定块的插入点。是这样吗?如果是这样,一个简单的宏就可以做到。在AutoLISP中,您可以:
(command "pline" "ins" pause "ins" pause "")
 
考虑到国际适用性,我应该写出来
 
(command "_.pline" "_ins" pause "_ins" pause "")

SLW210 发表于 2022-7-5 23:23:27

我将你的帖子转移到AutoLISP、Visual LISP和DCL论坛。

alanjt 发表于 2022-7-5 23:26:19

如果我理解正确(未经测试):
 
(defun c:l2b (/ lst)
(if (and (AT:GetSel entsel "\nSelect first block: " (lambda (x / d) (if (eq (cdr (assoc 0 (setq d (entget (car x))))) "INSERT")
                                                                        (setq lst (list (assoc 10 d) (assoc 210 d)))
                                                                     )
                                                   )
          )
          (AT:GetSel entsel "\nSelect second block: " (lambda (x / d) (if (eq (cdr (assoc 0 (setq d (entget (car x))))) "INSERT")
                                                                         (setq lst (cons (assoc 10 d) lst))
                                                                      )
                                                      )
          )
   )

   (entmakex (append '((0 . "LWPOLYLINE") (100 . "AcDbEntity") (100 . "AcDbPolyline") (90 . 2)) lst))
)
(princ)
)



(defun AT:GetSel (meth msg fnc / ent)
;; meth - selection method (entsel, nentsel, nentselp)
;; msg - message to display (nil for default)
;; fnc - optional function to apply to selected object
;; Ex: (AT:GetSel entsel "\nSelect arc: " (lambda (x) (eq (cdr (assoc 0 (entget (car x)))) "ARC")))
;; Alan J. Thompson, 05.25.10
(while
   (progn (setvar 'ERRNO 0)
          (setq ent (meth (cond (msg)
                              ("\nSelect object: ")
                        )
                  )
          )
          (cond ((eq (getvar 'ERRNO) 7) (princ "\nMissed, try again."))
                ((eq (type (car ent)) 'ENAME)
               (if (and fnc (not (fnc ent)))
                   (princ "\nInvalid object!")
               )
                )
          )
   )
)
ent
)
 
伙计,用记事本编码,没有格式化,真是糟透了。我简直不敢相信我学会了这样编码。

neophoible 发表于 2022-7-5 23:29:41

我在我的版本中使用它没有任何问题!但是,后来,我开始使用edlin。

alanjt 发表于 2022-7-5 23:32:21

 
我一路上都很忙。
页: [1] 2
查看完整版本: 我们如何连接选定的bl