Insert Block Script Block Name Conflict

I’m still waiting for someone to help me repeat this…

– Dale

Hi @dale,
I have attached 2 videos of the behaviour, and also the relevant files in which this occurs. There are 3 linked and embedded blocks in the Main_File.3dm, which are BLock_2, Block_A and Block_B. I had updated Block_A.3dm and then also updated the BLock_2.3dm afterwards. But when I open Main_File.3dm, the prompt shows up no matter in what order I update the blocks. And if at all there are 3000 different blocks just like BLock_2 in the file(which all have Block_A inside them), the prompt will show up 3000 times !!


Test.rar (258.4 KB)

Hi @Darryl_Menezes,

Thanks for the sample. I can see that from a user’s perspective the conflict feature is working as expected.

However, this is the Rhino Developer category, and there come comments about InstanceDefinitionTable and the conflict dialog appearing.

In order for me trace the path to why this dialog is appearing while running some RhinoCommon code, I need some RhinoCommon code that I can run here that repeats the problem. Does this make sense?

– Dale

Hi @dale
I have attached the sample rhino command. The dialog also appears when I run the command on the blocks Thanks

SampleEmbedCommand.txt (5.3 KB)

Dale,
Here is a setup that mirrors what I am trying to do. If you open the file “assembly” and run the included python script (after changing the file path specified in the script). You will see that it will continuously prompt the user with the dialogue box, and even though this is functioning properly, I am looking for a way to override the interruption of a pop-up somehow.Block Conflict.zip (489.2 KB)

I am curious if there was a resolution to this problem. I am having a very similar experience. I get the same check box and have to click ‘Both blocks’ and ‘Do this for all block name conflicts’ repeatedly (100’s of times). Once I am done with this task, all blocks are loaded and are correct, which leads me to think that it is unnecessary for this command to pop-up repeatedly. The option to override would be very convenient.

2 Likes

I am also suffering from this same issue. Block name conflicts interrupting automated file inserts.
Because I don’t care about preserving block information, my solution right now is to explode all block instances and delete all block definitions before each _-Insert using this function:

def explode_and_delete_all_blocks():
    blocknames = rs.BlockNames()
    for bn in blocknames:
        instances = rs.BlockInstances(bn)
        for inst in instances:
            rs.ExplodeBlockInstance(inst)
        rs.DeleteBlock(bn)
1 Like

Same problem here, please make an option to override the dialog

2 Likes

Hi @dale,
is there any update on this issue?
I am having the same problem when trying to update nested linked blocks.
I would say that it’s basically not a poblem to press a button in that dialogue, but it would be very nice to have that as an option in the inline version of the Blockmanager command.

Thanks
T.

Hi @tobias.stoltmann,

This issue was fixed in Rhino 6 and the Rhino WIP:

https://mcneel.myjetbrains.com/youtrack/issue/RH-57346

Perhaps this helps?

– Dale

Hi, @dale,
yes, that helps, but I guess there is another problem here.
When I run

-BlockManager Update All

I get the following:

grafik

Is it possible that this option has not been considered?

Thanks in advance
T.

Hi @tobias.stoltmann,

Can you provide a few 3dm files and instruction on how to repeat?

Thanks,

– Dale

Yes, @dale, of course I can.

File “ProjectBlock” contains 3 library parts (nuts, screw and washer). That would be something I’d use on a project and I’d assemble in advance. Of course you’d have to change the path to the “linked and embedded” files when you work on it, they are still referenced to my desktop.

When I update one of the “standard” parts (nuts, screw and washer) it’s not having any trouble to update it in file “ProjectBlock”.
When I use it in another file (let’s say the model of the real projec then) and one of the standard parts woudl get changed, I get the dialouge shown in my comment above. It wants to know what to do with the “new” block.

So to sum it up: The insert command displays the same dialogue when using nested blocks and an item inside the nested block gets updated.
I guess you’d just have to implement the solution for the -Insert command on this one as well, right?

I hope this is understandable and you are able to reconstruct the problem.

T.

ProjectBlock.3dm (283.1 KB)
SOF__Nuts__Metric__M8__ISO4032.3dm (123.0 KB)
SOF__Screws__Metric__M8x70__ISO4017.3dm (164.3 KB)
SOF__Washers__Metric__ST8 100 HV__ISO7091.3dm (44.0 KB)
FileUsed.3dm (262.0 KB)

Thanks @tobias.stoltmann. I am able to reproduce this and I have logged the issue.

https://mcneel.myjetbrains.com/youtrack/issue/RH-59783

– Dale

Thanks @dale.
Would it be possible to solve somehow without scripting, e.g. with RhinoCommon?

RH-59783 is fixed in Rhino 7 Service Release 13 Release Candidate

@dale I have a very similar issue. I am using the _-Import command in RhinoScript and it does not ask what to do with Block Name Conflicts. It just defaults to renaming the existing ones.

How can I set it to replace all existing ones?

This is what I get when import from the file dialog:

Now I want to do the same using a Script, but I want to use “Replace with imported block” for all conflicts, but cannot see any option for this. In fact I can’t even find any documentation for the import command in the RhinoScript documentation:

Is there any current way to import the blocks of one file into another using scripts without getting any windows pop up or it renaming blocks?

I have been going through all the forum posts mentioning the problem of inserting blocks from one doc into another using scripts and over the years so many people have asked for it and I just can’t find anywhere that this is properly possible. Of course Grasshopper also can’t really do this. You can do a few things with plugins, but I haven’t found a way to do this. I feel like I am running out of options on how to do this in code.

@dale I see you were literally just working on this: https://mcneel.myjetbrains.com/youtrack/issue/RH-69709/Insert-Does-Not-Offer-Options-for-Block-Conflict-Resolution

I have tried this out in the WIP and I can see the ResolveConflict Option. But which one is the option to replace blocks, ie. the middle option from the Block name conflict dialog?

I need to keep track of the existing Blocks in my script, but I can’t if they are being renamed and I can’t be sure what they are being renamed to!? I would like to just replace the blocks in the document with the ones from the file I am inserting. Is that not possible? What is the reason for doing only 2 of the 3 options?

@dale Sorry, to keep posting, but upon further testing I can say that the ResolveConflict option does not change what happens when Inserting a file with Blocks.

Can it be that the Resolve Conflict option is only for nested block warning? No matter what option I chose it always renames blocks that are already existing.

Hi @seltzdesign,

Can you provide some files and scripts, along with instructions on how I can repeat what you are seeing?

Thanks,

– Dale