DKT Posted November 17, 2010 Posted November 17, 2010 I've experimented with smaller LISP routines, but my attempts at a bigger project (still pretty small) haven't quite worked. Hopefully someone has some snippits of code that would help. Here's what I'm trying to accomplish; Invert selection Delete new selection (essentially just leaving what was originally selected) Purge all extra layers Delete all paper-space tabs Zoom to extents (in modelspace) Plot to a printer named "Adobe PDF" I do this routine multiple times throughout the day and a LISP routine would be oh so lovely... I just don't know how. My biggest problem comes in deleting the paper-space tabs and plotting, the rest I think I can figure out. Any help would be appreciated! DKT Quote
alanjt Posted November 17, 2010 Posted November 17, 2010 FYI, you have to have at least one paperspace tab. However, you could delete with: (vlax-for x (vla-get-layouts (vla-get-activedocument (vlax-get-acad-object))) (or (eq "Model" (vla-get-name x)) (vla-delete x))) For plotting, look at vla-plottofile or (command "_.-plot" ...) Quote
Lee Mac Posted November 17, 2010 Posted November 17, 2010 A pointer for deleting the inverse selection perhaps: (defun DeleteInverse ( sel / all ) (if (and sel (setq all (ssget "_X"))) ( (lambda ( i / e ) (while (setq e (ssname all (setq i (1+ i)))) (or (ssmemb e sel) (entdel e)) ) ) -1 ) ) ) Feed with user selectionset Quote
alanjt Posted November 17, 2010 Posted November 17, 2010 Don't forget to account for locked layers. Quote
Lee Mac Posted November 17, 2010 Posted November 17, 2010 Don't forget to account for locked layers. Won't error, but yeah, user would have to include routines to unlock all layers if need be. Quote
alanjt Posted November 18, 2010 Posted November 18, 2010 Won't error, but yeah, user would have to include routines to unlock all layers if need be. Oh, I know. That's why it wasn't directed at you. Quote
DKT Posted November 18, 2010 Author Posted November 18, 2010 Thanks! I think I have all the bits I need now, except the plotting. Do you have an example of that code that I could mess with to make it work for my purpose? DKT Quote
Lee Mac Posted November 18, 2010 Posted November 18, 2010 Thanks! I think I have all the bits I need now, except the plotting. Do you have an example of that code that I could mess with to make it work for my purpose? DKT Two ways you can do it DKT, 1) Using the plot command in a command call - just submitting the data to the prompts. 2) Using vla-PlotToDevice, and either configuring the plot configuration of the layout to how to want it, or use a separate PC3 configuration file. I wrote a BatchPlotter a while back, to perform a centered extents plot on multiple drawings, but unfortunately its not freeware Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.