Whish: quick switch from linked block to embedded block

unhandled

#1

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


(Pascal Golay) #2

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

-Pascal


#3

Right, that’s I missed.

-Micha


(Pascal Golay) #4

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


#5

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


#6

This is also possible with python scripts:

! _NoEcho _-RunPythonScript (

...script here ...

)

_Willem


#7

Great. :slight_smile:
Thank you,
Micha


(Miguel Villegas Ballesta) #8

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


(Pascal Golay) #9

I’ll take that as a request =)

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

thanks,
-Pascal


(Miguel Villegas Ballesta) #10

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…


(Pascal Golay) #11

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

-Pascal


(Miguel Villegas Ballesta) #12

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.


(Pascal Golay) #13

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

-Pascal


#14

@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.)


#16

@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.


(Pascal Golay) #17

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

EmbedBlocks.py (1.2 KB)

-Pascal


#18

@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


(Pascal Golay) #19

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


#20

Right, no change after starting the commands.


(Pascal Golay) #21

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