Grasshopper

algorithmic modeling for Rhino

Hi,

I am trying to find a way of changing the display unit in 'panel' component from mm to m. I understand that GH doesn't really care whether it is inches, mm, m or whatever but for the purpose of want I am doing I would like the 'panel' component to display the line length in 'm'. Please see screenshot attached.

Hope someone can help.

Thanks

Regards 

 

Views: 2530

Attachments:

Replies to This Discussion

Grasshopper could extract the unit system currently in use in Rhino, but unless the *.gh file has something to do with the currently loaded *.3dm file that may not make any sense.

Alternatively Grasshopper could define a unit system per file (just like Rhino does) which then immediately applies to all numbers and shapes inside that file. 

Another option is that each individual number could be associated with its own unit system via meta-data (Grasshopper 2.0 only, since GH1 doesn't support metadata). This, although very flexible, sounds very complicated to me, and might cause a lot of confusion.

The simplest option, which is already possible now, is to leave all the formatting and conversion up to the user. You could create a custom format component which takes a number (assumed to be in metres) and displays it as though it's in millimetres. Such a solution can be made more integral in future versions, and I think it is the solution I'd prefer.

Attachments:

Would be really nice to be able to bind and serialize gh files within 3dm files... 

Hi David, thanks for your reply.

Can you please explain how I can change the unit system of the Grasshopper file?

My GH model is not directly linked to Rhino. I have algorithms created in GH interface which creates an origami type foldable shape.

So, my control parameter is the angle between two plates and the planar dimensions of plate (defined in local x and y-plane). I use number sliders to vary the angle and the size of the plate. Then, because some of its geometry is governed by the 3 control parameters mentioned earlier I wanted to measure some part of the deployed configuration to determine the length i.e. by creating a line of the interested parts and measuring the line length using the 'panel' component, and this was giving me an answer in 'mm' hence why I have to define my rectangle shape plate dimension 'number sliders' in 'mm' i.e. put a range of 0mm - 1000mm.

Hence, i was finding a way where i could change the 'panel' component result from 'mm' to 'm' so that i could define the 'number sliders' for my rectangle plates in 'm' i.e. 0m - 1m.  

Can you please explain how I can change the unit system of the Grasshopper file?

Sorry, I meant that it could be a possible solution in the future. There's no way to do that now. The fourth options is the only possible thing right now.

That's fine. 

Again thanks for the reply and sharing the formatting GH file. :)

formatting_v2.gh

Hi Farjad,

I really enjoyed the script you made, and I wanted to go back to make a toggle that would allow you to make conversions depending on your existing document file settings.

I noticed one thing - how do you get decimals to return?  

RSS

About

Translate

Search

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service