Keep list of names before they were changed?

Is there a way to keep a list BEFORE changes were applied?

Block references in my drawing were changed by other blocks and I want to keep a list of the names of the blocks BEFORE they were changed so I can compare the old names vs new names.

Likely running a DataExtraction command before and then again after doing the change will get what you want.

No possible ways within Dynamo?

You could also grab the names and write to CSV if that is preferable.

The issue here is it won’t be as fast and perhaps less complete, unless you’re changing names via Dynamo was well.

Sorry, I just realized I didn’t give much details. Yes, the blocks were changed with Dynamo. I just want to add the list of names before they get change in my script. But as I click run, there is no trace left of before.

You need to gather the names before you change them, then put in a watch node marked as an output, or save to another file.

Hard to illustrate where or describe how without seeing your graph though. If it helps you can imagine me asking for your guidance to deal with how my leg hurts when I do this.

1 Like

Here is my graph:

You already have the list of ‘before’ and ‘after’ names in the excel file you’re loading. Why not just use that? Put a WatchNode after it and mark it as an output and you’ll see the values in player.

The Excel is like a dictionnary. It just tells that Block A = Block B and the new layer. What I want is a list of the names of all blocks that are present in the drawing before they get changed.

Imagine a surveyor’s drawing. He sends me a drawing that has his blocks in modelspace. Now I want to change his blocks with my blocks. But before that, I just want a list of the names of his blocks before I change them with mine. Just like DATAEXTRACTION would do. But I’d like to keep that process in Dynamo.

I get that you’re using the excel as a dictionary, but you already know the existing name and the new one because it’s in the excel file.

If you’re looking for it to say “Old Name” and “New Name” once for each block, duplicate the value N times for N blocks, but that isn’t very useful as column A would say “Old Name 1” 10000 times and then “Old Name 2” 10000 teims after that and column B would say “New Name 1” 10000 times followed by “New Name 2” 10000 times…

If you want just column 1 with the 10,000 of each name in order, pull the block from the block references, then pull the name of the block. The use of that… well I’m guessing you have one. But again, you have all of the useful information already.

Are you saying that not all OLD blocks from the excel file are present in the model? ie the excel file contains all possible block names?

If that’s the case then your answer lies in the output of one of your GetBlockByName nodes. You’ll just need to Clean the list.