Libraries & objects
About Archicad and BIMcloud libraries, their management and migration, objects and other library parts, etc.

Mouse Input

Anonymous
Not applicable
Hi,

I have made numerous GDL scripts but they have always been quite simple. Some have involved quite complex geometry and numerous parameters, but they have been simple in the sense that they have been standalone models which I just place into my design as I need them, like a car, or a tree, or a door handle.

I am looking to make a much more complex model. I am designing a building which has many catwalks and stairways, and I would like to create a parametric model of a hand rail which I can use throughout the design. Furthermore, if there is a design change in the detail of the hand rail, I would like it to update automatically throughout my model.

Is there a way that I can click on a series of points in my design with my mouse, and have these points become data points passed to my model, so that a post supporting the hand rail is automatically generated at that point, and the hand rail itself is inserted, spanning from the previous point to the new one?

I would love it if I could do this, because then I would just have to change the macro for the post or the rail to change everything.

Does this make sense? Does anyone know how to do something like this? It seems difficult because it looks like my object would somehow have to interact with the ArchiCard user interface to capture the mouse positions.

If it is possible, I would like to program the model in as open ended a way as possible so that I could reuse the core idea to make a fence generating script, or even a wall generating script simply by clicking on a number of points.

Thanks!!
Philipp
11 REPLIES 11
rocorona
Booster
It is a not easy task.
AFIK plain GDL do not allow for a direct interaction with the mouse or other interface elements, but you can take advantage of existing Add-ons.
Using the Accessories is my best bet for this.
Some years ago I made a "Slab border" object (see it HERE) that works very well in association with a standard Slab. The Slab itself can be in a hidden layer. When I need to change the path, I simply edit the Slab perimeter.
_________________

--Roberto Corona--
www.archiradar.com
AC18 - ITA full on Win10
_________________
_________________
Anonymous
Not applicable
Hi Roberto,

I've known about your "Slab border" object a couple of years ago and I found it very interesting...
But I actually didn't have much time to try it...
Could you please explain:
Can we create an open path?...
Can I control the starting point of the path?...
In which form the path coordinates are given... Is it an array?...

Thank you in advance.
rocorona
Booster
Yes to all.
You can specify a starting node end an end node, then the border is drawn between these two points, following the Slab perimeter.
The nodes coordinates are found in a parameter array, created in the interface of the object and filled automatically by the Accessory Add-on.

The numbering of the Slab nodes is also managed internally by the Add-on and the user has no control on it, so things can get messed-up, when the Slab perimeter is edited adding/deleting nodes...
_________________

--Roberto Corona--
www.archiradar.com
AC18 - ITA full on Win10
_________________
_________________
Anonymous
Not applicable
rocorona wrote:
Yes to all.
Great!
Maybe I'll use it in my next object...
Just one more question Roberto...
How does it manage a curved path/edge?...
rocorona
Booster
That's another of those automated things. Curved edges are translated in short linear segments. So you get all the coordinates of the segmented sides into the array. It is not tied with the Magic Wand setting, so we don't have any control on it, unfortunately.

I've to say that I'm not looking at the object and, since it is an old one, I hope I'm recalling all these info correctly
_________________

--Roberto Corona--
www.archiradar.com
AC18 - ITA full on Win10
_________________
_________________
Anonymous
Not applicable
Thanks for the response!

It sounds like the slab idea is a good starting point, except that you mention that the user does not have control over the number of nodes in the path. This is something that I need explicitly. Given a catwalk area, I would like just to click in the positions that I need to place the railing. Clearly, different parts of the building would need railings with a differing number of supports, so it really would be best for the number to be open ended.

Instead of using a slab as a parameter would it be possible just to use a 2D polygonal line as an input, and then examine the line in GDL to determine the number of points it contains?
Anonymous
Not applicable
Is it hard to program a custom add-on?

I am very experienced programmer in a number of languages, so if I just had access to some sort of tutorial explaining the process I would be okay. Does anyone know of such a thing?

Thanks again.
Anonymous
Not applicable
Sorry, I just reread your post about the slab control. It looks like you are saying that the number of nodes is open-ended, but the user cannot delete or add any within the GDL script, but could delete them from the slab by using the add-on, is this correct?
rocorona
Booster
Yes, correct. In this case we use a plain GDL object, through a standard add-on provided by Graphisoft.

Check the first section of this forum: there is the DEVELOPER FORUM, focussed on programming custom Add-ons
_________________

--Roberto Corona--
www.archiradar.com
AC18 - ITA full on Win10
_________________
_________________