Grasshopper

algorithmic modeling for Rhino

Sliders and Python to change output range of Graph Mapper

Hello Junglists,

I am trying to use sliders and Python to change the output of my graph mapper. What I got is:

import Grasshopper as gh

for obj in ghenv.Component.OnPingDocument().Objects:
    if type(obj) == gh.Kernel.Special.GH_GraphMapper and obj.NickName == "Offset":
        print "True!"

This is working and prints "True!".

I also found gh.Kernel.Special.GH_GraphMapper.GetValue/SetValue. But I don't understand the help for those two methods. Not even if they are the ones I am interested in.

Views: 834

Replies to This Discussion

The range is stored in an internal GH_GraphContainer and set directly via the GraphEditor. If I remember this right, Get/SetValue is the default way of a parameter object to interally access the stored data.

Somehow I didn't see the container was exported as a public property. I was referring to it's type, which is Grasshopper.Kernel.Graphs.GH_GraphContainer.

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service