Search the Knowledge Base Report a bug
Post new topic   Reply to topic   printer-friendly view   .    ArchiCAD-Talk Forum Index >>> Libraries / Library Parts / GDL >>> Dynamic arrays in gdl obejct
View previous topic :: View next topic
Author Message
Nagy Zsolt
Guest
Guest

Joined: 05 Dec 2013
Posts: 2
Location: Budapest

PostPosted: Wed Dec 06, 2017 2:46 pm    Post subject: Dynamic arrays in gdl obejct Reply with quote

Hi All!

Attach my gdl object, please check it.

I have an origo, and some drawing element with hotspots. User can move and adjust each element. When element hotspot move to origo, element can be deleted. The concept base on dynamical arrays (thanks Esteban Ramos).

The base functions (move, adjust, delete) work, but when you delete any but the last element of array, other element's parameter (width, depht, heigth, etc.) won't be correct.

Thanks!



EG_falburkolat_proba_v0-02.rar
 Description:

Download
 Filename:  EG_falburkolat_proba_v0-02.rar
 Filesize:  2.37 KB
 Downloaded:  7 Time(s)

Back to top
View user's profile Send private message    
sinceV6
Active member
Active member

Joined: 14 May 2010
Posts: 418
Location: US

PostPosted: Wed Dec 06, 2017 3:45 pm    Post subject: Re: Dynamic arrays in gdl obejct Reply with quote

Hi.
A quick look indicates that you are running into one problem I had with the polyline script: when one of the elements disappears, you are reducing from the very beginning of the arrays, effectively moving all values and thus changing the output order.

You can try to verify this visually in the working object by adding a simple text with an ID based on [i] from the loops.

In order for this to work like you want, you would need to identify the hotspot being moved to the origin, and make array adjustments from there.

Since these are independent things ("holes" in this case), I don't think that reducing arrays is necessary. You can just state that if the coordinates of the base hotspot for a specific value are < EPS, then don't draw the element, but leave the editable hotspot in the origin. If the user then moves it again, use its values. You could always have a new editable hotspot in the origin to create new elements on the fly.

You are also missing a default size value for new elements (when nr is increased, elements don't have a defined size)

Hope that helps a bit.
Best regards.
Back to top
View user's profile Send private message    
Nagy Zsolt
Guest
Guest

Joined: 05 Dec 2013
Posts: 2
Location: Budapest

PostPosted: Wed Dec 06, 2017 4:34 pm    Post subject: Re: Dynamic arrays in gdl obejct Reply with quote

Thanks sinceV6!

You are right, don't need dynamic array, but this is perfect solutions:)

Beta solution: can delete only the last element.

I try check the program with helper tags with ID.

Best regards!
Zsolt
Back to top
View user's profile Send private message    
Display posts from previous:   
View previous topic :: View next topic
Post new topic   Reply to topic   printer-friendly view       ArchiCAD-Talk Forum Index >>> Libraries / Library Parts / GDL >>> Dynamic arrays in gdl obejct All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB 2001, 2005 phpBB Group
Copyright 2012 - Graphisoft SE. All rights reserved worldwide. Terms of Use | Privacy Policy