<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: GDL Editor refuses new variable and deletes line items in Libraries &amp; objects</title>
    <link>https://community.graphisoft.com/t5/Libraries-objects/GDL-Editor-refuses-new-variable-and-deletes-line-items/m-p/216829#M14788</link>
    <description>Douglas:&lt;BR /&gt;
&lt;BR /&gt;
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.&lt;BR /&gt;
&lt;BR /&gt;
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.&lt;BR /&gt;
&lt;BR /&gt;
David</description>
    <pubDate>Sat, 22 Dec 2012 13:15:32 GMT</pubDate>
    <dc:creator>David Maudlin</dc:creator>
    <dc:date>2012-12-22T13:15:32Z</dc:date>
    <item>
      <title>GDL Editor refuses new variable and deletes line items</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/GDL-Editor-refuses-new-variable-and-deletes-line-items/m-p/216827#M14786</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;&lt;T&gt;Hello List:&lt;BR /&gt;
Given :&lt;BR /&gt;
  a GDL object created in AC9 being edited in AC13.&lt;BR /&gt;
The original object runs successfully.&lt;BR /&gt;
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.&lt;BR /&gt;
In some cases, the new parameter is accapted in 2D script but not in the 3D script, and vise versa.&lt;BR /&gt;
I can forward a copy of the GDL script.&lt;BR /&gt;
&lt;BR /&gt;
Here are some examples :&lt;BR /&gt;
Original code :&lt;BR /&gt;
!	beam outline &amp;amp; fill&lt;BR /&gt;
		PEN 1&lt;BR /&gt;
		FILL fillPat&lt;BR /&gt;
		POLY2_A	5,	7,	postFillPen,&lt;BR /&gt;
		0,	0,	1,&lt;BR /&gt;
		dX,	0,	1,&lt;BR /&gt;
		dX,	dY,	1,&lt;BR /&gt;
		0,	dY,	1,&lt;BR /&gt;
		0,	0,	1&lt;BR /&gt;
&lt;BR /&gt;
Amended code : “pOn” logical variable defined in Parameters&lt;BR /&gt;
!	beam outline &amp;amp; fill&lt;BR /&gt;
	if pOn then&lt;BR /&gt;
		PEN 1&lt;BR /&gt;
		FILL fillPat&lt;BR /&gt;
		POLY2_A	5,	7,	postFillPen,&lt;BR /&gt;
		0,	0,	1,&lt;BR /&gt;
		dX,	0,	1,&lt;BR /&gt;
		dX,	dY,	1,&lt;BR /&gt;
		0,	dY,	1,&lt;BR /&gt;
		0,	0,	1&lt;BR /&gt;
	endif&lt;BR /&gt;
“Error in expression at line 29”&lt;BR /&gt;
and “	if p” highlited.&lt;BR /&gt;
&lt;BR /&gt;
Note : At the same time the same logical was accepted in the 3D script&lt;BR /&gt;
For example :&lt;BR /&gt;
!	post&lt;BR /&gt;
	if pOn then&lt;BR /&gt;
		if isWood then&lt;BR /&gt;
			material theMat&lt;BR /&gt;
			pen 2&lt;BR /&gt;
		else&lt;BR /&gt;
			pen postFillPen&lt;BR /&gt;
!			theMat = 0&lt;BR /&gt;
			material theMat&lt;BR /&gt;
		endif&lt;BR /&gt;
	endif&lt;BR /&gt;
&lt;BR /&gt;
Back to the 2D script :&lt;BR /&gt;
Select “if pOn then” and mark with “!”&lt;BR /&gt;
does not comment out the code but changes it to this :&lt;BR /&gt;
&lt;BR /&gt;
!	beam outline &amp;amp; fill&lt;BR /&gt;
!	if &lt;BR /&gt;
!		 then&lt;BR /&gt;
		PEN 1&lt;BR /&gt;
		FILL fillPat&lt;BR /&gt;
		POLY2_A	5,	7,	postFillPen,&lt;BR /&gt;
		0,	0,	1,&lt;BR /&gt;
		dX,	0,	1,&lt;BR /&gt;
		dX,	dY,	1,&lt;BR /&gt;
		0,	dY,	1,&lt;BR /&gt;
		0,	0,	1&lt;BR /&gt;
	endif&lt;BR /&gt;
&lt;BR /&gt;
At another time code was changed to this :&lt;BR /&gt;
&lt;BR /&gt;
!	beam outline &amp;amp; fill&lt;BR /&gt;
&lt;BR /&gt;
		PEN 1  &lt;BR /&gt;
		&lt;BR /&gt;
		PEN 1  &lt;BR /&gt;
		PEN 1 &lt;BR /&gt;
		PEN 1&lt;BR /&gt;
		FILL fillPat&lt;BR /&gt;
		POLY2_A	5,	7,	postFillPen,&lt;BR /&gt;
		0,	0,	1,&lt;BR /&gt;
		dX,	0,	1,&lt;BR /&gt;
		dX,	dY,	1,&lt;BR /&gt;
		0,	dY,	1,&lt;BR /&gt;
		0,	0,	1&lt;BR /&gt;
&lt;BR /&gt;
As a check, I added a conditional from another part of the 2D script&lt;BR /&gt;
&lt;BR /&gt;
This original script is not a problem.&lt;BR /&gt;
&lt;BR /&gt;
!	upper tenon outline &amp;amp; fill&lt;BR /&gt;
	if uTOn then&lt;BR /&gt;
		pen 1&lt;BR /&gt;
		ADD2 (0.5 * dx) - (0.5 * uTdx) + uTOsx, (0.5 * dy) - (0.5 * uTdy) + uTOsy&lt;BR /&gt;
		PEN 1&lt;BR /&gt;
		FILL fillPat&lt;BR /&gt;
		POLY2_A	5,	7,	7,&lt;BR /&gt;
		0,	0,	1,&lt;BR /&gt;
		uTdX,	0,	1,&lt;BR /&gt;
		uTdX,	uTdY,	1,&lt;BR /&gt;
		0,	uTdY,	1,&lt;BR /&gt;
		0,	0,	1&lt;BR /&gt;
		DEL	NTR()&lt;BR /&gt;
	endif&lt;BR /&gt;
&lt;BR /&gt;
However, if I add the conditional to the first script :&lt;BR /&gt;
&lt;BR /&gt;
!	beam outline &amp;amp; fill&lt;BR /&gt;
	if uTOn then&lt;BR /&gt;
		PEN 1&lt;BR /&gt;
		FILL fillPat&lt;BR /&gt;
		POLY2_A	5,	7,	postFillPen,&lt;BR /&gt;
		0,	0,	1,&lt;BR /&gt;
		dX,	0,	1,&lt;BR /&gt;
		dX,	dY,	1,&lt;BR /&gt;
		0,	dY,	1,&lt;BR /&gt;
		0,	0,	1&lt;BR /&gt;
	endif&lt;BR /&gt;
&lt;BR /&gt;
Error : Missing call key work not recommended&lt;BR /&gt;
&lt;BR /&gt;
Returning to the original code produces no error.&lt;BR /&gt;
&lt;BR /&gt;
!	beam outline &amp;amp; fill&lt;BR /&gt;
		PEN 1&lt;BR /&gt;
		FILL fillPat&lt;BR /&gt;
		POLY2_A	5,	7,	postFillPen,&lt;BR /&gt;
		0,	0,	1,&lt;BR /&gt;
		dX,	0,	1,&lt;BR /&gt;
		dX,	dY,	1,&lt;BR /&gt;
		0,	dY,	1,&lt;BR /&gt;
		0,	0,	1&lt;/T&gt;&lt;/DIV&gt;</description>
      <pubDate>Sat, 22 Dec 2012 10:37:37 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/GDL-Editor-refuses-new-variable-and-deletes-line-items/m-p/216827#M14786</guid>
      <dc:creator>Hubert Wagner</dc:creator>
      <dc:date>2012-12-22T10:37:37Z</dc:date>
    </item>
    <item>
      <title>Re: GDL Editor refuses new variable and deletes line items</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/GDL-Editor-refuses-new-variable-and-deletes-line-items/m-p/216828#M14787</link>
      <description>Hello :&lt;BR /&gt;
Further to my recent post on 2D script.&lt;BR /&gt;
Here is an example from the 3D script.&lt;BR /&gt;
&lt;BR /&gt;
!	post&lt;BR /&gt;
	if pOn then&lt;BR /&gt;
		if isWood then&lt;BR /&gt;
			material theMat&lt;BR /&gt;
			pen 2&lt;BR /&gt;
		else&lt;BR /&gt;
			pen postFillPen&lt;BR /&gt;
			material theMat&lt;BR /&gt;
		endif&lt;BR /&gt;
	endif&lt;BR /&gt;
&lt;BR /&gt;
	cPRISM_ theMat,theMat,theMat,&lt;BR /&gt;
		 5, dz,&lt;BR /&gt;
		 0, 0, 15,&lt;BR /&gt;
		 dx, 0, 15,&lt;BR /&gt;
		 dx, dy, 15,&lt;BR /&gt;
		 0, dy, 15,&lt;BR /&gt;
		 0, 0, 15&lt;BR /&gt;
		DEL NTR()&lt;BR /&gt;
&lt;BR /&gt;
This code is accepted.&lt;BR /&gt;
&lt;BR /&gt;
However, moving the endif to where it belongs, after DEL NTR() produces an error.&lt;BR /&gt;
Or at least it did the first few attempts to track down the problem.&lt;BR /&gt;
&lt;BR /&gt;
Now the code works perfectly. But only the position of “endif” has been changed.&lt;BR /&gt;
&lt;BR /&gt;
Going back to the 2D and adding the conditionsal. No problem, Now the GDL object works perfectly. &lt;BR /&gt;
Welcome to the “The Twilight Zone”&lt;BR /&gt;
&lt;BR /&gt;
I would appreciat any suggestion as to why this might happen or pointer to my coding errors.&lt;BR /&gt;
&lt;BR /&gt;
Regards :&lt;BR /&gt;
&lt;BR /&gt;
DW</description>
      <pubDate>Sat, 22 Dec 2012 11:34:45 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/GDL-Editor-refuses-new-variable-and-deletes-line-items/m-p/216828#M14787</guid>
      <dc:creator>Hubert Wagner</dc:creator>
      <dc:date>2012-12-22T11:34:45Z</dc:date>
    </item>
    <item>
      <title>Re: GDL Editor refuses new variable and deletes line items</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/GDL-Editor-refuses-new-variable-and-deletes-line-items/m-p/216829#M14788</link>
      <description>Douglas:&lt;BR /&gt;
&lt;BR /&gt;
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.&lt;BR /&gt;
&lt;BR /&gt;
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.&lt;BR /&gt;
&lt;BR /&gt;
David</description>
      <pubDate>Sat, 22 Dec 2012 13:15:32 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/GDL-Editor-refuses-new-variable-and-deletes-line-items/m-p/216829#M14788</guid>
      <dc:creator>David Maudlin</dc:creator>
      <dc:date>2012-12-22T13:15:32Z</dc:date>
    </item>
    <item>
      <title>Re: GDL Editor refuses new variable and deletes line items</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/GDL-Editor-refuses-new-variable-and-deletes-line-items/m-p/216830#M14789</link>
      <description>Hello Mr Maudlin :&lt;BR /&gt;
Thank you for your response.&lt;BR /&gt;
Here is the compressed file you requested. (I believed I'd attached that to my first post). &lt;BR /&gt;
&lt;BR /&gt;
I use AC13 as a student.&lt;BR /&gt;
My hardware is MacBoo Pro, OS 10,7,4&lt;BR /&gt;
&lt;BR /&gt;
Since my posting I've come across more odd behavior.&lt;BR /&gt;
For example, placing a new HOTSPOT2 with others already there produced an error.&lt;BR /&gt;
&lt;BR /&gt;
Regards : DW</description>
      <pubDate>Sat, 22 Dec 2012 14:14:56 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/GDL-Editor-refuses-new-variable-and-deletes-line-items/m-p/216830#M14789</guid>
      <dc:creator>Hubert Wagner</dc:creator>
      <dc:date>2012-12-22T14:14:56Z</dc:date>
    </item>
    <item>
      <title>Re: GDL Editor refuses new variable and deletes line items</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/GDL-Editor-refuses-new-variable-and-deletes-line-items/m-p/216831#M14790</link>
      <description>Douglas:&lt;BR /&gt;
&lt;BR /&gt;
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.&lt;BR /&gt;
&lt;BR /&gt;
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 &lt;A href="http://www.archicadwiki.com/GUID" target="_blank"&gt;GUID&lt;/A&gt;), 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.&lt;BR /&gt;
&lt;BR /&gt;
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.&lt;BR /&gt;
&lt;BR /&gt;
Sorry to not have a definitive answer.&lt;BR /&gt;
&lt;BR /&gt;
David</description>
      <pubDate>Sun, 23 Dec 2012 13:12:59 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/GDL-Editor-refuses-new-variable-and-deletes-line-items/m-p/216831#M14790</guid>
      <dc:creator>David Maudlin</dc:creator>
      <dc:date>2012-12-23T13:12:59Z</dc:date>
    </item>
    <item>
      <title>Re: GDL Editor refuses new variable and deletes line items</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/GDL-Editor-refuses-new-variable-and-deletes-line-items/m-p/216832#M14791</link>
      <description>Hello David :&lt;BR /&gt;
Thank you for your assistance.&lt;BR /&gt;
&lt;BR /&gt;
The explantion you offer, upon reflection, is likely the most reasonable. I ought to have thought of it myself. &lt;BR /&gt;
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!&lt;BR /&gt;
&lt;BR /&gt;
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. &lt;BR /&gt;
&lt;BR /&gt;
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. &lt;BR /&gt;
&lt;BR /&gt;
My approach seems to make sense, However, I wonder if it might an example of ignorange leading to overkill? &lt;BR /&gt;
&lt;BR /&gt;
Best Wishes : Douglas</description>
      <pubDate>Sun, 23 Dec 2012 13:28:55 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/GDL-Editor-refuses-new-variable-and-deletes-line-items/m-p/216832#M14791</guid>
      <dc:creator>Hubert Wagner</dc:creator>
      <dc:date>2012-12-23T13:28:55Z</dc:date>
    </item>
    <item>
      <title>Re: GDL Editor refuses new variable and deletes line items</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/GDL-Editor-refuses-new-variable-and-deletes-line-items/m-p/216833#M14792</link>
      <description>Hello David :&lt;BR /&gt;
The problem has reoccurred. I doubt the behavior can be down to a corrupt file.&lt;BR /&gt;
Here are two examples :&lt;BR /&gt;
&lt;BR /&gt;
Selecting the three lines of code below...&lt;BR /&gt;
&lt;BR /&gt;
if uTOn then&lt;BR /&gt;
HOTSPOT2 uTdX,	uTdY&lt;BR /&gt;
endif&lt;BR /&gt;
&lt;BR /&gt;
...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) :&lt;BR /&gt;
&lt;BR /&gt;
	&lt;BR /&gt;
	&lt;BR /&gt;
	!	beam out&lt;BR /&gt;
	HOTSPOT2 &lt;BR /&gt;
	endif&lt;BR /&gt;
	&lt;BR /&gt;
	!	&lt;BR /&gt;
	endif&lt;BR /&gt;
&lt;BR /&gt;
The first line&lt;BR /&gt;
 !   beam out &lt;BR /&gt;
is a comment from a code block below.&lt;BR /&gt;
&lt;BR /&gt;
Adding the line &lt;BR /&gt;
HOTSPOT2 uTdX,	uTdY&lt;BR /&gt;
inside a code block where the two parameters have already been used without incident produces various errors depending on where the item is placed. &lt;BR /&gt;
Or placing the line within its own if…endif block produces errors.&lt;BR /&gt;
&lt;BR /&gt;
These problems suggest a problem with the interpreter/compiler.&lt;BR /&gt;
Regards : Douglas</description>
      <pubDate>Mon, 24 Dec 2012 01:04:31 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/GDL-Editor-refuses-new-variable-and-deletes-line-items/m-p/216833#M14792</guid>
      <dc:creator>Hubert Wagner</dc:creator>
      <dc:date>2012-12-24T01:04:31Z</dc:date>
    </item>
    <item>
      <title>Re: GDL Editor refuses new variable and deletes line items</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/GDL-Editor-refuses-new-variable-and-deletes-line-items/m-p/216834#M14793</link>
      <description>&lt;BLOCKQUOTE&gt;Douglas wrote:&lt;BR /&gt;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. &lt;BR /&gt;
&lt;BR /&gt;
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. &lt;BR /&gt;
&lt;BR /&gt;
My approach seems to make sense, However, I wonder if it might an example of ignorange leading to overkill?&lt;/BLOCKQUOTE&gt;

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.&lt;BR /&gt;

&lt;BLOCKQUOTE&gt;Douglas wrote:&lt;BR /&gt;Hello David :&lt;BR /&gt;
The problem has reoccurred. I doubt the behavior can be down to a corrupt file.&lt;BR /&gt;
Here are two examples :&lt;BR /&gt;
....
&lt;/BLOCKQUOTE&gt;

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.&lt;BR /&gt;
&lt;BR /&gt;
David</description>
      <pubDate>Mon, 24 Dec 2012 12:51:08 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/GDL-Editor-refuses-new-variable-and-deletes-line-items/m-p/216834#M14793</guid>
      <dc:creator>David Maudlin</dc:creator>
      <dc:date>2012-12-24T12:51:08Z</dc:date>
    </item>
    <item>
      <title>Re: GDL Editor refuses new variable and deletes line items</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/GDL-Editor-refuses-new-variable-and-deletes-line-items/m-p/216835#M14794</link>
      <description>Hello Douglas,&lt;BR /&gt;
&lt;BR /&gt;
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).&lt;BR /&gt;
The problems occured mostly when I pasted parts of scripts. Then the editor placed the inserted text in a totally weird and odd way.&lt;BR /&gt;
This could not be redone by using cmd +Z.&lt;BR /&gt;
This only happened if I worked some time in the editor.&lt;BR /&gt;
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).&lt;BR /&gt;
(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)&lt;BR /&gt;
&lt;BR /&gt;
Place 2 of my most hated GDL-Bugs.</description>
      <pubDate>Wed, 26 Dec 2012 12:14:29 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/GDL-Editor-refuses-new-variable-and-deletes-line-items/m-p/216835#M14794</guid>
      <dc:creator>Jochen Suehlo</dc:creator>
      <dc:date>2012-12-26T12:14:29Z</dc:date>
    </item>
  </channel>
</rss>

