JasonMartinSimplex Posted May 21, 2009 Posted May 21, 2009 I need help with replacing some block in a ton of dwgs. I didn't know if there was a way that blockreplace would do this or if it has to be a custom lisp file. I am using full 2009. Here is what I need to do. We are getting tons of drawings where they like to use the same block with a changeable attribute for there blocks. Basically they have an F with a square around it and a changeable subscript letter next to it. When you go to edit the block it open a dialog box where you can change the subscript letter, we use unique blocks for every block so that we can replace them if we need to and our icons show the direction the object is pointing We need to be able to replace their FRED with an att. of 1 with our block A and FRED 2 with our block B, and so on. Is there a way to do this or does it have to be done with a LISP file? I don't know how to write LISP files or any scripting so any help would be greatly appriciated. Quote
Ryder76 Posted May 21, 2009 Posted May 21, 2009 I'm really confused. If you use "unique" blocks then what's the point of using a block at all? Can you post a file to be looked at? Quote
JasonMartinSimplex Posted May 21, 2009 Author Posted May 21, 2009 What I mean by unique is we don't use just 1 block with a different attribute to represent 15 different objects. We use a different block to represent each different item. So a chair would be a block, a table would be a block, ect. I don't mean that every block is different. Quote
JasonMartinSimplex Posted May 21, 2009 Author Posted May 21, 2009 We have a script that keeps track of how many of any one object there is. So if we place a chair it shows that you have 12 chairs in this drawing, and it changes when you places another object. Quote
Ryder76 Posted May 21, 2009 Posted May 21, 2009 What I mean by unique is we don't use just 1 block with a different attribute to represent 15 different objects. We use a different block to represent each different item. So a chair would be a block, a table would be a block, ect. I don't mean that every block is different. Ok - still confused. Genuinely interested here - just need to understand and that is sometimes difficult to accomplish when only able to type. So if you have a block of a table with a number on it and that number relates to the room it is in wouldn't you need to have an editable attribute that changes by room rather than multiple blocks of a table with the room number in text rather than an attribute? I guess a picture is worth a thousand words. I really want to help just need to be able to visualize your need. Quote
JasonMartinSimplex Posted May 21, 2009 Author Posted May 21, 2009 Here is a pdf. BLOCK REPLACE.pdf Quote
JasonMartinSimplex Posted May 21, 2009 Author Posted May 21, 2009 Thats the problem if I do a block replace it replaces all of their blocks with mine. I need it to replace only the blocks with text attributes with "AA". Quote
Ryder76 Posted May 21, 2009 Posted May 21, 2009 OK I think I get it now. You only want to replace their G-AA block with yours - square with AA, but you want to keep all of the rest of their G-attribute blocks. Is this right? How difficult would it be to isolate the G-AA blocks? Quote
rkent Posted May 21, 2009 Posted May 21, 2009 Maybe this lisp file will help, not one of mine. After loading start it with REPL at command line, point to multiple blocks to replace, then pick the one to use to change those to. Try this on a copy of a drawing first. REPLace blocks.lsp Quote
JasonMartinSimplex Posted May 21, 2009 Author Posted May 21, 2009 Yes, you got it. All block G but different tags or text attributes. I need something that can look at block G and only replace the ones with AA as a tag or text attribute and leave the rest alone. It would be difficult, cause they are all mixed together, all on the same layer, there are 20 different subtext AA, AB, AC, BB, BA, ect. Quote
JasonMartinSimplex Posted May 21, 2009 Author Posted May 21, 2009 I think I found something that might do it. http://www.caddproductivity.com/blockreplaceimage.htm Quote
Glen Smith Posted May 21, 2009 Posted May 21, 2009 Can you use the express tools export attributes somehow? use quick select to get all of the blocks, then export the attributes. Use Excel to sort by attribute so all the AA, BB, CC ... blocks are together. Now you at least have a comprehensive list of all the blocks, as well as thier handles. Can this be used as a selection set via lisp? I tried simply changing the block name to something else and importing it back in. AutoCAD tells me that it can't find matches and asks me to assign them manually. Quick select does not seem to have a select by attribute value - is there any other difference between the blocks? (color, layer, linetype ...) Glen. Quote
Ryder76 Posted May 21, 2009 Posted May 21, 2009 Did you try the lisp? It seems you need something that will find a block with certain attribute data, select that block and replace that particular instance of the block with a new block. Let us know about that software you found. Looks interesting. Quote
JasonMartinSimplex Posted May 21, 2009 Author Posted May 21, 2009 There are no other differences that I know of. Quote
dbroada Posted May 21, 2009 Posted May 21, 2009 I don't think you will be able to do a simple replace as there is nothing to tell AutoCAD that these blocks are different (other than an attribute) than those blocks. You can't rename or replace some of the blocks with new data. What is possible is to create a selection set of all blocks where attribute = "?" then step through each item and add a new block at the co-ordinates. Create a new selection set and... etc. Then delete all the original blocks. Quote
Ryder76 Posted May 21, 2009 Posted May 21, 2009 dbroada is right. There just isn't an easy way to do it with basic commands. We all know there's at least 50 Ways to Leave... oops I mean 50 ways to skin an ACAD cat. Quote
JasonMartinSimplex Posted May 21, 2009 Author Posted May 21, 2009 I talked to the owner of the program that I found. He said that his program doesn't do it but he said that he could make it do that in 4 hours or so. Sound like he might be the only way that we can get it to do that. Quote
Ryder76 Posted May 21, 2009 Posted May 21, 2009 Either that or get someone to write a lisp routine like dbroada was describing. I would look into both especially if this program is expensive. The lisp or the program should ideally step through multiple inputs. Like after it replaces one it asks for another block to be replaced with the ability to select a different block from the one that was used before to replace it with. (yes, I know I ended this sentence with a preposition ) Quote
JasonMartinSimplex Posted May 21, 2009 Author Posted May 21, 2009 The program is $100 USD and the company would pay for it..... maybe... Quote
Recommended Posts
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.