大师求解,cad新开图纸如何控制在哪个窗口打开?
见附图





网友答: 除了自建ROT(running object table),别无他法。。。简单来说就是在每个CAD启动的时候,把他的com接口记录到某个位置。开图的时候选接口来开。

网友答: 没明白。cad不是在当前窗口打开其它图的吗?

网友答:
自贡黄明儒 发表于 2024-2-27 07:36
没明白。cad不是在当前窗口打开其它图的吗?

如图,黄老,明白否?


网友答:
  1. (setq AcadObject       (vlax-get-acad-object)
  2.         AcadDocument (vla-get-ActiveDocument AcadObject)
  3.         mSpace       (vla-get-ModelSpace AcadDocument)
  4. )
  5.   
  6. (setq msg "\r \n")
  7.   
  8. ;;; 处理整个文件集合,并取出已加载的  
  9.   
  10. ;;; 文件的名称  
  11.   
  12. (setq DocumentSel (vla-get-Documents AcadObject))
  13.   
  14. (VLAX-FOR Document DocumentSel
  15.     
  16.   (setq msg (STRCAT msg (vla-get-Name Document) "\r \n"))
  17. )

  18. ;Get the document collection object from the application
  19. ;and active the 2nd item in the collection:
  20. ;从应用程序获取文档集合对象
  21. ;并激活集合中的第二个项目:
  22. (setq docs (vla-get-documents (vlax-get-acad-object)))

  23. (vla-activate (vla-item docs 1))



部分代码示意

网友答: 不知道其他版本如何,我2020是直接往指定的CAD里拖,十几个图都是统一打开了

网友答: https://www.cnblogs.com/JJBox/p/13766772.html
遍历进程
  • 上一篇:cad转pdf速度慢
  • 下一篇:没有了