Grasshopper

algorithmic modeling for Rhino

Hi guys,

i am wotking on a very simple model to later plug in to galapagos. The escript is fairly easy. I have my total project area (which of course the parameters can vary) and i multiply it by the % area of each program to obtain the individual program area, which the sum of its parts, will equal in this example, 120,000m2. What  Icould not figure out until the moment is if i change the prorgam sliders in new proportions how can i restrain it to not pass de 120,000 limit. I.e how can the sliders change proportionaly to each other to maintain the 120,000 m2 which is the total area. 

Thank you! attached is an image and the GH script.

Views: 681

Attachments:

Replies to This Discussion

This is just a proportion, maybe you want something more complex... ?

Attachments:

Riccardo thank you for your reply!, yes i do need something more complex, i need to see the program sliders change when i change one of them, while keeping my 120,000m2 or any other area.

Do you have any idea how i can do this?, or is it beyond grasshopper components and needs scripting?

Cheers

Nicolas

You'll need scripting. I have low knowledge there....

Maybe c#...

Here is a good start from where I would start...

http://www.grasshopper3d.com/forum/topics/change-number-slider-para...

David's attachment.

Edit:

if you comment* the last and the last but two lines of command

slider.Slider.RaiseEvents = false;

and

slider.Slider.RaiseEvents = true;

David's script will edit target slider "Target" LIVE, but as he stated this is ILLEGAL

I don't know what could happen, like:

-freeze/crashing GH or even rhino;

-BSOD;

-unistalling your PC and losing ALL your datas even in offline backups;

-call FBI;

-rapture.

YOU HAVE BEEN WARNED!

* add "//" at start of a line of command to disable it by making it just a comment

but this is indeed certainly interesting and we'll work over it!

HA!

:D

"Done".

Took original code from Peter Fotiadis in his dicsussion with Arend here:

http://www.grasshopper3d.com/forum/topics/c-access-sliders-question

(By disassembly their definition/codes I managed to "feel" some logic to end the work, credits to them)

I still don't know well how it works, it's just a patchwork from something already done, like a Frankenstein's monster XD.

So, be careful while using this.

Maybe this still do something "illegal" like said above, maybe it could crash and you lose your data, ecc.... just, be careful...

Attachments:

Thank you Riccardo for putting your time into this! Well, this is kind of scary, "illlegal" stuff and so forth but thank you for the heads up! Ill let you know if anything wierd happens

hello, Riccardo,

I have a similar case. But I would like to change the points of a triangle while keeping the area the same (972). Is it possible to further develop the code for my case? Sorry that I don't have experience in C#. 20191216_c_multisliders_percentages.gh

Hi Tiantian.
This forum is somehow closed.
You should use this one instead https://discourse.mcneel.com/c/grasshopper/

About your request, I don't understand it.

Can you explain better your situation? What are you trying to do?
What do you mean with "change the points"?

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

© 2020   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service