Inserting multiple blocks with the same name

unhandled

#1

I’ve ran into what seems like an inconsistency with how block names work but I’m not certain exactly what’s going on.
When using -insert to insert multiple linked blocks with the same filename. They usually come in as blocks titled by their filename (ex. laminate.3dm is a block named “laminate”), and the linked file is overwritten by the most recently inserted block.
But sometimes the block name is appended to something like “laminate 53bf5595-6b6d-4b6f-b7c9-f204222575d0”. It seems kinda random and there’s never a block name conflict notice that lets me choose.

I would like to have the block names changed when there’s a conflict, is there a reliable way to do this? Preferably as a part of a -insert command so there aren’t pop up windows.


(Pascal Golay) #2

Hello - I guess I need to set up a scenario that is like yours and test this- what you describe looks like a GUID is being attached the the names, which seems very wrong to me…
What is the exact setup - you insert a file X.3dm , then insert a different file with the same name, is that it? You should see this, if I follow:

but I guess you don’t.

-Pascal


#3

What is the exact setup - you insert a file X.3dm , then insert a different file with the same name, is that it?

That’s correct, and I’ve never had the redefine block window show up.
The insert command is being generated though Grasshopper, but copy & pasting it into Rhino gets the same results. The command is something like this. One or all of the paths may change over multiple uses, but the file names are frequently the same.

-Insert F=yes L=link "C:\1\A.3dm" block 0 enter enter enter -Insert F=yes L=link "C:\2\B.3dm" block 0 enter enter enter -Insert F=yes L=link "C:\3\B.3dm" block 0 enter enter enter

The first time it runs the blocks are named normally, the extra letters and numbers start showing up when it’s used more than once.


(Pascal Golay) #4

Hello - ok, I see. -Insert will not show pop-ups. I’ll try it that way, thanks.

I see it… your macro has the same file being inserted into the same location twice in a row - dunno if that is what you intended but even with just the first two, I see the naming with GUID on the second time through.

OK, I take that back, I think - it does need the repeated identical insert to make the goofy name happen - do you see that?

-Pascal


#5

Yes, I think we’re seeing the same thing.
This is after running the macro once
1

And this is after running it twice
2


(Pascal Golay) #6

OK - I don’t know what the mechanics of it are but it seems the repeat of the second insert should be handled by inserting the existing block just inserted - is there some reason you don’t do it that way?

-Insert F=yes L=link "C:\Users\pascal\Desktop\junk.3dm" block 0 enter enter enter
-Insert F=yes L=link "C:\Users\pascal\Desktop\junk\junk.3dm" block 0 enter enter enter
-Insert File=No "Junk" block 0 enter enter enter

-Pascal


#7

Well, the simplest answer is I’m not sure how to work around that limitation right now. But that’s ok, this whole project I’m working on has been a learning experience :laughing:.

Sifting through my whole grasshopper definition probably isn’t a good use of your time. but it seems like the main problem is that I thought it would make things easier to use duplicate file names for different models. For example as I have things set up currently C:\Users\pascal\Desktop\junk.3dm may be a different size piece of junk than C:\Users\pascal\Desktop\junk\junk.3dm. In hindsight it’s no surprise that this is causing issues, but it shouldn’t be difficult to fix

Is there any chance that an option for redefining or renaming blocks could be added to -Insert in the future?


(Pascal Golay) #8

OK - hold on, my mistake - the last insert is not a copy of the second last as I thought. Back to my test…

Gr. Now I cannot repeat this at all - with my paths all pointing to legitimate files

-Insert F=yes L=link “C:\Users\pascal\Desktop\junk.3dm” block 0 enter enter enter
-Insert F=yes L=link “C:\Users\pascal\Desktop\junk\junk.3dm” block 0 enter enter enter
-Insert F=yes L=link “C:\Users\pascal\Desktop\junk\JunkPlus\junk.3dm” block 0 enter enter enter

it works now no matter how many times I run the sequence. All of the blocks, all coincident in this case, are the same as the last one inserted and called ‘junk’, no GUID added…

-Pascal


#9

Hmm that’s annoying, but what you’re getting now seems like the intended result. As long as I know what behavior to expect I’m happy, and changing my file names so they aren’t the same is a super easy fix. Thanks!