Jump to content

Block Replacement Problem


Recommended Posts

Posted

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.

  • Replies 24
  • Created
  • Last Reply

Top Posters In This Topic

  • JasonMartinSimplex

    11

  • Ryder76

    9

  • rkent

    1

  • Zorg

    1

Top Posters In This Topic

Posted

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?

Posted

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.

Posted

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.

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

Posted

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

Posted

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?

Posted

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

Posted

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.

Posted

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.

Posted

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.

Posted

There are no other differences that I know of.

Posted

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.

Posted

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.

Posted

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.

Posted

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 :) )

Posted

The program is $100 USD and the company would pay for it..... maybe...

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