Quantcast
Channel: Scripting - McNeel Forum
Browsing all 4114 articles
Browse latest View live

Modify Instance Definition Slow

Using the, InstanceDefinitions.ModifyGeometry() to modify multiple blocks with python in a command. sometimes it is very fast and other times it is very very slow. Are there any tricks or tips to...

View Article


Variable Curve.OffsetOnSurface

Documentation states that since Rhino 5 there is an overload method to offset a crv on a surface, by variable distances:...

View Article


Image may be NSFW.
Clik here to view.

Python message error

hello!!! what does mean: , when i launch the python script from the Python editor, the script run, but from the button with ! _-RunPythonScript “script.py” it give this message… 1 post - 1 participant...

View Article

IsVectorParallelToPlane

what is the simpler way to verify if a vector or a line is parallel to WorldXYPlane? i Can substract Z coordinates of the start and the end point of the line, if it’s equal to 0 the line is parallel....

View Article

Can I select an Layer and Delete the others using macros?

I know I can select the others layers one by one using macros, but the layers that I want to delete sometimes comes with diferent names, so the macro will not work always. 3 posts - 2 participants...

View Article


SubD object type is not recognised as solid

Hi Here is an old SolidWeight script by @dale that I slightly modified to print gemstones weight in carats. I’ve added 2 object types that didn’t yet exist when the original script was written. SubD...

View Article

How to change the default value of the rs.command in the python script

Hi everyone, I used a script to generate a frame-like model. The basic procedure is ‘create a surface- extrude surface- flow the surface on a circle’. The script works well to generate the model....

View Article

Image may be NSFW.
Clik here to view.

Script for hatch command

Hey guys, Can anyone help me with a script that would work as follows: I start with a closed curve that I have selected and I run this script. It runs the hatch command, prompts me to select the...

View Article


Image may be NSFW.
Clik here to view.

Python - Create Rhino/VRay materials from list of textures

Hi, I have a collection of 1000+ different PBR textures in different folders and have been trying to write a Python script to sort the different textures by name (e.g. Asphalt01, Asphalt02… Wood09)...

View Article


Storing calculations inside class with python

Hello, I want to create a class with a number of related properties which are calculated inside the class when certain property is assigned but I can not make it… python code below is a simplified...

View Article

Image may be NSFW.
Clik here to view.

Operation between a datatree and list in python

math between datatree and list.gh (6.5 KB) Hello, I´m working on a code in python with two lists as inputs. One of these lists is transformed in Datatree inside the code and then, I´m trying to do a...

View Article

Frustrating experience with Python code which sometimes work and sometimes...

I have a simple piece of code that sometimes does not work and after a while does. It’s driving me insane as it is impossible to debug. The original code comes from here I am trying to get the Scale...

View Article

Export Selected path

Is there a way to create a script to Export Selected to AI (or whatever common extension) using the current (or user inputted) filename to the current file path. I do a lot of laser cutting and 3D...

View Article


A question: How to make CurveIntersection inside GHpython?

An error occurred when I tired to make curve intersection in GHpython. Can any kind person help me? The code is as follows: import rhinoscriptsyntax as rs import ghpythonlib.components as ghcomp...

View Article

Request: script or way to invert selected within same layer

just curious if someone has something floating around that would basically invert selected but only using objects on same layer to select? also this would only need to work with one layer for...

View Article


Image may be NSFW.
Clik here to view.

Batch change script or command to change the detail viewport display mode in...

I’m working on large projects that require anywhere from 2-6 details on a layout. Is there a script, command, or plugin that is available that would allow me to batch change the display mode of the...

View Article

Python Int Divide By Int Equals Int?

Is it normal for Python to do a int / int = int with imported scripts, but int / int = float when in the main script? I had everything in one script 90 / 360 = 0.25, but after I refactored and...

View Article


Image may be NSFW.
Clik here to view.

Guid to Point3d

Hello! I have used “rs.RotateObject” to generate a point(a guid of a point). and i have a point (Point3d). i want to use “rs.AddCurve” to add a curve to my Rhino but this is the error I have gotten...

View Article

Image may be NSFW.
Clik here to view.

Custom function to use ColorPicker with alpha

In response to another post here, I made a small definition to be able to call up the V7 color picker with the alpha sliders enabled - which rs.GetColor() doesn’t do yet. I ran into one interesting...

View Article

Image may be NSFW.
Clik here to view.

rs.ObjectName Throwing 'str is not callable' Error

Here is the relevant code. fingerRail = rs.AddCircle(rs.WorldZXPlane(), rad) #name = 'Size {:.3f} + {:.3f}'.format(opt.Size, offset) name = 'fred' rs.ObjectName(fingerRail, name) fingerRail is a...

View Article
Browsing all 4114 articles
Browse latest View live