Quantcast
Viewing all articles
Browse latest Browse all 4137

MissingMemberException: 'Rhino.Geometry' object has no attribute 'Rhino'

hey so i try to run this code but get always an error, the code is below and i tried changing line 24 to something else like : radians = angle * math.pi / 180 or import math then radians = math.radians(angle) but none of it works, i also tried in both rhino 7 and 8 same error:

import Rhino
import rhinoscriptsyntax as rs

Define circle parameters

radius = 5.0 # meters
num_pillars = 10

Calculate angular spacing

angle_spacing = 360.0 / num_pillars

Function to create a pillar object at a specific location

def create_pillar(x, y, height):
pt = Rhino.Geometry.Point3d(x, y, 0.0)
circle = Rhino.Geometry.Circle(pt, radius)
cylinder = Rhino.Geometry.Cylinder(circle, height)
rs.AddObject(cylinder)

Loop to place pillars

for i in range(num_pillars):
# Calculate angle for current pillar position
angle = i * angle_spacing

# Convert angle to radians for trigonometric functions
radians = Rhino.Geometry.DegreesToRadians(angle)

# Calculate x and y coordinates based on radius and angle
x = radius * math.cos(radians)
y = radius * math.sin(radians)

# Create the pillar object
create_pillar(x, y, 2.0)  # Adjust height as needed

Print completion message

print(“Created”, num_pillars, “pillars in a circular arrangement.”)

4 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 4137

Trending Articles