Jump to content

Recommended Posts

Posted

I use CLASSICINSERT, and navigate to my server and pick a block to insert in an existing drawing.

If the block exists I get prompted.

 

"MyBlock" is already defined as a block in this drawing.
Would you like to redefine this block reference?

 

REDEFINE BLOCK?
DON"T REDEFINE BLOCK?

 

So I attempted this:
 

c:foo ()
(command "-insert" "X:\\\MyServer\\AutoCAD Blocks\\MyBlock.dwg")
(princ))

 

This works fine in a drawing where the block does not exist or has not been inserted.

(ie: It does go to the server and insert the block from the correct location)

In a drawing where the block already exists, it merely inserts the pre-existing block again.

 

I have one very specific block that needs to be inserted/replaced/updated in a bunch of drawings

so wanted to create a little snippet to expedite that process in a simple program.

 

I want the program to pull the updated block from the server and insert that and automatically redefine the pre-existing block.

The concept seems easy enough...

 

Help please...

 

Posted (edited)

To redefine a block:

 

 

-insert "MyBlock=X:\\\MyServer\\AutoCAD Blocks\\MyBlock.dwg"

Then you'll be prompted to redefine (yes or no?)

and all MyBlock inserts will be refefined then.

 

in LISP, this should work as well

 

 (defun c:redef ( / )
	(command "-insert" "MyBlock=X:\\\MyServer\\AutoCAD Blocks\\MyBlock.dwg")
	(princ)
 )

 

When I do this I further get asked to pick a inseertpoint, scale, rotation...

Edited by Emmanuel Delay
Posted (edited)

YOU, my friend, are my most favorite person!!
Awesome!!

Thank you so much!!!!

 

 

ps: For me, it updated and didn't even ask which is even better for my purpose.

Edited by ILoveMadoka
  • Like 1

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...