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

GDL Editor refuses new variable and deletes line items

Hubert Wagner
Participant
Hello List:
Given :
a GDL object created in AC9 being edited in AC13.
The original object runs successfully.
However, if I add a new logical parameter and then call it in either 2D or 3D script AC calls an error…and then deletes the new line.
In some cases, the new parameter is accapted in 2D script but not in the 3D script, and vise versa.
I can forward a copy of the GDL script.

Here are some examples :
Original code :
! beam outline & fill
PEN 1
FILL fillPat
POLY2_A 5, 7, postFillPen,
0, 0, 1,
dX, 0, 1,
dX, dY, 1,
0, dY, 1,
0, 0, 1

Amended code : “pOn” logical variable defined in Parameters
! beam outline & fill
if pOn then
PEN 1
FILL fillPat
POLY2_A 5, 7, postFillPen,
0, 0, 1,
dX, 0, 1,
dX, dY, 1,
0, dY, 1,
0, 0, 1
endif
“Error in expression at line 29”
and “ if p” highlited.

Note : At the same time the same logical was accepted in the 3D script
For example :
! post
if pOn then
if isWood then
material theMat
pen 2
else
pen postFillPen
! theMat = 0
material theMat
endif
endif

Back to the 2D script :
Select “if pOn then” and mark with “!”
does not comment out the code but changes it to this :

! beam outline & fill
! if
! then
PEN 1
FILL fillPat
POLY2_A 5, 7, postFillPen,
0, 0, 1,
dX, 0, 1,
dX, dY, 1,
0, dY, 1,
0, 0, 1
endif

At another time code was changed to this :

! beam outline & fill

PEN 1

PEN 1
PEN 1
PEN 1
FILL fillPat
POLY2_A 5, 7, postFillPen,
0, 0, 1,
dX, 0, 1,
dX, dY, 1,
0, dY, 1,
0, 0, 1

As a check, I added a conditional from another part of the 2D script

This original script is not a problem.

! upper tenon outline & fill
if uTOn then
pen 1
ADD2 (0.5 * dx) - (0.5 * uTdx) + uTOsx, (0.5 * dy) - (0.5 * uTdy) + uTOsy
PEN 1
FILL fillPat
POLY2_A 5, 7, 7,
0, 0, 1,
uTdX, 0, 1,
uTdX, uTdY, 1,
0, uTdY, 1,
0, 0, 1
DEL NTR()
endif

However, if I add the conditional to the first script :

! beam outline & fill
if uTOn then
PEN 1
FILL fillPat
POLY2_A 5, 7, postFillPen,
0, 0, 1,
dX, 0, 1,
dX, dY, 1,
0, dY, 1,
0, 0, 1
endif

Error : Missing call key work not recommended

Returning to the original code produces no error.

! beam outline & fill
PEN 1
FILL fillPat
POLY2_A 5, 7, postFillPen,
0, 0, 1,
dX, 0, 1,
dX, dY, 1,
0, dY, 1,
0, 0, 1
8 REPLIES 8
Hubert Wagner
Participant
Hello :
Further to my recent post on 2D script.
Here is an example from the 3D script.

! post
if pOn then
if isWood then
material theMat
pen 2
else
pen postFillPen
material theMat
endif
endif

cPRISM_ theMat,theMat,theMat,
5, dz,
0, 0, 15,
dx, 0, 15,
dx, dy, 15,
0, dy, 15,
0, 0, 15
DEL NTR()

This code is accepted.

However, moving the endif to where it belongs, after DEL NTR() produces an error.
Or at least it did the first few attempts to track down the problem.

Now the code works perfectly. But only the position of “endif” has been changed.

Going back to the 2D and adding the conditionsal. No problem, Now the GDL object works perfectly.
Welcome to the “The Twilight Zone”

I would appreciat any suggestion as to why this might happen or pointer to my coding errors.

Regards :

DW
David Maudlin
Rockstar
Douglas:

It would help if you could post the library part, you may need to zip it first before attaching to a post. Just looking at code without the entire library part (parameters, etc) it is hard to see the whole picture.

You should add a Signature to your Profile (click the Profile button near the top of this page) with your ArchiCAD version and operating system (see mine for an example) for more accurate help in this forum.

David
David Maudlin / Architect
www.davidmaudlin.com
Digital Architecture
AC27 USA • iMac 27" 4.0GHz Quad-core i7 OSX11 | 24 gb ram • MacBook Pro M3 Pro | 36 gb ram OSX14
Hubert Wagner
Participant
Hello Mr Maudlin :
Thank you for your response.
Here is the compressed file you requested. (I believed I'd attached that to my first post).

I use AC13 as a student.
My hardware is MacBoo Pro, OS 10,7,4

Since my posting I've come across more odd behavior.
For example, placing a new HOTSPOT2 with others already there produced an error.

Regards : DW
David Maudlin
Rockstar
Douglas:

The library part works correctly here (AC 13): checking each script gives no error message and the result "The GDL script is OK." and the parameters control the appearance of the object as designed.

There may be a problem with the file on your computer, you could try Saving As... the library part with a new name (this will also give the object a new GUID), which may fix the error within the library part file. The new GUID means that ArchiCAD will recognize this as not the same object as the original, even if given the same name, so if this works you will need to select and replace the old object in any ArchiCAD files where it has been placed.

If that does not work you can try selecting the code and pasting the code into a word processing application, there is a small chance that there are unrecognized, invisible characters in your code that will appear as rectangular boxes when copied into another application.

Sorry to not have a definitive answer.

David
David Maudlin / Architect
www.davidmaudlin.com
Digital Architecture
AC27 USA • iMac 27" 4.0GHz Quad-core i7 OSX11 | 24 gb ram • MacBook Pro M3 Pro | 36 gb ram OSX14
Hubert Wagner
Participant
Hello David :
Thank you for your assistance.

The explantion you offer, upon reflection, is likely the most reasonable. I ought to have thought of it myself.
Eventually, I saved the GDL to a new folder with a different name (although not with your solution in mind) and of course the item now works perfectly!

Incidentally, I wonder what you think of the item. The idea is to specify a post with a tenon at each end which can be sized and offset as required. I've just modified the GDL so the post part can be made invisible. This allows me to show only, say the lower tenon on a ground beam to represent a mortice, or the upper tenon on an eve beam for the same reason.

The alternative is three layers : one for the post and one each for the tenons. Then switch these on as required to be able to dimension say the ground sill in plan.

My approach seems to make sense, However, I wonder if it might an example of ignorange leading to overkill?

Best Wishes : Douglas
Hubert Wagner
Participant
Hello David :
The problem has reoccurred. I doubt the behavior can be down to a corrupt file.
Here are two examples :

Selecting the three lines of code below...

if uTOn then
HOTSPOT2 uTdX, uTdY
endif

...and clicking on the "shift selection right" button in the GDL editor changes the code to this (along with lots of extra spaces and blank lines) :



! beam out
HOTSPOT2
endif

!
endif

The first line
! beam out
is a comment from a code block below.

Adding the line
HOTSPOT2 uTdX, uTdY
inside a code block where the two parameters have already been used without incident produces various errors depending on where the item is placed.
Or placing the line within its own if…endif block produces errors.

These problems suggest a problem with the interpreter/compiler.
Regards : Douglas
David Maudlin
Rockstar
Douglas wrote:
The idea is to specify a post with a tenon at each end which can be sized and offset as required. I've just modified the GDL so the post part can be made invisible. This allows me to show only, say the lower tenon on a ground beam to represent a mortice, or the upper tenon on an eve beam for the same reason.

The alternative is three layers : one for the post and one each for the tenons. Then switch these on as required to be able to dimension say the ground sill in plan.

My approach seems to make sense, However, I wonder if it might an example of ignorange leading to overkill?
The next step to controlling which parts are shown is to add code that uses the Model View Options to turn on/off the various parts. You can see examples of this in the ArchiCAD Library such as for the Show Minimal Space of Furnishings and the Door and Window options. The coding this takes more time, but the variations can be stored as named MVOs, so can be tied into Views so the user does not have to remember to go back to the library parts to change the options.
Douglas wrote:
Hello David :
The problem has reoccurred. I doubt the behavior can be down to a corrupt file.
Here are two examples :
....
I cannot reproduce this bug. I am using the professional version on an earlier version of OSX, your operating system was not around when AC13 came out, so maybe there are issues some there.

David
David Maudlin / Architect
www.davidmaudlin.com
Digital Architecture
AC27 USA • iMac 27" 4.0GHz Quad-core i7 OSX11 | 24 gb ram • MacBook Pro M3 Pro | 36 gb ram OSX14
Jochen Suehlo
Moderator
Hello Douglas,

I use MAC OS X 10.6.8 and had similar problems with the GDL editor on AC 14 and AC 15 (I don't think it was on AC 13, but I am not shure).
The problems occured mostly when I pasted parts of scripts. Then the editor placed the inserted text in a totally weird and odd way.
This could not be redone by using cmd +Z.
This only happened if I worked some time in the editor.
The best help was to close the object and reopen it again or to start ArchiCAD new (after that the problem stops to appear for some time).
(The problems only occured on MAC; I had no problems on Windows and I never heard of problems on Windows, but a colleague who uses MAC, sometimes had similar problems)

Place 2 of my most hated GDL-Bugs.
Jochen Suehlo . AC12-27 . MAC OSX 14.4 . WIN11
GDL object creation: b-prisma.de

Didn't find the answer?

Check other topics in this Forum

Back to Forum

Read the latest accepted solutions!

Accepted Solutions

Start a new conversation!