Jump to content

Recommended Posts

Posted

We xref parts into our drawings, some of the parts are combined parts that were made from two original parts xref’d into another file to make a component. This obviously creates nested xrefs that become difficult to bind among other issues. I would like to insert blocks into the combination xrefs and have a routine that can update the blocks periodically to pick up any design changes to the original parts. I have the attached lisp routine that will replace the blocks. I use a batch program that runs a script with the file names etc. The routine either replaces a block or block is “not found”. Everything works except that I end up typing in resume to get the routine to complete each of the drawings. It is probably some simple command or an if – then statement. Any help would be appreciated.

This is the lisp file:

;Block redefinition - for batch scripts

;replaces with a new version of the block saved in .DWG

;(DWG file must be on search path)

;

;© 2007 XANADU a.s. - www.xanadu.cz

;

(defun C:BLKREDEF ( / blkname cmde)

(setq cmde (getvar "cmdecho"))

(setvar "cmdecho" 0)

(setq blkname (getstring "\nBlock name: "))

(if (tblsearch "block" blkname)

(progn

(command "._-insert" (strcat blkname "=") "_y" nil "_regen")

(princ (strcat "\nBlock " (strcase blkname) " redefined."))

)

(princ "Block not found.")

)

(setvar "cmdecho" cmde)

(prin1)

) (script "blockscr")

Here is the batch script routine I use with MultiBatch to update a list drawings with multiple parts

(load "blkredef.lsp")

BlkRedef part01

resume

BlkRedef part02

resume

BlkRedef part03

resume

BlkRedef part04

resume

BlkRedef part05

resume

qsave

close

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