JovanG Posted March 4, 2021 Posted March 4, 2021 Hi Every one. Today I`m trying to find the way to import a specific block from specific dwg, and I`ve found This great program of Lee Mac that allow me to selected it, but I would like to avoid the selection step in this case because I have to do it with a lot of drawings and the block is the same in each one. In fact I've already done a small change that avoid the file selection dialog box: ...(cond ( (not (setq dwg "C:/Users/User/Desktop/Jovan G/MyDWG.dwg"))... but I haven`t figured out how to avoid block selection, and in fact I do not need to insert it because I`m going to use the below code to replace it with a existing block: (defun c:aux (/ ss n edata) (if (setq ss (ssget "_X" '((2 . "Old_block")))) (repeat (setq n (sslength ss)) (setq edata (entget (ssname ss (setq n (1- n))))) (entmod (subst '(2 . "New_block") '(2 . "Old_block") edata)) ); repeat ); if ); defun I hope you can help me. Thanks in advance for your time and help. Quote
pkenewell Posted March 4, 2021 Posted March 4, 2021 Perhaps this? http://www.lee-mac.com/steal.html 2 1 Quote
JovanG Posted March 4, 2021 Author Posted March 4, 2021 (edited) 3 hours ago, pkenewell said: Perhaps this? http://www.lee-mac.com/steal.html Hi @pkenewell, I really thank you! if I use it like a subfunction it works perfectly Edited March 4, 2021 by JovanG 1 Quote
pkenewell Posted March 5, 2021 Posted March 5, 2021 16 hours ago, JovanG said: Hi @pkenewell, I really thank you! if I use it like a subfunction it works perfectly No problem. I read your initial response and was going to suggest you look at the sub-function. Quote
JovanG Posted March 5, 2021 Author Posted March 5, 2021 2 hours ago, pkenewell said: No problem. I read your initial response and was going to suggest you look at the sub-function. Jejejeje, Yeah, what happens when you don't read all the information . Thanks again! 1 Quote
BIGAL Posted March 6, 2021 Posted March 6, 2021 I use (if (not StealAll)(load "StealV1-6")) at start of your code this way it loads Lee's steal lisp and all the steal code does not live in your lisp program. 1 Quote
tombu Posted March 6, 2021 Posted March 6, 2021 (edited) As I use it in a few dozen macros many times a day for importing layouts, plot styles, page setups, dimension styles, etc… I load it in acaddoc.lsp. Example ^C^C^P(Steal (strcat (vl-filename-directory (getenv "QnewTemplate")) (chr 92) "AutoCAD Template" (chr 92) "Templates.dwt") (list (list "Page Setups" (list "11×17" "11×17 PDF")))) .regen Edited March 6, 2021 by tombu 1 Quote
JovanG Posted March 8, 2021 Author Posted March 8, 2021 On 3/5/2021 at 9:43 PM, BIGAL said: I use (if (not StealAll)(load "StealV1-6")) at start of your code this way it loads Lee's steal lisp and all the steal code does not live in your lisp program. Oh! it`s great to know that, because now my lisp program is pretty more clear than before. Thank you BIGAL Quote
JovanG Posted March 8, 2021 Author Posted March 8, 2021 On 3/6/2021 at 3:09 PM, tombu said: As I use it in a few dozen macros many times a day for importing layouts, plot styles, page setups, dimension styles, etc… I load it in acaddoc.lsp. That`s a great idea tombu, thank you for teach me the way to load it in acaddoc.lsp. I will do that with some frequently used lisps. Quote
BIGAL Posted March 10, 2021 Posted March 10, 2021 (edited) Like tombu I use a different method, put your often loaded lisps into 1 lisp, for me Autoload.lsp, then "Appload" and add to "Startup suite". My autoload.lsp has 38 defuns in it. Some like 2 lines others more complicated. It also has lots of "Autoload" commands in the file worth looking into check help "AUTOLOAD". eg (autoload "COPYCOMMAND" '("ZZZ")) they get loaded automatically once you type the command. Edited March 10, 2021 by BIGAL 1 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.