Quantcast
Channel: Scripting - McNeel Forum
Viewing all 5820 articles
Browse latest View live

Stamp with python

$
0
0

hello…
on layouts, sometimes i need to add a symbol, i would like to make a python scipt, that it make the polyline and i’ve just to click to put it where i want.
there is two versions of this symbol, and i can rotate it every 90°, i know how i can change this, but i don’t know how i can have the dynamic preview at the end of my mouse’s cross…

is it clear?

1 post - 1 participant

Read full topic


Data type in python

$
0
0

(topic withdrawn by author, will be automatically deleted in 24 hours unless flagged)

1 post - 1 participant

Read full topic

Script - Change Block's+Dependencies layer but Maintain All Colors

$
0
0

Hi All,

When importing some autocad drawings i want to move them on a specific layer.
Usually there are many nested blocks which are making my layer layout look messy every time i import an autocad drawing.
For that reason what i would like to find a way to move the selected block (and all dependencies) to one layer and also to maintain the color properties.

To give an example:

In screenshot below the block belongs to layer Block-Truck.
I would like to move the block of truck to their respective Deck Level and be able to purge and remove the layer Block truck.

block.3dm (53.2 KB)

Would that be possible?

1 post - 1 participant

Read full topic

Eto Slider - Showing current Value

$
0
0

Hi!
I’m using Eto in a Python script to get user input. I am using the slider to choose a value, but since the slider only shows ‘ticks’ it’s hard to be sure which value was chosen. I managed to show the value at the beginning, but not to update it as the slider is moved.

How could I show the current slider-value in the Eto form as the slider is being used?
Alternatively, would there be a way to show actual values instead of simple ticks?

1 post - 1 participant

Read full topic

Automatically annotate a set of points with X,Y,Z coordinates

$
0
0

Hi All,

I’m trying to find way to automatically annotate multiple points specifically to show the XYZ coordinates.

point set.3dm (52.8 KB)

5 posts - 2 participants

Read full topic

Rhino.Input.Custom.OptionInteger

$
0
0

hello,
in a script i would like to use Rhino.Input.Custom.Option but with a string and not integer or other.
for example the custom option default is Up, so the command line offers three other choice:
Down, Left and Rhight,
if i clic ‘Down’, the command line will change and offers the three other choice, Up,Left and Right…
is it possible?

4 posts - 2 participants

Read full topic

Line Width and color... RhinoCommon

$
0
0

hello,
i search to find by myself in the API DOC Rhino Common, but it’s really hard… some times i found, but there must be a method to search in this document…

if i want to know the method to modify the width or the color of a
Rhino.Geometry.Polyline(pts3)
how can i do, i search line Width in the search bar… but nothing about this…

OnlyFP.

3 posts - 3 participants

Read full topic

Generate name Callout for multiple objects

$
0
0

Hi All,

I’m wondering if anyone has published a tool to automatically generate object name callout for multiple objects.

Perimeter.3dm (2.4 MB)

1 post - 1 participant

Read full topic


RhinoCommon equivalents of PlanarUnion, PlanarDifference, PlanarIntersection?

Apply "planner curve" command to multiple object but one by one,not all together

$
0
0

Hi everyone!
is there a way to Apply “planner curve” command to multiple object but one by one,not all together in order to avoid the self intersect error message?
all curves are planner and closed, but they may intersect, I just want to apply the command to each curve on by one so that I get a surface for each one.
it’s 13000 surfaces, so, thanks for helping because it would be great…

3 posts - 3 participants

Read full topic

Mondrian Subdivision Through Points

$
0
0

I have a python script which does a mondrian subdivision. This is where an initial rectangle is split into two or more rectangles - then those rectangles are split into two or more rectangles, etc. Right now, the splits happen at random points between parameters set it grasshopper. However, I would like the splits to happen through a set of points which are already determined. Can someone point me in the right direction on how I might do this because I’m new to Python. I read the RhinoPythonPrimer over the weekend (which was well written and funny) but I’m still lost. I’ve attached the file for clarity.

Mondrian Split Through Points.3dm (681.7 KB) Mondrian Split Through Points.gh (8.0 KB)

2 posts - 2 participants

Read full topic

Rhino 7 error - RhinoScript AddMesh method

$
0
0

Hi everyone,

I would like to bring to your attention an orror on AddMesh method that has appeared with rhino7. The error does’nt exist in rhino5.

Some more description :slight_smile:
strMesh = rhino.AddMesh(arrNode, arrFace) gives (strMesh = Null) answer.

It is important here to specifiy that

  • arrNode is a list of for example 1000 points,
  • arrFace is a list of for example 1000 faces, but only the first 600 faces (for example) are valid, and after that the remaining 400 faces are array(0,0,0,0), so they all refer to the same point arrNode(0), which happens to be array(0,0,0).

This wasn’t a problem with rhino5, but it is now with rhino7. We would be very glad that the problem is fixed, because it is quite important for our internal engineering plug-in.

An image to picture what kinf of meshes we are talking about :

An other image that identifies the code context. We have been using this script just fine for 6 month. It seems that addMesh function in rhino7 is less permissive that in rhino 5 :frowning:

Best regards,

1 post - 1 participant

Read full topic

Can't import filenames with blanks in - Rhino7, python

$
0
0

Hi
Hope everyone is doing well.

Running Python script in Rhino 7.
I can’t get import to accept blanks as part of the file name. No matter what I do it uses first blank as
an enter and chops the the name off after the “~1”.
I’ve seen other examples where chr(34) was used but it was for vb.

print “xxxxxxxx”
fname = “~1 10 3.35 x 4.55.stl”
command = “-_import " + “’” + rs.WorkingFolder() + “\” + “stones” + ‘\’ + fname + “’” + " -_enter”
print "My current directory is : " + command
rs.Command(command)

7 posts - 4 participants

Read full topic

The polyline objects are overlapping, how to remove short curves?

GetPageViews or get RhinoView from file in the RhinoCommon API

$
0
0

Hello

I´ve been trying to use the Rhino.Display.ViewCapture.CaptureToBitmap() from the RhinoCommon API but it is returning None:

import Rhino

rhino_file_viewtable = rhino_file_instance.Views
viewportinfo = rhino_file_viewtable.FindName(“Top”)

rhinoviewport = Rhino.Display.RhinoViewport(viewportinfo)
viewcapturesettings = Rhino.Display.ViewCaptureSettings(rhinoviewport, 400, dpi)
bmp = Rhino.Display.ViewCapture.CaptureToBitmap(viewcapturesettings)
print (bmp) # RETURNS None

I suspect it is due to the rhinoviewport not being a RhinoView, which is returned by the GetPageViews () when using scriptcontext.

Any ideias on how to use the GetPageViews in RhinoCommon API (returning a RhinoView?) or alternativelly, getting a RhinoView from an existing file?

Thanks

4 posts - 2 participants

Read full topic


Iteration points

$
0
0

hello every body, i’ve got a closed polyline, and i would like to know how many 90° angles there is.

so i wrote:

    points=rs.CurvePoints(cont)
    for i in range(0,len(points)-1):
        angle=rs.Angle2( points[i] , points[i+1] , points[i+1] , points[i+2])

if i have 4 points, i can have easely angle between

  • line point 0 to point 1 and line point 1 to point 2
  • line point 1 to point 2 and line point 2 to point 3
  • line point 2 to point 3 and line point 3 to point 4,

but how can i script the line point 3 to point 4 and line point 4 to point 0?

8 posts - 3 participants

Read full topic

Use Rhino.Python to manipulate the Gumball?

$
0
0

Is it possible to use Rhino.Python to manipulate the Gumball location? The reason for this question is that I am generating some geometry from a Python script, however the Gumball is not located at the centroid of the geometry when I select the object. I would like to calculate the centroid and then place the Gumball at the centroid. Otherwise, I have the extra steps of manually relocating the Gumball from within Rhino.

3 posts - 2 participants

Read full topic

Changing dot secondary text problem

$
0
0

Hey guys, i tried to change a dot secondary text and dosen’t work , what i m missing?

import rhinoscriptsyntax as rs

textDot = rs.GetObject(“Select textDot”, rs.filter.textdot)
textDot = rs.coercegeometry(textDot)
#print textDot.SecondaryText
textDot.SecondaryText = “Test”

2 posts - 2 participants

Read full topic

Plug In Compiler

$
0
0

It has been quite a while since I have had to compile a plug in for Rhino is there any info out in the public domain for guidance on this. I also cannot remember if the actual RVB script has to be part of the deliverable along with the RHI, RHC, RUI etc or once the file has been compiled it becomes embedded in the RHI installer package and no longer references the original RVB file.

Lastly is there any way to encrypt or add a license to a plug in these days.

1 post - 1 participant

Read full topic

Any way to query the location of a sphere object?

$
0
0

I’m using Python for Rhino, and I was wondering if there is a way to query a position of a sphere object using its name or GUID. I realize that the concept of position is not well defined for generic objects, but given that spheres have a clear definition of position I was hoping it might be possible.

3 posts - 2 participants

Read full topic

Viewing all 5820 articles
Browse latest View live