Announcements

Starting in December, we will archive content from the community that is 10 years and older. This FAQ provides more information.

Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

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

5 REPLIES 5
SOLVED
Reply
Message 1 of 6
thomas.stansell
379 Views, 5 Replies

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

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

 

5 REPLIES 5
Message 2 of 6

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
Message 3 of 6


@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
Message 4 of 6

@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

 

Message 5 of 6

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
Message 6 of 6

Thank you so much @Kent1Cooper that did it!

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

AutoCAD Inside the Factory


Autodesk Design & Make Report