Can someone show me how to use and array for this task.
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2006-07-06 05:08 PM
‎2006-07-06
05:08 PM
Thanks in advance.
Brian
8 REPLIES 8
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2006-07-06 07:33 PM
‎2006-07-06
07:33 PM
I'm not sure I'm following. The materials change from cprism to cprism? You would need a separate parameter array for the materials, since it's a different parameter type. (You couldn't have [1][1]=1', [2][1]=2', [3][1]='Brick')
Within the loop, you can refer to as many arrays as you want.
Within the loop, you can refer to as many arrays as you want.
!! I assume you've defined the arrays. FOR k=1 TO n X1=points[1]Y1=points[2] MATERIAL mats ADD X1, Y1, 0 CPRISM bla, bla, bla, DEL 1 NEXT k

Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2006-07-06 08:16 PM
‎2006-07-06
08:16 PM
James: Thanks for your response. All that I am trying to do is allow different material be selected from an array each time a routine passes through a loop. The material in the array needs to be user defined for each object created by the loop. Spacing of objects is already calculated by the code. I have purchased objects/library parts before that allow user to edit tables (or arrays) to change materials.
For example: My program places "Golf Tee" shaped items on a 1' x 1' grid. If the user inputs a grid that is 10' x 10', it will produce 100 TEEs. I would like to edit a material property to produce a user editable array (or table) of the 100 TEEs with the ability to designate the color of each individual TEE.
For example: My program places "Golf Tee" shaped items on a 1' x 1' grid. If the user inputs a grid that is 10' x 10', it will produce 100 TEEs. I would like to edit a material property to produce a user editable array (or table) of the 100 TEEs with the ability to designate the color of each individual TEE.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2006-07-07 02:50 AM
‎2006-07-07
02:50 AM
Hmm. You want 100 material parameters? Or even n^2 material parameters?
The 100 is feasible, you can use a parameter array, [10][10]. The n^2 is tough. The only way to offer all the materials to the user is in a parameter array, and I don't think those can be of indefinite dimension. You would have to set some sort of limit for n.
Then you would probably want a UI script to make it tolerable to have so many parameters.
Can I ask who would want to set n^2 materials?
Maybe you could do a smaller set of mats and randomize them across all the parts. I've seen that done, would have to check into how...
The 100 is feasible, you can use a parameter array, [10][10]. The n^2 is tough. The only way to offer all the materials to the user is in a parameter array, and I don't think those can be of indefinite dimension. You would have to set some sort of limit for n.
Then you would probably want a UI script to make it tolerable to have so many parameters.
Can I ask who would want to set n^2 materials?


Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2006-07-07 03:03 AM
‎2006-07-07
03:03 AM
Brian,
bad news mate, you can't have a dynamic array as a part of UI.
What that means:
if you want to allow changing parameters as you are suggesting the particular parameter must be listed (defined) as an array parameter in the parameter list in order to use that in the UI script. As you may have noticed the parameter list does not allow you to define dynamic array (in other words any array variable has to have its limits in the parameter list). Therefore this limitation imposes maximum number of instances (so if you wanted to have 5000 golf tees you would have to define (manually) an array parameter with size of [5000] - I suppose, you would click yourself to death...)
bad news mate, you can't have a dynamic array as a part of UI.
What that means:
if you want to allow changing parameters as you are suggesting the particular parameter must be listed (defined) as an array parameter in the parameter list in order to use that in the UI script. As you may have noticed the parameter list does not allow you to define dynamic array (in other words any array variable has to have its limits in the parameter list). Therefore this limitation imposes maximum number of instances (so if you wanted to have 5000 golf tees you would have to define (manually) an array parameter with size of [5000] - I suppose, you would click yourself to death...)
::rk
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2006-07-07 08:30 AM
‎2006-07-07
08:30 AM
You can define arrays ynamical, but only in one direction. You can increase the number of rows and cols, but not decrease.
Since AC8 you can create dynamical arrays in the script and you can expand parameter arrays of the parameter list by setting a value to one more dimension.
Candle with hair. RAM is not indefinite.
Since AC8 you can create dynamical arrays in the script and you can expand parameter arrays of the parameter list by setting a value to one more dimension.
Candle with hair. RAM is not indefinite.
bim author since 1994 | bim manager since 2018 | author of selfGDL.de | openGDL | skewed archicad user hall of fame | author of bim-all-doors.gsm
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2006-07-07 10:44 AM
‎2006-07-07
10:44 AM
I hope this will help.
-------------------------------------------
We need to add 2 parameters:
spa_max ---- Max. Spacing.
mat ----------- Materials array
-------------------------------------------
-------------------------------------------
!!!!! In Master Scripts
nx=CEIL(a/spa_max) !!number of repeating OBJ in x-direction
ny=CEIL(b/spa_max) !!number of repeating OBJ in y-direction
spacing_x=a/nx !!actual spacing in x-direction
spacing_y=b/ny !!actual spacing in y-direction
PARAMETERS mat[nx+1][ny+1]=0 !!To increase Array size
-------------------------------------------
-------------------------------------------
!!!!! In 3D Scripts
FOR i=1 to nx
FOR j=1 to ny
MATERIAL mat
ADD (i-1)*spacing_x, (j-1)*spacing_y, 0
PRISM_ 4,0.01,
0,0,15,
0,0.1,15,
0.1,0.1,15,
0.1,0,15
DEL 1
NEXT j
NEXT i
-------------------------------------------
-------------------------------------------
We need to add 2 parameters:
spa_max ---- Max. Spacing.
mat ----------- Materials array
-------------------------------------------
-------------------------------------------
!!!!! In Master Scripts
nx=CEIL(a/spa_max) !!number of repeating OBJ in x-direction
ny=CEIL(b/spa_max) !!number of repeating OBJ in y-direction
spacing_x=a/nx !!actual spacing in x-direction
spacing_y=b/ny !!actual spacing in y-direction
PARAMETERS mat[nx+1][ny+1]=0 !!To increase Array size
-------------------------------------------
-------------------------------------------
!!!!! In 3D Scripts
FOR i=1 to nx
FOR j=1 to ny
MATERIAL mat
ADD (i-1)*spacing_x, (j-1)*spacing_y, 0
PRISM_ 4,0.01,
0,0,15,
0,0.1,15,
0.1,0.1,15,
0.1,0,15
DEL 1
NEXT j
NEXT i
-------------------------------------------
Howard Phua
Win 10, Archicad 19 INT
Win 10, Archicad 19 INT
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2006-07-07 12:05 PM
‎2006-07-07
12:05 PM
oops, so I was wrong...

::rk
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2006-07-07 02:56 PM
‎2006-07-07
02:56 PM
Thank you all so much. Using the scripts you provided I am able to create the part I need. Thanks again.
Brian
Brian