Roy_043 发表于 2022-7-5 16:52:12

只需使用CopyObjects和ScaleEntity方法。

BIGAL 发表于 2022-7-5 16:57:28

我开始像Roy_043一样思考,只是使用复制粘贴和重新缩放。在最后一个布局旁边粘贴一个间隙。
 
马拉托维奇可能也有钱创建一个新的dwg,只需插入到主dwg。
 
我不使用advance steel,但如果一个项目没有一个包含多个布局的单个文件,这似乎很奇怪。你也检查过了吗。

maratovich 发表于 2022-7-5 17:01:10

我可以在VBA上这样做。或者做一个。exe程序
在不打开文件的情况下处理。
但我需要知道一切。
例如,什么比例?

Tharwat 发表于 2022-7-5 17:05:03

你好
 
试试这个程序,让我知道你做得怎么样。
 

(defun c:test (/ doc scl sel int pnt ent lst mvs)
;;------------------------------------;;
;;        Tharwat - Date: 26.07.2017        ;;
;; Move objects from Paper Space to        ;;
;; Model Space and scale them as per        ;;
;; the scale factor specified from        ;;
;; the user.                                ;;
;;------------------------------------;;
(if (and (or (/= (getvar 'ctab) "Model")
            (alert "Command is not allowed in Model Space <!>")
          )
          (setq scl (getdist "\nSpecify the scale factor :"))
          (princ "\nSelect objects to move to Model space then to scale :")
          (setq doc (vla-get-activedocument (vlax-get-acad-object))
                int -1
                pnt (vlax-3d-point '(0. 0. 0.))
                sel (ssget "_:L" '((0 . "~VIEWPORT")))
          )
   )
   (progn
   (while (setq ent (ssname sel (setq int (1+ int))))
       (setq lst (cons (vlax-ename->vla-object ent) lst))
   )
   (if (apply 'and
                (setq mvs (vlax-invoke
                            doc
                            'copyobjects
                            lst
                            (vla-get-modelspace doc)
                        )
                )
         )
       (progn
         (mapcar '(lambda (obj) (vla-scaleentity obj pnt scl)) mvs)
         (mapcar 'vla-delete lst)
       )
   )
   )
)
(princ)
) (vl-load-com)

ziele_o2k 发表于 2022-7-5 17:07:37

 
效果很好,这正是我需要的。

Tharwat 发表于 2022-7-5 17:10:24

 
很高兴听到这个。
页: 1 [2]
查看完整版本: 从图纸空间移动对象