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

User's Global Variables

Anonymous
Not applicable
Hi everyone,

I've recently made a sliding shutter GDL object that we use on a project a couple of instances, it has a parameter for controlling whether it's open or closed. The shutter is for an arched top opening, independent from the door / window itself, consists of a fixed half round bit and two sliding leaves, all auto-scripted from the 3d window and the leaves being called in as macros in the script of the fixed bit, which's therefore the parent object.

I thought it would be awesome to have a remote control for the shutters, a separate 2d object placed on the plan somewhere out of sight, which controls the value of a GLOB_USER variable by means of the user dragging a graphical hotspot and then all the shutters in the project update the same time as the remote control object is being adjusted manually.

The 2D (and only) script of the remote control is as follows:

LINE2 0, 0, lg, 0

unID = 1

HOTSPOT2 0, 0, unID, lg, 1 :unID = unID+1
HOTSPOT2 -lg, 0, unID, lg, 3 :unID = unID+1
HOTSPOT2 lg, 0, unID, lg, 2 :unID = unID+1

GLOB_USER_1 = lg

Then in the master script of the shutters I just put:

opening_ = GLOB_USER_1

opening_ being the parameter that controls the sliding bits via ADD transformations in the 3D script. The concept seems brutally simple.

It sort of works, but in 2D only, which's genuinely weird as the plan symbol is created using the PROJECT2 command and so should show exactly what's happening in 3D. Whatever I do, the shutters remain stubbornly shut in 3D!

Also, not all of the identical shutter objects follow the lead, there are some maverick ones which don't even update in plan like the rest of them do!

Am I missing a trick? I obviously am, aren't I? This cannot be a bug, right?

What do you guys think?
5 REPLIES 5

Sounds like something you could try to control with Model View Options. There is an option to override opening settings in the Dutch library. Not for 3d opening angle, but I would say it is a matter of which parameter to override.

I haven't tried figuring out yet how to control parameters with MVO, but I'm sure there is information out there on the many guides and help functions.
Erwin Edel, Project Lead, Leloup Architecten
www.leloup.nl

ArchiCAD 9-24 NED FULL
Windows 10 Pro
Adobe Design Premium CS5

Barry Kelly
Moderator
As Erwin mentioned user globals are probably not the best way to go.
Any other objects could also be using the same user global causing all sorts of problems.

MVO (Library Globals) is probably the way to go.
I think the default Archicad doors may use them for 2D and 3D opening percentages.
You could use those as an example.

It isn't as easy as a simple user global.
But from memory I think there is a problem that user globals aren't recognised in all the scripts (i.e. 3D).
I really can't remember know as it was about 12 years ago when I had the problem.
It was even before the days of Archi-talk - it was back in the old GDLtalk days - I'm sure I mentioned something about it back then.

I just checked and GLOB_USER variables are definitely not recognised in the 3D script.

Barry.

One of the forum moderators.
Versions 6.5 to 25
Dell XPS- i7-6700 @ 3.4Ghz, 16GB ram, GeForce GTX 960 (2GB), Windows 10
Dell Precision 3510 - i7 6820HQ @ 2.70GHz, 16GB RAM, AMD FirePro W5130M, Windows 10

Anonymous
Not applicable
Thank you very much for your quick response guys!

The GDL Cookbook made the whole user GV business seem so easy, although the example objects through which it explains this feature are indeed 2D only.

I'll definitely look into this MVO thing you both mentioned.

Many thanks for your help again!

James Murray
Expert
You motivated me to finish this: Library Globals

Hope it helps.
James Murray
Rill Architects • macOS • OnLand.info

Anonymous
Not applicable
Thank you so much, James

Not only the linked article is massively useful, but the rest of your website as well! Will need to check out all the gdl related stuff on there.

Cheers

Didn't find the answer? Start a new discussion

Labels

Still looking?

Browse more topics

Back to forum

See latest solutions

Accepted solutions

Start a new discussion!