Merge blocks with Attributes

Merge blocks with Attributes

Anonymous
Not applicable
1,813 Views
5 Replies
Message 1 of 6

Merge blocks with Attributes

Anonymous
Not applicable

Hi everyone, 

 

I'm trying to figure out if the following is possible with AUTOLISP, 

I have a situation where my standard titleblock has been exploded into 2 separate titleblocks (by another CAD user- externally). My standard titleblock has custom attributes that are set up in vault for searches.

 

This has happened in hundreds of files for a large project so I'd prefer to use LISP to bulk edit them rather than open each one individually. 
I already have a lisp that selects mutiple files and selects a sub lisp to run on these selected files,

 

I would only need a LISP that does the following: 

1. identify blocks to merge (don't mind if it needs a click for each block or input box)

2. Merge blocks maintaining/merging all attributes & attribute values 

3. Rename block

 

Is this possible with LISP?

Does anyone have any pointers on where to start with this??

0 Likes
1,814 Views
5 Replies
Replies (5)
Message 2 of 6

pbejse
Mentor
Mentor

@Anonymous wrote:

1. identify blocks to merge (don't mind if it needs a click for each block or input box)


Does that mean the two rogue blocks may not be named the same on every file? 

 

2. Merge blocks maintaining/merging all attributes & attribute values 

3. Rename block


  • What about getting the current values from both blocks and merging the values to a list
  • Insert the correct block and populate the attributes from the merge list instead of renaming the block?

 

My standard titleblock has custom attributes that are set up in vault for searches...

I'm not knowledgeablewith vault, How's that work? Is it the same as Field values? 

 

I already have a lisp that selects mutiple files and selects a sub lisp to run on these selected files,

Is that ODBX? Be aware there are known issues with attributes justification using that method depending on the current style used on the ATTDEFF. (Middle Center to name one) 

 

Better off using scripts if you have any of those otherwise stick ODBX which is a lot faster.

 

HTH

 

Message 3 of 6

Anonymous
Not applicable

@pbejse Thank you, 

To answer your questions: 

 


1. identify blocks to merge (don't mind if it needs a click for each block or input box)


Does that mean the two rogue blocks may not be named the same on every file? 

unfortunately yes, some are named differently. 

 


2. Merge blocks maintaining/merging all attributes & attribute values 

3. Rename block


  • What about getting the current values from both blocks and merging the values to a list
  • Insert the correct block and populate the attributes from the merge list instead of renaming the block?

Excellent idea, I wasn't sure if this was overkill or if there was a way to just merge them as is. 

 


My standard titleblock has custom attributes that are set up in vault for searches...

I'm not knowledgeablewith vault, How's that work? Is it the same as Field values? 


We've got Vault to look for attributes within a .dwg file. kind of the same as metadata. (i.e. Vault finds "title line 1") it then displays them. 

 

Is that ODBX? Be aware there are known issues with attributes justification using that method depending on the current style used on the ATTDEFF. (Middle Center to name one) 

 

Better off using scripts if you have any of those otherwise stick ODBX which is a lot faster.

not ODBX, the LISP writes a script file then it runs. 🙂

0 Likes
Message 4 of 6

pbejse
Mentor
Mentor

@Anonymous wrote:

... unfortunately yes, some are named differently. 

Is there a way to identify the blocks without the need to select on screen? And even if you have an input box does it mean pausing the script on every file? 

 

  • What about getting the current values from both blocks and merging the values to a list
  • Insert the correct block and populate the attributes from the merge list instead of renaming the block?

Excellent idea, I wasn't sure if this was overkill or if there was a way to just merge them as is. 

I'm thinking how would the program know what goes where if the block name varies and most likely attribute TAG names are differet too. So I guess merging isnt a bad idea after all. Only thing is, you need ATTSYNC to update the block which actually running a script would be the way forward

 

Holler if you need help putting it together.

 

 

0 Likes
Message 5 of 6

Dean.Horvath
Observer
Observer

I have a situation where there are 3 attribute blocks in old titleblocks. Title information, Revision, and Reference.

I would like a to have a lisp that would combine the three attribute blocks into one without loosing the information entered. The reason I would like a lisp is there are hundreds of Titleblocks to update.

There use to be

'in an older version of AutoCAD" under express tools a way to do this that is no longer there however a lisp can do multiple drawings when batched instead of one at a time.

0 Likes
Message 6 of 6

ВeekeeCZ
Consultant
Consultant

Post dwg samples, old block, new block. Both filled up correctly.

0 Likes