Jump to content

Recommended Posts

Posted

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!

Posted

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. screenshot89.png.113799740b50660205f2c86465f1c5e7.png

 

 

  • Like 1
Posted
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. screenshot89.png.113799740b50660205f2c86465f1c5e7.png

 

 

 

 

 

 

 

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

Posted (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 by BIGAL
Posted
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!

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...