Whish: quick switch from linked block to embedded block

Hi,

if I try to edit a linked block I get the message “An other copy of rhino will be opened to edit this linked block”. Could be nice to get an option to set the block to embedded mode and edit in place. If it can’t be implement for this situation and little command could be nice too, that could be started before block edit.

Ciao,
Micha

1 Like

Hi Micha - so just convert the block to embedded - a one-time operation, correct? no more link to the external file?

-Pascal

Right, that’s I missed.

-Micha

Hi Micha - a couple of scripts then, for now. The rvb can be ‘drag and dropped’ to add EmbedBlock, the python can be run with RunPythonScript or `-RunPythonScript “Full path to script file in double quotes”.

EmbedBlock.rvb (961 Bytes)
LinkBlock.py (389 Bytes)
EmbedBlock.py (386 Bytes)

Does that do anything good?
I added a LinkBlock which will let you link an embedded block to any file…

-Pascal

1 Like

Hi Pascal,

the both Python scripts are perfect working. The LinkBlock makes the tool complete, both added to my personal toolbar. :slight_smile:

The RVB doesn’t work, the block stays linked and the file wan’t be embed. It’s no problem, since the both Python scripts are working. The advantage of RVB scripts is that the source code can be direct saved to the button, good for switching the toolbar to a new computer or new Rhino installation.

Thank you very much,
Micha

This is also possible with python scripts:

! _NoEcho _-RunPythonScript (

...script here ...

)

_Willem

1 Like

Great. :slight_smile:
Thank you,
Micha

Hi, Pascal.
Shouldn’t this be a native Rhino feature?

I’ll take that as a request =)

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

thanks,
-Pascal

3 Likes

Hi, @pascal just a quick question.
The py script for linking blocks works also like a charm, but… would it be possible to make it link the blocks to dwg files? It would indeed need to “turn” them into 3dm files to be proper rhino xrefs, right? Can that be scripted to complement the first script? In pseudocode “if the file is not a *.3dm, open it, save as and then link it”… Ups, I worte it and I think it is too much…

Hi arquitextonica - did you try? Here it seems to work OK on DWG files…

-Pascal

Sorry @pascal for the misleading description.
Dwg files are indeed linked, but after that they can’t be double clicked to be worked on from within rhino.

Ah, OK… it seems not too hard, maybe, to do what you want… I’ll poke at it.

-Pascal

1 Like

@pascal Hi Pascal, the scripts are great helpers at Rhino 6 too. Thanks again.

A question - could you modify the scripts so that the user can select a whole scene and all blocks are switched to embed or link mode? So, the scripts could be used to pack projects in one Rhino file.

(General the script functionalities could be added as standard Rhino tools.)

1 Like

@Micha @pascal I have the same issue here; a massive list of block instances that all need to be embedded prior to importing into Keyshot. Not knowing how to write Python, I’ve been searching for an “Embed All Blocks” type script.

@Micha, @architectus - see if the attached does the right thing - somewhat of a quick fix:

EmbedBlocks.py (1.1 KB)
@Micha - updated to support pre-select.

-Pascal

1 Like

@pascal Thank you for try to fix it. I tried the tool, but it doesn’t work here. Here my steps:

  • I created three boxes
  • convert each as a block
  • run the link tool -> nothing
  • exported all blocks
  • manual link the blocks
  • run the embed tool -> nothing

I don’t get any error message.

-Micha

Hi Micha - the script I just posted above is for embedding linked blocks only - it works on multiples, not just one at a time. The other scripts farther up above I have not changed - I was under the impression that these did what they are supposed to…

So the EmbedBlocks.py does nothing if you select linked blocks?

-Pascal

Right, no change after starting the commands.

Hi Micha - the command line in your image shows that RunPythonScript ran a script called

EmbedBlock.py

The file I posted earlier (and just now updated with a change to the prompt) is

EmbedBlocks.py, plural blocks.

Can you make sure to run the most recent script:

Any better?

-Pascal

1 Like