0 Members and 1 Guest are viewing this topic.
Quote from: Plankton on July 27, 2011, 01:47:28 PMMy halfacent:http://www.theswamp.org/index.php?topic=6657.msg84407#msg84407Ok, so nthat works for the most part, but it does not save and close the drawing, please note that I change the scrline to:(setq scrline (strcat "open" " " n2 " " "(load rt.lsp)" " " "(RT_BSR)" " " "qsave" " " "close" " "));;;;;;;COMMANDS FOR BATCH GO HERE(setq scrline (strcat "open" " " n2 " " "(load\"batch_core\")" " " "batch_insert" " " "qsave" " " "close"))Did I somehow mess it up?
My halfacent:http://www.theswamp.org/index.php?topic=6657.msg84407#msg84407
(defun c:batch_insert ()(setq tester1 (SSGET "X" (LIST (CONS 0 "insert") (CONS 2 "Tsbder57"))))(if tester1(progn(SETQ fixer1 (ssname tester1 0))(SETQ ats3 (ENTGET fixer1)) (if ats3 (progn (setq attit1(cdr (assoc 41 ats3))) (setq wutscale (rtos attit1)) (command "-insert" "c:\\yourblock" "0,0" wutscale wutscale "") (command "-insert" "c:\\yourotherblock" "0,0" wutscale wutscale "") ) )))(princ))
I'm surprised no-one has mentioned AutoCAD ScriptPro 2.0http://labs.autodesk.com/utilities/adn_plugins/supported_apps/ (Nov 2010)It can load and run lisp ( and provide suitable error trapping to eradicate the gremlins that will halt conventional scripts.Just a thought
Quote from: cmwade77 on July 27, 2011, 07:17:13 PMQuote from: Plankton on July 27, 2011, 01:47:28 PMMy halfacent:http://www.theswamp.org/index.php?topic=6657.msg84407#msg84407Ok, so nthat works for the most part, but it does not save and close the drawing, please note that I change the scrline to:(setq scrline (strcat "open" " " n2 " " "(load rt.lsp)" " " "(RT_BSR)" " " "qsave" " " "close" " "));;;;;;;COMMANDS FOR BATCH GO HERE(setq scrline (strcat "open" " " n2 " " "(load\"batch_core\")" " " "batch_insert" " " "qsave" " " "close"))Did I somehow mess it up?I included the original for you to examine the differences. It's old code, and although it ain't pretty, it works.Also, note that in the 'batch_core' lisp, the call out uses c: to get a command line call.Code: [Select](defun c:batch_insert ()(setq tester1 (SSGET "X" (LIST (CONS 0 "insert") (CONS 2 "Tsbder57"))))(if tester1(progn(SETQ fixer1 (ssname tester1 0))(SETQ ats3 (ENTGET fixer1)) (if ats3 (progn (setq attit1(cdr (assoc 41 ats3))) (setq wutscale (rtos attit1)) (command "-insert" "c:\\yourblock" "0,0" wutscale wutscale "") (command "-insert" "c:\\yourotherblock" "0,0" wutscale wutscale "") ) )))(princ))