Share your favourite scripts, macros and plug-ins

I have no idea why this script is not working on your side. It’s what the official documentation mentions as a way to replace the manual writing of numerical values in the Command line. Here is how it works in my Rhino 7:

  1. I run the “Fillet” or “OffsetSrf” command.
  2. The command prompt is waiting for a number to be entered.
  3. I press my custom icon either with the LMB or RMB, depending on the value I need.
  4. Rhino adds the desired value at the end of the Command line.
  5. I press the RMB twice to confirm the change (or, you can press the Enter key, too).

Ok, looks like I found a way to copy a text to clipboard.

Create a script like this one:

import rhinoscriptsyntax as rs
rs.ClipboardText(0.3)
print(rs.ClipboardText())

and save-it as Clipboard_Number_03.py or whatever name you find more apropiate for your needs.

After that, launch the script using a command like:

! -RunPythonScript "C:\Scripts\Clipboard_Number_03.py"

(change the file-path to adapt to your environment) and voaila. You have the number 0.3 pasted in the clipboard.

You can change the 0.3 value from rs.ClipboardText(0.3) to other numerical value you are using frequently.

The only downside of this method is the fact that you need to create a copy of this script for every value you want to copy to clipboard.

P.S. The print(rs.ClipboardText()) line is optional (for feedback), you can delete that line or comment it like:

# print(rs.ClipboardText())

In case that your workflow includes assigning separate display attributes to one or more objects via the ! _SetObjectDisplayMode command, there is a very nice script that lets you select those objects based on the display mode assigned to them. The script adds a new command:
! _SelObjectDisplayMode

SelObjectDisplayMode.rar (604 Bytes)


3 more scripts related to selecting objects with or without materials, thanks to @Helvetosaur :

Select objects with same material:
SelObjsWithSameMatl.py (1.5 KB)

Select objects with any material:
SelObjsWithMatls.py (469 Bytes)

Select objects without material:
SelObjsWithoutMatls.py (472 Bytes)

7 Likes

NewElementTree – Creates a layer tree with predetermined sublayers/properties under current active layer. For those interested in tweaking the script for their own specific needs, I tried to keep it as organized as possible, and should be fairly easy to customize. Future version I’d like to learn how to have it reference a .csv file so anybody can go and customize at-will.

NewElementTree_v07.py (3.5 KB)

And here’s the button graphic I use for it (*found and customized existing svg on amazing site svgrep.com for free) I plan on making more versions of this script with different babies :upside_down_face:

newborn-svgrepo-com

Heads-up: If you have Layer X set as current, and create a NewElementTree using a layer name that already exists under another parent layer – say “Tester” on Layer Y – you’ll end up with the following:

First time I did it, I had a fairly complex layer hierarchy, and it was a real head-scratcher wondering why I wasn’t getting any sublayers :sweat_smile:

If people have any suggestions for future versions of this particular script, please feel free to throw them out there…Thanks.

3 Likes

@pdfaze Thanks for all these scripts!

Question about the quote above: I’ve read it over a bunch of times, and I just can’t wrap my (tired) head around what you mean by “…with a + sign on the keyboard…” :melting_face:

Also:

I’m most excited for the MultiPictureFrame script! And not sure if you’re interested in suggestions, but an alternate version with options to automate the placement process might be really helpful:

  • Draw or Dim (standard picframe or type dims)
  • Start/End (By Points or Along Line – makes poss to spec horiz or vert; and an integrated tweak of Mitch’s “ArrayLinearDistribute”)
  • Attached or Gaps
  • Border Y/N
1 Like

E,S,D,F,C Kinda makes up a + on your keyboard, (If you use a Qwerty KB that is)

1 Like

wait what :open_mouth:

:star_struck: imma run out of :coffee:

doesn’t Rhino have this natively though :thinking:

That’s crazy does this mean I can move curve points around while the thing is attached to the surface :dizzy_face:

It’s funny when ppl tell me Rhino can’t do this or that or isn’t this or that kinda CAD when clearly there’s nothing it can’t do :smiling_face_with_three_hearts: Just need ppl to keep making those script thingamajigs :upside_down_face:

1 Like

:flushed: :astonished: :exploding_head: This should be Rhino native tool, but glad this proves Rhino can do it lol.

There’s probably alot of these that should be Rhino native tools :pray:t4:

2 Likes

:joy: I know this is :100: true. I remember it was so hard for me to get used to it 20 yrs ago coming from those other CAD’s. I never used NX before though, wish I did.

On the last bit. Yes, you can freely move the editing points of the curve on surface. I believe that Rhino 8 already have this as a native command. But older Rhino versions lack it, so this script is for those users who haven’t upgraded yet.


As for the Fin extrusion, I highly recommend you this version, which is far superior to any other Fin script or macro. Once you explore its Command line options, especially the “SimplifyCurvTol” (simplify input curve or edge tolerance), you will realize that it’s very handy to create simplified geometry and avoid those unwanted overly-complicated fin surfaces that the native tool creates. Well, at the cost of some slight deviation.

spb_Fin.py (52.9 KB)

3 Likes

I totally agree. With some extra effort and customization, Rhino could become a true powerhouse. :muscle: :muscle: :muscle:

1 Like

Especially the best fillet tool for Rhino to date! @jim did an extraordinary job on this one!

It has 4 versions. I mostly use the original version (first in this list):
FilsrfEX.py (40.1 KB)
Filsrf_crvs2.py (41.2 KB)
Filsrf_Join.py (69.1 KB)
Filsrf_JoinV2.py (75.1 KB)

7 Likes

Just discovered this thread (LOTS of interesting stuff!), here’s something I did some time ago:

3 Likes

Thanks Alan,

So it’s basically like thinking about the keys your left hand sits on in a plus configuration. What I mean by plus:

So it’s up (E) down (C) left (S) right (F) center (D)

When making macros, this can apply to all sorts of commands and feels very intuitive.

Some things I use it for are:

Align: AE (Top), (AC) Bottom, (AS) Left, (AF) Right, Concentric (AD) and then I use Center-Up (DE) for VertCenter and Center-Right (DF) for HorizCenter

Quickly Change Views: VE (Top) VC (Bottom) VF (Right) VS (Left) VD (Isometric) V1 (1 Point Perspective) V2 (2 Point Perspective)

Scale1D (using the scripts I posted above) SS (Scale from Left) SF (Scale from Right) SE (Scale from Top) SC (Scale from Bottom)

Here’s a quick demo showing how it works. As you can see there’s not a lot of clicking or mouse precision needed and they work pretty fast.

3 Likes

I can try to modify! I just made it using ChatGPT though so we’re dependent on its skill level :sweat_smile:

Can you clarify a bit more what you’d like these four options to do?

1 Like

@Rhino_Bulgaria I tried looking it up, but couldn’t find “fin” in the context of 3D modeling terms. Could you (or someone) define what is considered a fin, precisely?

Thx
Alan

1 Like

“Fin” in Rhino help:
Fin | Rhino 3-D modeling
Usually a fin surface is understood to be a surface perpendicular to or at a given angle relative to a surface, surface edge or curve on surface.

2 Likes

Ha, never considered checking Rhino Help :sweat_smile:

Thanks.

1 Like

They have the best help docs. It’s not normal to be able to rely on such a thing in this world, but the Rhino docs are on a whole nother level than the rest of the world.

I remember reading them over and over countless times in my early years and learning pretty much everything about Rhino cause the docs were so awesome.

I think the docs are still really good, but it seems like some of the nomenclature has been simplified a bit in the new ones.

Usually other softwares have really bad help docs and they want you to pay thousands $ for training every yr.

The forum is the best here too though, cause you can ask newby questions and they might just give you a link :face_holding_back_tears: :melting_face: :grin: or even files and scripts, macros, plugins :smiley:

I had fun using ‘fin’ in my early days, but I’m glad we have that new ‘ribbon’ tool, cause that’s pretty cool :face_holding_back_tears:

2 Likes

Ribbon’s a good one :slight_smile:

1 Like