Grasshopper

algorithmic modeling for Rhino

Hi everyone (and David especially :) ),

I'd like to be able to instantiate a component with assigned valued in one or more of his inputs as one can do with panels, operators and sliders.

When you double click on the canvas you type '//' as shortcut for panel and what you write next is automatically populating the instance of that panel.

How can one replicate it?

Thanks!

Views: 641

Replies to This Discussion

You can't add any special codes (like // or " or date/time notation) as those are all handled internally by the search window. You can however make your object initialization aware. If your object (component or whatever) implements the IGH_InitCodeAware interface you will have to add a method called SetInitCode(string) which will be called after the constuctor and you'll get whatever came after the equals symbol. Thus, if the user double clicks and types 'YourComponent = 4, true, 99%' then the string passed to SetInitCode will be " 4, true, 99%". You'll be in charge of parsing and interpreting it.

Marvelous! thank you!

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