Attempting to update a block in drawing with an external block via scr... HELP!!!

Attempting to update a block in drawing with an external block via scr... HELP!!!

thomas.stansell
Contributor Contributor
549 Views
5 Replies
Message 1 of 6

Attempting to update a block in drawing with an external block via scr... HELP!!!

thomas.stansell
Contributor
Contributor

In my drawing, there is a block called a.stamps that I am trying to redefine with a wblock that exists in my block library. I am trying to update this block in several hundred acad files.  The block definition in my test drawing will not update. Please help!

 

this is my code...

 

filedia 0
cmddia 0
.OSMODE 16384
TILEMODE
1
-VIEW
RESTORE
HOME
GRID
OFF
-Layer
A
I
"C:\Users\bmn932\OneDrive - AFRY\_JERVOIS\133001042JER\CAD\P&ID's\CAD RESOURCES:\AFRY.LAS"
I
"C:\Users\bmn932\OneDrive - AFRY\_JERVOIS\133001042JER\CAD\P&ID's\CAD RESOURCES:\AFRY-GRID ON.las"
I
"C:\Users\bmn932\OneDrive - AFRY\_JERVOIS\133001042JER\CAD\P&ID's\CAD RESOURCES:\AFRY - SUBMITTAL.las"
R
AFRY-GRID ON.las

 

TILEMODE
0
.ZOOM
EXTENTS
_CLAYER
G-BRDR-STKR
setvar BLOCKREDEFINEMODE 2
-insert "C:\Users\bmn932\OneDrive - AFRY\_JERVOIS\133001042JER\CAD\P&ID's\CAD RESOURCES\ACAD BLOCKS\A.STAMPS.DWG"
@36.446900,3.952154
1
1
0
_ATTSYNC
Name
A.STAMPS
_CLAYER
0
filedia 1
cmddia 1
.OSMODE 4471

.QSAVE

 

0 Likes
Accepted solutions (1)
550 Views
5 Replies
Replies (5)
Message 2 of 6

paullimapa
Mentor
Mentor

Notice this lisp routine that uses insert blockname=wblock which redefines the block @TomBeauford 

https://www.cadtutor.net/forum/topic/70950-redefining-blocks-when-inserting-into-a-drawing-from-a-bl...


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 3 of 6

Kent1Cooper
Consultant
Consultant

@thomas.stansell wrote:

....

-insert "C:\Users\bmn932\OneDrive - AFRY\_JERVOIS\133001042JER\CAD\P&ID's\CAD RESOURCES\ACAD BLOCKS\A.STAMPS.DWG"

....

If you can put that filepath in your Support File Search Path list in OPTIONS, and if the Block name is the same as the external drawing file name, then that line can be replaced by just:

-insert A.STAMPS= Yes

The Yes is to answer the question of whether to redefine the Block.

 

[By the way, you don't need to include the .DWG filetype ending -- it won't consider any other kind of file.]

Kent Cooper, AIA
0 Likes
Message 4 of 6

thomas.stansell
Contributor
Contributor

@Kent1Cooper I did what you said...at least I think I did...please take a look and tell me where I messed it up?

 

thomasstansell_0-1712846197781.png

 

 

-------------------------------------------------------------------

TILEMODE
0
.ZOOM
EXTENTS
_CLAYER
G-BRDR-STKR
setvar BLOCKREDEFINEMODE 2
-insert A.STAMPS= Yes
@36.446900,3.952154
1
1
0

---------------------------------------------------------------------

 

thomasstansell_1-1712846257462.png

 

0 Likes
Message 5 of 6

Kent1Cooper
Consultant
Consultant
Accepted solution

Remove the Yes answer -- it's not asking whether you want to Redefine it.  I don't know whether that's because of the BLOCKREDEFINEMODE setting [the description in Help doesn't look like it should be the reason], or just a difference in the operation when in a Script, or maybe your EXPERT System Variable setting prevents it.

Kent Cooper, AIA
0 Likes
Message 6 of 6

thomas.stansell
Contributor
Contributor

Thank you so much @Kent1Cooper that did it!

 

0 Likes