Grasshopper

algorithmic modeling for Rhino

Hello Everyone,

I am trying to create a spotlight using python and rhinoscriptsyntax. The first two inputs are as point3d item acces, and the slider is a float item access. I get the following error

1. Solution exception:'GrasshopperDocument' object has no attribute 'Lights'

and in the compiler:

Runtime error (MissingMemberException): 'GrasshopperDocument' object has no attribute 'Lights'
Traceback:
line 138, in AddSpotLight, "C:\Users\Gabriella\AppData\Roaming\McNeel\Rhinoceros\5.0\Plug-ins\IronPython (814d908a-e25c-493d-97e9-ee3861957f49)\settings\lib\rhinoscript\light.py"
line 3, in script

any help is appreciated :)

Gabriella

Views: 282

Attachments:

Replies to This Discussion

Ok if anyone is interested, the correct code is the following:

import rhinoscriptsyntax as rs
import scriptcontext as sc
import Rhino

sc.doc = Rhino.RhinoDoc.ActiveDoc
a = rs.AddSpotLight(base,radius,apex)

kudos to  tang li qun for the inspiration (from here http://www.grasshopper3d.com/forum/topics/lights-in-grasshopper)

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service