- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hey everyone! First post. I apologize for any lapses in etiquette. I promise, I have been looking this up already and haven't been able to find anything on it. Thanks!
Background: With a drawing already open, I want to open another drawing, select all objects no a few layers, copy and close without saving.
Where I'm at: I currently have a half working code that almost does everything, however, even thought I am activating the second drawing, it's still selecting the objects from the original drawing that is still open instead of the one that I'm opening to get the selected objects from.
Code so far:
(defun c:IMPORTSITE (/)
; open dwg
(setq acApp (vlax-get-acad-object))
(setq acDocs (vla-get-documents acApp))
(vla-activate
(vla-open acDocs "[filepath to dwg file]")
)
; Delay 5 seconds while the file is opened
(command "DELAY" 5000)
; Select all line work layers for the site and N arrow
(sssetfirst nil (ssget "_X" '((8 . "cxsite,cxarrow"))))
; copy lines
(initcommandversion) (command "._copy")
)
Thank you to whomever can help!
Solved! Go to Solution.