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

Insert a subfunction in the middle of command?

import rhinoscriptsyntax as rs ort = rs.Ortho() rs.Ortho(False) def on(): rs.Ortho(True) rs.Command(‘_Leader pause’) How to insert the open orthogonal effect in the middle of the command command? 1...

View Article


Hide Layers in Layer Panel via Eto.Form / Script

Hi, I use a template for all my models which has +150 layers, but frequently I only need say 10 in each actual model. Once the model is built, I can filter the layers that are visible in the Layers...

View Article


Image may be NSFW.
Clik here to view.

How to Use ReplayHistoryResult?

I want to manipulate geometry in Rhino from ETO forms with sliders using python. I can kind of do it, but the geometry looks very choppy as it updates and updating is only truly possible in wireframe...

View Article

WebView2 in R7 with ETO using Python

Hey all, is it possible to use WebView2 for Rhino7 in Python? Thanks! 1 post - 1 participant Read full topic

View Article

[Windows Only]: R8 Parameter is not valid to create System.Drawing.Bitmap

Hey all, it doesn’t seem like I can call System.Drawing.Bitmap like the snippet below on Windows. However, the same code works on macOS. How can I fix it? Thanks! web_client = System.Net.WebClient()...

View Article


IronPython global name '__transformers__' is not defined

Hey all, I’m making some network request on R8 using python 2.7. I noticed that if the network request is made immediately when the plugin starts to run, I have a chance of running into this exception...

View Article

Image may be NSFW.
Clik here to view.

Is Sweep1 Broken in Rhino.Geometry and Grasshopper?

It works fine with circlular rails, but you can see that for rectangular rails, I get a crazy result. This is the code: rectangle sweep problem.py (855 Bytes) What am I doing wrong? Update: It seems...

View Article

Directions of the Principal Axis of a surface with Python script

the Rhino command AreaMoments returns, among other things, the direction of the principal axis of the surface. The correspondong rhinoscript command SurfaceAreaMoments does not return those...

View Article


Synchronize cpython between workstations

What is the best way to synchronize multiple workstations using cpython with several packages in Rhino8. I tried C:\Users\myuser1\.rhinocode\py39-rh8>./python -m pip freeze >...

View Article


How can I implement Eto.Forms.Filtercollection in python

Hi, I’d like to refresh the datastore of my Eto.Forms.TreeGridView. I’ve read this topic and the documentation and appearently I can pass a FilterCollection object to the TreeGridView.DataStore...

View Article

Image may be NSFW.
Clik here to view.

Rhino Plugin - hidden command appears in toolbar

@eirannejad I’ve made a plugin using the ScriptEditor, marking a command as Hidden, but the command appears in the plugin toolbar: Is this expected? If so, how can I hide the command from the Toolbar...

View Article

Iron Python keep selection

I can select edges of a brep within an ironpython script. I can see the highlighted selection in Rhino, if I execute time.sleep(5). After the script is finished, the selection dissapears. How can I...

View Article

Brep Solid Orientation for mesh?

Hi, Is there any method as for BREP to know the orientation of solid? I am referring to this RhinoCommon method: https://developer.rhino3d.com/api/rhinocommon/rhino.geometry.brep/solidorientation What...

View Article


DetailViewObject => Commit changed to detail

Hello dear colleagues, can someone describe difference between the two methods: DetailViewObject.CommitChanges() RhinoObject.CommitChanges method and DetailViewObject.CommitViewportChanges()...

View Article

Performance of NamedSelections

I need to create >80 NamedSelections and do other NamedSelections operations like list and delete for my parametrized models. Usually, I try to do everything in RhinoCommon, but unfortunately,...

View Article


POSTMAN and Python long response time

Hello Team, We are experiencing some issues when we are sending requests from POSTMAN and Python when we are sending GET message below: http://185.229.27.37:5000/sdk before it works and returns...

View Article

Image may be NSFW.
Clik here to view.

RhinoCommon VectorAngle

In Rhino 8, using Rhino.Geometry, cannot compute angle between two vectors. “TypeError: Rhino.Geometry.Vector3d value cannot be converted to Rhino.Geometry.Vector3d in method Double...

View Article


How to modify a block definition in python?

I want to get an object from a file and add it to the block definitions (I figured out how to do this). Then, I would like to add other obects to the block definition. This is what I’ve got so far...

View Article

Point comparison - which method is fastest?

Just out of curiosity, there are several methods that one can use to compare two points, notably: if ptA.DistanceTo(ptB)<tol: return True if ptA.DistanceToSquared(ptB)<tol: return True...

View Article

Weird Python Array Pitfall (or, I Didn't Know How Python Classes Work)

So it seems that if you create a class and declare an array in that class outside the __init__() function, the array will be treated like a class variable (even though you must refer to it as...

View Article
Browsing all 5938 articles
Browse latest View live