Grasshopper

algorithmic modeling for Rhino

vb module produces point array ; problem to put these points into another component

hello everybody

i am new here and so i have first to cheer you all !!!


my problem is, that i am producing within a vb component a point grid with several parameters that is stored in a on3darray.

i need exactly that on3dpointarray within another vb component.

when i try to get the inputted points into an on3dpointarray then i have some issues with paths because then every on3dpoint in stored in a differnt path of the array.

so my question is:

how do i get an array out of this where all points have the same path.

i expect there must be some way to access the single point data within an array that has these points in different paths within vb script environment...

please help me to find out the syntax to acces a single on3dpoint inside of this datatree or path structure.

like pt = array({0;0;0}, (0)) 'imaginary syntax


this prob really hurts my brain....

thanks a lot in advance!

heinz

Views: 372

Replies to This Discussion

Hi Heinz,
Can you post your code?
Hi Rajaa,

the first module is meant as a point generator plugin, for example
'=============================================
Dim startarray As New On3dPointArray
A = startarray


For i As int32 = 1 To boidnum
Dim max,min As Int32
max = gridsize
min = 1
Dim pt As New On3dPoint((Int((max - min + 1) * Rnd + min)), (Int((max - min + 1) * Rnd + min) ), 0)
startarray.Append(pt)
Next
'=========================================================


in the second vb module i would like to receive that array


'=========================================================

Dim pt As New On3dPoint
pt = x
Dim arr As New On3dPointArray
arr.Append(pt)
A = pt
B = arr
'==========================================================
when i watch the output of the point i see all pointdata of the array in module 1 stored in one point in one path
but i haven't found out how to address these single points since there is as far as i know no index for it, so i try to get the point data in an array.

when i watch the output of the array every single point data is stored in a seperate path,
like
{0;0;0}
for point one
{0;0;1}
for point two

i think without working with vb it would all work with a flatten module...

but since i need the data as input for a vb script module this is no help... :(

i dont't find a way to reduce these paths to a single one which i can work with...
or another way to address the points in the multiple path array....

'==================================================

the reason why i'm tryin to do this with seperate modules is that i am generating point
data using different parameters which then is processed by several algorythms which for them selves use different parameters....

when the generator (, the example with the random points is just a special case which is easy to explain and shows the problems that are following) produces a result i am happy with i would like to process through other algorythms. when i change there parameters the whole vb module will update and so the point data of the generator will update aswell.
thats the point why i try to put different things in diffenernt vb nodes.



i have yet tryied to use the workarround with a custom .dll but in my case it doesn't work. i am not shure why, because i followed the way posted in this forum.
And the strange thing is that when i try to uns the dll , i added it to referenced assemblies the autocomplete in the editor window knows the name and completes it right, it even shows what arguments are expected, but when i hit ok butten of the editor window... the promt is 'type expected' like there was nothing written after the 'Dim xxx As New' command....

when i got the solution for this problem i'll write a detailed tutorial on how to create and use custom dlls . because i think thats a very good way to workarround problems.

thanks a lot for your answer!

sorry for my bad english....

*love grasshopper thanks a lot to the developpers, it really rocks!!!*

heinz
Hi Heinz,

From what I gathered, your first module generates a one-dimetional array of points and I assume you assign these points to the output, for example:
A = startarray

Then in the second module you like to get this list. What you need is to assign type to the points list to be 3dpoint and most importantly check the "list" option (unless you like to process one point at a time in the second module). You should get points in the same order you creates in module 1.

Is that what you need?
If not, please post the .ghx file.
hallo rajaa,

thank you so much. now everything works like intended. "most importantly check the "list"option"...

i wish you a nice sunday

cheers

heinz

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service