Jump to content

Redefining a block when inserted via lisp


asteffy

Recommended Posts

Currently our company standard layers can be inserted as a block. This works great allowing everyone to see whats what. I made two .dws files with the layer translator that switch all existing layers to new and all new to existing. The only issues is once the layers are translated, I loose either the New layers or the Existing layers. If I reinsert our company standard layers block, it isn't redefined and the new or existing layers still do not exist. I basically need to redefine the block as it is reinserted into my drawing.

 

(defun c:SAA () 
(setq new (getpoint "\n SPECIFY INSERTION POINT:"))
(if (findfile "J:/SAA CADD Standards/LAYERS/LAYERS.dwg") 
(command "_insert" "J:/SAA CADD Standards/LAYERS/LAYERS.DWG" new "1" "" "0" "") 
); end if 
); end function 

Link to comment
Share on other sites

snip.. snip

 

(if (tblsearch "block" blkname)
   (progn
     (command "._-insert" (strcat blkname [color="blue"][b]"="[/b][/color]) (command))
     (princ (strcat "\nBlock " (strcase blkname) " redefined."))))

Link to comment
Share on other sites

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