Choose your top Archicad wishes!

Read more
GDL
About building parametric objects with GDL.
SOLVED!

Use array as arguments for GDL shapes (PRISM_ , PYRAMID, etc...)

BenjiDev
Enthusiast

How do you use and array as an argument for the different shape functions?

A simple example:

 

 

 

! DO THIS:

DIM arr[]
arr[1]=1
arr[2]=1
arr[3]=15
arr[4]=2
arr[5]=0
arr[6]=15
arr[7]=1
arr[8]=3
arr[9]=15

PRISM_ 4,1,
    0,0,15,
	arr

! INSTEAD OF THIS:

PRISM_ 4,1,
    0,0,15,
    1,1,15,
    2,0,15,
    1,3,15

 

 

The array in question is comming from a C++ Addon and is arbitrarily large so i cannot "spell" out the arguments when calling the GDL functions. Or is there some kind of workaround?

 

I'm reading the GDL reference guide but haven't found an example of this yet: https://gdl.Graphisoft.com/reference-guide

 

1 ACCEPTED SOLUTION

Accepted Solutions
Solution

Hi Benji,

 

I think you are looking for the Parameter Buffer:
https://gdl.Graphisoft.com/reference-guide/parameter-buffer-manipulation
There are examples for use at the bottom of the page.
The main idea is, that one uses `put` to store values on the buffer and `use` or `get` to retrieve them again. It's a data structure with FIFO principle.

Best, Bernd

Bernd Schwarzenbacher - Archicad Add-On Developer - Get Add-Ons & Archicad Tips on my Website: Archi-XT.com

View solution in original post

3 REPLIES 3
BenjiDev
Enthusiast

I just found something called The parameter buffer which looks like it does what i want: https://gdl.Graphisoft.com/reference-guide/parameter-buffer-manipulation

Solution

Hi Benji,

 

I think you are looking for the Parameter Buffer:
https://gdl.Graphisoft.com/reference-guide/parameter-buffer-manipulation
There are examples for use at the bottom of the page.
The main idea is, that one uses `put` to store values on the buffer and `use` or `get` to retrieve them again. It's a data structure with FIFO principle.

Best, Bernd

Bernd Schwarzenbacher - Archicad Add-On Developer - Get Add-Ons & Archicad Tips on my Website: Archi-XT.com

This can be written in a for loop as well based on points to simplify or shorten the amount of code.

Didn't find the answer?

Check other topics in this Forum

Back to Forum

Read the latest accepted solutions!

Accepted Solutions

Start a new conversation!