Search the Community
Showing results for tags 'replace block'.
-
Dynamic block replacement fails but static block is working
Marcel van Ellen posted a topic in AutoLISP, Visual LISP & DCL
Dear All, I have a problem replacing blocks (titleblock) which is sometimes a dynamic block. When replacing blocks with a new one i get a lselsetp nil error when there is a dynamic block involved. What i try to do is the following: - I try to replace the block by finding it by name (so no manual selection is needed because of a script) - read the coordinates of the old block - read the scale of the old block - delete the block - purge all unused blocks in the drawing - insert the new one in the drawing at the right scale and coordinates The A0KILL does work for static blocks but someone used dynamic ones in our drawings. Now i have to do these blocks by hand for 15000 drawings. Can anyone help me with this issue? (Old blockname is OHTITLE the new one OH-TITLE) (DEFUN C:A0KILL() (setq OHINS (cdr (assoc 10 (entget (ssname (ssget "X" '((2 . "OHTITLE"))) 0))))) (setq OHX (cdr (assoc 41 (entget (ssname (ssget "X" '((2 . "OHTITLE"))) 0))))) (setq ss (ssget "X" '((0 . "INSERT")(2 . "OHTITLE")))) (command "_.erase" ss "") (repeat 3 (command "_.purge" "_B" "*" "_N") ) ; end repeat (command "-insert";Command "K:\\AutoCAD Standaard\\2014\\ALGEMEEN\\Kaders\\Titelh\\Nederlands\\A0\\OH-TITLE.DWG" ;Block Name OHINS OHX "" ) (setq OHINS nil) (setqoh OHX nil) (setq ss nil) )- 10 replies
-
- replace block
- lselsetp
-
(and 3 more)
Tagged with:
-
Lisp to replace attributed blocks in dwg files on a folder.
CafeJr posted a topic in AutoLISP, Visual LISP & DCL
Hi Guys, Someone knows a Lisp used to replace a internal block(s) of a folder with dwg many files. Eg: The specific folder has a "n" files with A3 formats blocks using the same attributes and tags, so, if it's necessary do a correction in a little detail in this format, it's necessary to replace it, one by one on all of these files. Thanks in advance... -
Replace all old blocks with prefixed "modified_" new blocks
shailujp posted a topic in AutoLISP, Visual LISP & DCL
Hello, I ran into a unique issue today with mass renamed blocks done by RENBLKS (a great lisp created by Tharwat) and existing old blocks and I spent few hours to replace old blocks with new ones using BLOCKREPLACE command. So, here is what happened. When I want to create a new version of the same concept, I copy blocks (which has a huge nested tree) in a new drawing, add prefix "modified_" using RENBLKS to rename all blocks, bring it back into original drawing, now I have two versions OLD & NEW. Somewhere, I mixed-up old blocks and new blocks and want to get rid old ones using BLOCKREPLACE express tool utility. My layout is huge around 90MB and takes about 3 to 4 minutes to replace one block at a time and about 15 to 20 blocks to replace. Also, to be able to use BLOCKREPLACE, I had to explode all nested blocks to be able to pick just the desired block. Here is my question, is there a lisp which can replace a complete list of blocks which has a same name as old but with "modified_" as prefix at once? ex. door1 modified_door1 door 2 modified_door2 Thanks -
Hei. Im looking for a routine that replaces selected blocks. In addition i want the replaced blocks to have the same attributevalue as the old blocks. The blocks have the same attributes. I have found many routines that replaces selected blocks, but they all overwrites the original attribute values.
-
Hi All I remember on a pc i was using once upon a time, AutoCAD had a command called replace block. the shortcut was 'RB' and you could replace a block with another one very easily. does anyone know what happened to this feature / command? cheers