Whish: quick switch from linked block to embedded block

Hi Pascal, I got it and it works now. Thank you for your patience. :slight_smile:

Do you think it could be possible that you get the “link” script working for multiple selection too?
(And maybe if it isn’t to much work both scripts could work with preselection.)

Hi Micha - how would linking work with multiple selection? What should happen?
I updated the EmbedBlocks.py for preselection, above.

-Pascal

Hi Pascal,

I thought, I could select a set of blocks, press the link button and I can choose, where the blocks will be exported and linked. So, the embed and link scripts could be used to pack blocks to a Rhino file, this could be easy send to a project partner where the blocks could be extracted again.

(Some times, during complex projects it’s not easy to find, which linked blocks a current used for a scene and which not. The scripts could help to pack the right blocks.)

-Micha

Hey everyone, sorry for bumping this one up, but I am in the need of actually converting about 200 embedded blocks into linked ones.

I imagine that if you have a file with all the blocks you wish to link inserted, then its just a matter of matching names:

You could select all your 200 embedded blocks on your current file, and when asked which file to obtain the linked blocks from, this file should have the same blocks from your original file, with the exact same name.

Four years and this isn’t native still?

I just encountered this today, because I got linked blocks by mistake and was bewildered as to why I seemingly couldn’t do anything about it after the fact!

McNeel really, really, really doesn’t care about Blocks at all, do they?

I need to figure out how to change the embed block python script to accept an existing selection, because at least the blockmanager allows you to select all linked blocks fairly easily…

1 Like

try this
LinkSelectedBlocks.py (418 Bytes)

1 Like

Well, the answer is kind of obvious, hey ;/
I just bumped into this problem for the first time, since Frontinc seems to advise to use liked files.
It is another example of how the blockmanager is formidably lame that you can’t just embed a bunch or all linked blocks.
This could also advantageously be an option to embed all liked blocks when you “save as”.
All the CAD tools that rely on linking have some kind of “packaging” option.

Of course it can be done by scripts ; perhaps even with GH, but COME ON !!!

@pascal

Thank you for writing this script. I’ve been meaning to provide feedback ever since you wrote it, and here is what I’ve found to remain true even as I use Rhino BETA V7. As you are aware, Keyshot requires embedded blocks, and workflow requires that all blocks be actively linked until absolutely finished to keep file size down.

I’m working on a large site plan with bundled instances of blocks within blocks. For instance (“nuts and bolt” blocks build a piece of hardware, “hardware” blocks build another larger unit, and so on.) The EmbedBlock.py script works for the “first level” of directly linked blocks. I’ve tried re-running the script after the “first level” has been embedded thinking that the script would dig into the remaining linked blocks down to “nuts and bolts”, but it does not. I’ve also tried selecting blocks by dragging a window, as well as, selecting through the block manager, but do not see any notable difference (my thinking was that these second and third tier “nested” blocks may be better selected through the Block Manager. As of Mac Rhino V7 BETA, manually clicking through the block manager is the only way to completely embed blocks. As osuire suggested a package option sounds like something that might also cleanly execute this function since it is an end-type command.

Thank you for all your work and especially your clear, patient responses to those of us that do not write code.

1 Like

Hello - OK, I’ll take a look at the script and see if I can make it any better.

@architectus - using the - admittedly quick and dirty - functions that my script is using, there is not a way to embed elements of a linked block that are themselves linked. This is not to say it is impossible but will take some more poking - it is not a quick fix in the current script…

-Pascal

I just had to use this now on an imported Solidworks assembly, and when I did, all of the blocks rotated themselves 90 degrees after being embedded.

Also, the script doesn’t seem to embed the full assembly, just the top level?

image

However, I switched from “open file” to “import”, so I can’t understand why I still got linked blocks instead of embedded. Is there an option to not generate links somewhere that’s native that I perhaps missed?