how to pass a whole array to a geometry functions?
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2018-11-28 02:36 PM
‎2018-11-28
02:36 PM
is it possible to pass all values from a one dimensional array to a geometry generating function without referencing the index of each single element?
simple Array:
dim sides[] for i=1 to 3 verts = i next iThis is possible:
block verts[1], verts[2], verts[3]But i want to pass the whole array at once something like this (not possible):
block vertsThis would be extremly helpful for more complicated geometry functions like the tube function. Example:
TUBE 4, 7, 16+32, 0, 0, 0, -0.5, 0, 0, -0.5, -0.5, 0, 0, -0.5, 0, 0 +0.2, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 1, 2, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0+0.2, 0, 0
For these i would like to just pass an array with the right values (for example different profiles) that can vary in length. Does someone know how this can be achieved? Thanks in advance!
4 REPLIES 4

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2018-11-28 02:48 PM
‎2018-11-28
02:48 PM
el_flamenco:
I don't have the answer (maybe the Put and Get functions), but you should also post the query at GDL Center Forum, the GDL developers follow this forum.
You should add a Signature to your Profile (click the Profile button near the top of this page) with your ArchiCAD version and operating system (see mine for an example) for more accurate help in this forum.
David
I don't have the answer (maybe the Put and Get functions), but you should also post the query at GDL Center Forum, the GDL developers follow this forum.
You should add a Signature to your Profile (click the Profile button near the top of this page) with your ArchiCAD version and operating system (see mine for an example) for more accurate help in this forum.
David
David Maudlin / Architect
www.davidmaudlin.com
Digital Architecture
AC28 USA • Mac mini M4 Pro OSX15 | 64 gb ram • MacBook Pro M3 Pro | 36 gb ram OSX14
www.davidmaudlin.com
Digital Architecture
AC28 USA • Mac mini M4 Pro OSX15 | 64 gb ram • MacBook Pro M3 Pro | 36 gb ram OSX14
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2018-11-28 04:26 PM
‎2018-11-28
04:26 PM
Thanks David i wasn't aware of the special forum for the gdl center, i will try my luck there.

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2018-11-28 06:01 PM
‎2018-11-28
06:01 PM
Yes, you can use PUT and GET, and No, you cannot use an array as whole in a 3D command (as far as I know).
You can write something like this: DIM x_g[6]: DIM y_g[6] x_g[1]=100 : y_g[1]=0 x_g[2]=0 : y_g[2]=0 x_g[3]=0 : y_g[3]=10 x_g[4]=10 : y_g[4]=10 x_g[5]=10 : y_g[5]=0 x_g[6]=0 : y_g[6]=100 GOSUB "tube_4eck~" END "tube_4eck~": PUT 0,0,0, !Profil 0,1,0, 1,1,0, 1,0,0, 0,0,0 profpoints = NSP/3 !----------------------------- FOR ii = 1 TO VARDIM1(x_g) PUT x_g[ii], y_g[ii], 0, 0 NEXT ii pathpoints = (NSP - profpoints * 3)/4 !------------------------------- BODY -1 TUBE profpoints, pathpoints, 1+2+4+8+16+32, GET(NSP) BODY -1 RETURN
Jochen Suehlo . AC12-28 . MAC OSX 14.4 . WIN11
GDL object creation: b-prisma.de
GDL object creation: b-prisma.de

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2018-11-29 03:28 AM
‎2018-11-29
03:28 AM
There is an example object utilising Tube and Put / Get commands. There is a link to it in this thread. Do not recall where the original link is...
Ling.
Ling.
AC22-28 AUS 3110 | Help Those Help You - Add a Signature |
Self-taught, bend it till it breaks | Creating a Thread |
Win11 | i9 10850K | 64GB | RX6600 | Win11 | R5 2600 | 16GB | GTX1660 |