EYNLLIB Posted May 20 Posted May 20 Is it possible to insert a full .dwg file as a block into the current open drawing from a tool palette? Our detail library is organized by type and housed in about 30 separate .dwg files, each containing dozens of details. I want users to be able to click the relevant detail library type and insert it as a block into the current open drawing. Making the entire contents of each file a block is a last resort, as it complicates modifications and updates over time. One idea I had was to create a custom LISP routine that inserts each file, and add that LISP to the tool palette. Any suggestions or solutions would be greatly appreciated. Thanks! Quote
BIGAL Posted May 21 Posted May 21 A quick answer is use Lee-mac.com Steal.lsp, you can get a block from another dwg. You can (load "Steal") then run the defun without any user input. Something like this done via a pop menu, others will suggest tool Palettes. 1 Quote
EYNLLIB Posted May 21 Author Posted May 21 11 hours ago, BIGAL said: A quick answer is use Lee-mac.com Steal.lsp, you can get a block from another dwg. You can (load "Steal") then run the defun without any user input. Something like this done via a pop menu, others will suggest tool Palettes. I have used Lee's steal.lsp previously, the issue with this scenario is that our details aren't individual blocks What I have settled on (for now) is adding a lisp routine for each file to the tool palette so my users can simply click the relevant icon, and the entire file is inserted. see below; I have a similar lisp for each file (defun c:INSERT_CONCRETE_SHEARWALLS () (setq FILE_PATH "Z:\\_TEMPLATES\\CAD Templates\\_Detail Library\\CONCRETE SHEARWALLS.dwg") (command "INSERT" FILE_PATH (list 0.0 0.0 0.0) "1" "1" "0") (princ) ) then in the tool palette i add this code; (load "Z:/_TEMPLATES/CAD Templates/_LISP/_Deployed/_DETAILLIBRARY - InsertDetailFiles.lsp");INSERT_CONCRETE_SHEARWALLS it works fairly well, though i wish autocad would allow you to simply add a full .dwg file to palettes Quote
BIGAL Posted May 21 Posted May 21 (edited) I have used Steal a great program this is all you need. As a line in a mnu. ^c^C(if (not "steal")(load "StealV1-8"))(Steal "C:\\CAD-TOOLS\\XXX.dwg" '(("Blocks" ("AC"))))(command "-insert" "AC") It brings in one block from another dwg test it. I would make it a bit simpler, as load a lisp then run a defun with block name. You can have the load steal in the grabblk lisp. ^C^C(if (not grabblk)(load "grabblks"))(grabblk "ac") Edited May 21 by BIGAL Quote
EYNLLIB Posted May 21 Author Posted May 21 8 minutes ago, BIGAL said: I have used Steal a great program this is all you need. As a line in a mnu. ^c^C(if (not "steal")(load "StealV1-8"))(Steal "C:\\CAD-TOOLS\\XXX.dwg" '(("Blocks" ("AC"))))(command "-insert" "AC") It brings in one block from another dwg test it. I would make it a bit simpler, as load a lisp then run a defun with block name. You can have the load steal in the grabblk lisp. ^C^C(if (not grabblk)(load "grabblks"))(grabblk "ac") ill try it out when i get some time to mess around with it this week thanks! 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.