cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 
Developer forum

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

BenjiDev
Booster

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

 

Learning about Archicad C++ Add-On development
My Add-Ons

1 ACCEPTED SOLUTION
3 REPLIES 3

BenjiDev
Booster

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

Learning about Archicad C++ Add-On development
My Add-Ons

Solution
bschwb
Advocate

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 (partially free) Add-Ons at www.bschwb.com/add-ons

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

Still looking?

Browse more topics

Back to forum

See latest solutions

Accepted solutions

Start a new discussion!