Grasshopper

algorithmic modeling for Rhino

Hi at all,

I tried to run the following example from code.algorithmicdesign, but I'm not able to do so... maybe you guys can me help :)


The definition can be download by clicking on the definition image.
The code below the definition, I added to the pyhtonscript-component, without success.

Example 1

Example 2

Views: 1524

Replies to This Discussion

What are the runtime warnings you're getting? It will surely narrow down the failure reasons.

On the other hand, the code provided below the image, is not code for the gh component but for the python editor in rhino.(i.e rs.GetInteger or similar). This won't do, in your case. have you got some other working code?

M.

oh, thanks for your hint...
it is not really necessary that it is connected with grasshopper, for me it is enough if it just works in rhino, but it does not...

especially this code:

Code

I got this messages:

"Message: global name 'pts' is not defined"

On this Code:

Example 2

I got this message:

"Message: global name 'box' is not defined"

Maybe you have some advice for me :)

Will look into it as soon as possible, but it seems that you are missing some variables.. In this case pts looks like an array of points.. Check if there is actually a pts = rs.getobject prompt in the script! The box one seems like a similar case!
M.

at the script with the box, some lines was commented out (the getobject-part), with this part, I got ask to select some curves and a box, but if I do so, I got a new error: "Message: 'int' object is unsubscriptable"...

It would be awesome if, you could take a look into, I'm seriously not a programmer ;)

thanks for your help :)

Hi Michael,

I took a quick look at the code. It is actually working in gh so you need a python component to host it. 

More in detail the global name box fails to collect data if you run it in the pythonscript editor in rhino, you should either add in the main routine some lines such as pts = rs.GetObjects("provide some points from rhino",rs.filter.point) or to rebuild the grasshopper definition as the snapshot at this particular post indicates. be careful with the access type(either list or item)

In the second case you have some commented out rhinoscript gets but if you reactivate them won't make any difference cause the subroutines are using some list. So you are just going to get out of index warnings. This also a gh compatible pythonscript/..

If you manage to recreate the gh definitions as in the snapshots, I would be able to take another look..

Best,

M.

hi marios,

thank you so much for your help...
okay, I have recreated the gh definition of the genewave snapshot...

Attachments:

the some I did with the noso definition...

but without success :/

so I hope in you :) thx

Attachments:

ok, this (genewave)is working..It just needed some input declaration and a few adjustments in the code..

the other one has no code inside the python component.. remake it from scratch..

best,

M. 

Attachments:

oh yeah, you are the best...thank you so much. you are

Attachments:

No worries,

However this seems to be the same file.. please make a new python component with the same inputs and the code inside. In order for me to be of assistance

m.

Hi, Mario.

I just come to learn same question I have.

Code - for this guy.

I had same message and managed to recreate with GH definition in Rhino as snapshot. 

But then had another error message, iteration over non-sequence.

When you have a sec, could you please kindly have a look at the definition that I've attached?

Many thanks!!!!

Attachments:

Hi Lee,

did you found a solution? Maybe Mario stops to follow this post...

By the way, you did not connect the 'Coulor HSL'- Component with the 'meshcolors'- input of the phyton-component, instead you connect the 'mesh'- component with it...


but that solves not the error messages we have ..

mh

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service