Visual LISP, AutoLISP and General Customization
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
export parts of drawing to another dwg....
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
i've searche but didn't find answer...
i have one big pipeline drawing and need to "split" it into smaller drawings...
there are layers, v500, v250, v100 that represent size of pipeline.
i'd like to extract all elements from layer v500 to drawing v500.dwg, after that v250... etc.
problem is that i would select only elements from v500, erase all other and than save it as v500.dwg... and then what? undo all and repeat everything with another layer?
is there a way to copy elements to another drawing and save and then return to original drawing and execute another set of commands?
thnx!
Solved! Go to Solution.
Re: export parts of drawing to another dwg....
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Hi,
I'm not sure about your work flow, but there are several ways to copy entities from one dwg to another, Ctrl+C/Ctrl+V, wblock/insert, export using some intermediate format, etc . As for the layers issue and selection, you can use qselect to filter the entities, or make some layer filter in the layer manager and activate it before selection, or use the filter command to make a selection set, also a lisp using ssget with a filter, etc.
Gaston Nunez
Re: export parts of drawing to another dwg....
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
vladimir.ninic wrote:.....
is there a way to copy elements to another drawing and save and then return to original drawing and execute another set of commands?...
thnx!
(defun wblayer (lst path / aDoc) (vl-load-com) (setq aDoc (vla-get-ActiveDocument (vlax-get-acad-object))) (foreach lyr lst (if (ssget "_x" (list (cons 8 lyr))) (progn (vla-wblock aDoc (strcat path lyr ".dwg") (setq objts (vla-get-ActiveSelectionSet aDoc)) ) (vla-delete objts) ) ) ) (princ) )
USAGE
(wblayer '("v500" "v250" "v100") "C:\\Users\\path\\sample\\")
HTH
Re: export parts of drawing to another dwg....
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
I'd probably just use the FILTER command and copy / paste to original coordinates into a new drawing
Re: export parts of drawing to another dwg....
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Why not just use the WBLOCK command to send objects out to their own drawing while leaving you in the current drawing?
Re: export parts of drawing to another dwg....
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Select, ERASE, SAVEAS and UNDO and repeat? What are you using, AutoCAD version1? Forgive my surprise at your post, no offense meant or directed at you.
If the objects are on seaprate layers, why do you need to erase the other objects on all the other layers first? Do you not know you can make active the one layer and freeze all the others?
In addition to the comments about using WBLOCK command noted above.
While the code provided above is great and a quick method, you appear to be missing some key built-in AutoCAD features IMHO and might benefit from a good basic overview tutorial/lesson or a **** good book.
Re: export parts of drawing to another dwg....
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
sorry for asking for advice. noone said that i know that much lisp... thnx for advice...
Re: export parts of drawing to another dwg....
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
No, I was not questioning why you posted, I was asking why you did not try the correct built-in feautres of AutOCAD that require no lisp to do what you want.
You posted this, which is very much the wrong way to do what you want:
"problem is that i would select only elements from v500, erase all other and than save it as v500.dwg... and then what? undo all and repeat everything with another layer?"
And then you asked:
"is there a way to copy elements to another drawing and save and then return to original drawing and execute another set of commands?"
You don't need lisp to do things already avaiable in AutoCAD, Lisp is to speed the process up. LAYISO and WBLOCK in your file would have been all you needed to do inside AutoCAD, without lisp.
Re: export parts of drawing to another dwg....
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
ok. let's stop. i've asked for advice, so i can understand concept so i can write my lisp file... next time i'll explain better...
thnx!
Re: export parts of drawing to another dwg....
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
For what its worth,I did use Wblock ![]()
