GDL
About building parametric objects with GDL.

Autotext in 3D text

eldhead
Newcomer
Hi!
I thought I could write <SHORTDATE> in object 3D text but it doesn´t seem to work. It had been great to show date in for example IFC-files.
Archicad 7 - 24, HP ZBook 15 Mobile Workstation, Win 10
13 REPLIES 13
Mats_Knutsson
Advisor
Sometimes I just love you guys! Kristan & Lingwisyer this time


I attach a small video on an origo object I just did and also a question related to the UI. I have a yes/no parameter and would like to grey out the "next" parameter if I choose no in the former.... the video explains it.
I suppose I need to start building the UI with buttons and forms and stuff...haven't dared to go into that route yet since my time to do GDL is like nothing...this was on my spare time...I was a fun little practice and I couldn't stop until I was done. Two hours including a rewrite...(I admit I'm that slow at GDL)


Mats
AC 25 SWE Full

HP Zbook Fury 15,6 G8. 32 GB RAM. Nvidia RTX A3000.
Looks good Mats!
It so much fun getting intelligent responses out of your own GDL objects.
There are two things you can do to the manual data parameter based on the on/off parameter; you can "Lock" it and you can "Hide" it. As you don't have a graphical UI I think it is best to just "Hide" it, then you don't have to lock it. But if you are going to create a UI then hiding doesn't work through the function shown below.

The code would be as follows;
assuming the on/of parameter is called: bManualDate
assuming the manual date parameter is: stManualDate

if bManualDate = 0 then
        lock "stManualDate"
        hideparameter "stManualDate"
endif
For on/off (boolean) parameters "0" is off and "1" is on. I personally don't like using the "0,1" values when writing my script because the idea of writing "=" for a boolean parameter bothers me, seeing as though it is only necessary for the off value; for example, if the value is on we simple write:
if bManualDate then
because bManualDate returns the positive value of 1
so for the negative we write:
if not(bManualDate) then
because when it is turned off it equals "0", the negative response, so to run the "if" command we need a positive response so we turn it into a positive with the "not()" function as "not(0)" = "1". make sense?
so I would write your code like this:

if not(bManualDate) then 
        lock "stManualDate"
        hideparameter "stManualDate"
endif
Writing it like this makes it easy to read what it is doing.
Creator of Cadswift's parametric GDL libraries
Creator of Infinite Openings and Component Catalogues
Push the envelope & watch it bend
website: https://cadswift.com.au/
YouTube: https://www.youtube.com/user/CADSwift/playlists
Lingwisyer
Guru
Kristian wrote:
if bManualDate then
/
if not(bManualDate) then

I never thought to write it like that. Makes it sooooo much easier to track what is going on. Thanks for the tip.



Ling.

AC22-23 AUS 7000Help Those Help You - Add a Signature
Self-taught, bend it till it breaksCreating a Thread
Win10 | R5 2600 | 16GB | GTX1660 
your welcome Ling.
Creator of Cadswift's parametric GDL libraries
Creator of Infinite Openings and Component Catalogues
Push the envelope & watch it bend
website: https://cadswift.com.au/
YouTube: https://www.youtube.com/user/CADSwift/playlists