<?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: Dashed Line om 3d GDL issue in Libraries &amp; objects</title>
    <link>https://community.graphisoft.com/t5/Libraries-objects/Dashed-Line-om-3d-GDL-issue/m-p/145531#M13601</link>
    <description>Thanks Guys but Didn't work &lt;IMG src="https://community.graphisoft.com/legacyfs/online/emojis/icon_sad.gif" style="display : inline;" /&gt; I still get errors, is there a simple way of doing this?!? I just wanted to add a dashed line to my furniture doors, I tried understanding how the lines on the archicad library worked but didn't get there (doors and windows). If anyone could help me I would really appreciate it!</description>
    <pubDate>Mon, 13 May 2013 18:19:43 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2013-05-13T18:19:43Z</dc:date>
    <item>
      <title>Dashed Line om 3d GDL issue</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Dashed-Line-om-3d-GDL-issue/m-p/145527#M13597</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;&lt;T&gt;Hello I'm trying to create a dashed line on 3d with GDL but I'm getting many errors with this subroutine that I copied from GDL cookbook, can anyone help me please?&lt;BR /&gt;
&lt;BR /&gt;
I'm getting Missing Keyword (or smthing like it, I'm translating from french) on line 6 and illegal character on line 28. &lt;BR /&gt;
&lt;BR /&gt;
I've pasted the code here, if someone can help me I would apreciate it. &lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
!Draw a Dashed Line Segment&lt;BR /&gt;
getValues = 1&lt;BR /&gt;
put 0, 0, 0, a, b, zzyzx&lt;BR /&gt;
gosub “7 Dashed Line”&lt;BR /&gt;
&lt;BR /&gt;
“7 Dashed Line”:&lt;BR /&gt;
!Input:&lt;BR /&gt;
! - Line end points: (x1~7, y1~7, z1~z) and (x2~7, y2~7, z2~7)&lt;BR /&gt;
! - Dash length: dashLength~7&lt;BR /&gt;
	if getValues then&lt;BR /&gt;
		x1~7 = get(1): y1~7 = get(1): z1~7 = get(1)&lt;BR /&gt;
		x2~7 = get(1): y2~7 = get(1): z2~7 = get(1)&lt;BR /&gt;
		dashLength~7 = get(1)&lt;BR /&gt;
		getValues = 0&lt;BR /&gt;
	endif&lt;BR /&gt;
!Return: NONE&lt;BR /&gt;
!Draw a dashed line&lt;BR /&gt;
	!Calculate the line length and direction vectors&lt;BR /&gt;
		ux~7 = x2~7 - x1~7&lt;BR /&gt;
		uy~7 = y2~7 - y1~7&lt;BR /&gt;
		uz~7 = z2~7 - z1~7&lt;BR /&gt;
		L~7 = sqr(ux~7^2 + uy~7^2 + uz~7^2)&lt;BR /&gt;
		ux~7 = ux~7/L~7&lt;BR /&gt;
		uy~7 = uy~7/L~7&lt;BR /&gt;
		uz~7 = uz~7/L~7&lt;BR /&gt;
!Calculate the length of the first and last dashes&lt;BR /&gt;
	nDashes~7 = int(1 + (L~7 + dashLength~7)/(2*dashLength~7))&lt;BR /&gt;
	extraLength~7 = (nDashes~7*(2*dashLength~7) – dashLength~7) – L~7&lt;BR /&gt;
	startLength~7 = dashLength~7 - extraLength~7/2&lt;BR /&gt;
!Draw the lines&lt;BR /&gt;
	add x1~7, y1~7, z1~7&lt;BR /&gt;
	lin_ 0, 0, 0,&lt;BR /&gt;
		startLength~7*ux~7, startLength~7*uy~7, startLength~7*uz~7&lt;BR /&gt;
	L1~7 = startLength~7 + dashLength~7&lt;BR /&gt;
	repeat&lt;BR /&gt;
	L2~7 = min(L1~7 + dashLength~7, L~7)&lt;BR /&gt;
	lin_ L1~7*ux~7, L1~7*uy~7, L1~7*uz~7,&lt;BR /&gt;
		L2~7*ux~7, L2~7*uy~7, L2~7*uz~7&lt;BR /&gt;
		L1~7 = L2~7 + dashLength~7&lt;BR /&gt;
		until L1~7 &amp;gt; L~7&lt;BR /&gt;
		del 1&lt;BR /&gt;
return&lt;/T&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 13 May 2013 13:30:09 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Dashed-Line-om-3d-GDL-issue/m-p/145527#M13597</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-05-13T13:30:09Z</dc:date>
    </item>
    <item>
      <title>Re: Dashed Line om 3d GDL issue</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Dashed-Line-om-3d-GDL-issue/m-p/145528#M13598</link>
      <description>The two things that strike me are:&lt;BR /&gt;
&lt;BR /&gt;
I have always used line numbers (arbitrarily assigned not actual counted ones) for my GOSUBSs. I am guessing that the string value is not supported. I have never seen this. Is there something in the docs about it? Have you used it elsewhere?&lt;BR /&gt;
&lt;BR /&gt;
I also have never used the "~" (tilde) character in variable names. Perhaps this is not supported. The "_" (underscore) character is more typical.</description>
      <pubDate>Mon, 13 May 2013 13:49:22 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Dashed-Line-om-3d-GDL-issue/m-p/145528#M13598</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-05-13T13:49:22Z</dc:date>
    </item>
    <item>
      <title>Re: Dashed Line om 3d GDL issue</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Dashed-Line-om-3d-GDL-issue/m-p/145529#M13599</link>
      <description>Thanks, will try changing them &lt;IMG src="https://community.graphisoft.com/legacyfs/online/emojis/icon_biggrin.gif" style="display : inline;" /&gt; Will tell if it worked</description>
      <pubDate>Mon, 13 May 2013 15:46:50 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Dashed-Line-om-3d-GDL-issue/m-p/145529#M13599</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-05-13T15:46:50Z</dc:date>
    </item>
    <item>
      <title>Re: Dashed Line om 3d GDL issue</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Dashed-Line-om-3d-GDL-issue/m-p/145530#M13600</link>
      <description>Hello,&lt;BR /&gt;
&lt;BR /&gt;
Text label for subroutines works from version 10.&lt;BR /&gt;

&lt;BLOCKQUOTE&gt;I have always used line numbers (arbitrarily assigned not actual counted ones) for my GOSUBSs. I am guessing that the string value is not supported. I have never seen this.&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Mon, 13 May 2013 17:42:58 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Dashed-Line-om-3d-GDL-issue/m-p/145530#M13600</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-05-13T17:42:58Z</dc:date>
    </item>
    <item>
      <title>Re: Dashed Line om 3d GDL issue</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Dashed-Line-om-3d-GDL-issue/m-p/145531#M13601</link>
      <description>Thanks Guys but Didn't work &lt;IMG src="https://community.graphisoft.com/legacyfs/online/emojis/icon_sad.gif" style="display : inline;" /&gt; I still get errors, is there a simple way of doing this?!? I just wanted to add a dashed line to my furniture doors, I tried understanding how the lines on the archicad library worked but didn't get there (doors and windows). If anyone could help me I would really appreciate it!</description>
      <pubDate>Mon, 13 May 2013 18:19:43 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Dashed-Line-om-3d-GDL-issue/m-p/145531#M13601</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-05-13T18:19:43Z</dc:date>
    </item>
    <item>
      <title>Re: Dashed Line om 3d GDL issue</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Dashed-Line-om-3d-GDL-issue/m-p/145532#M13602</link>
      <description>There are a few things to adjust. &lt;BR /&gt;
1. all those "~7" are gremlins come out  from somewhere, but you have to delete them all (use the search and replace command in the Edit menu). &lt;BR /&gt;
 &lt;BR /&gt;
2. there is a missing PUT command, as you PUT 6 values and try to GET 7. &lt;BR /&gt;
 &lt;BR /&gt;
3. at the line 28 [extraLength = (nDashes*(2*dashLength) - dashLength) - L] the "-" are SIMILAR to the "minus" sign, but are in fact different characters. This can happen when copying from PDF, OCR'd text, or other printed sources. Retype them and the "illegal characters" will became "legal". &lt;BR /&gt;
 &lt;BR /&gt;
4. This is an error I've reported many times, as it is also present on the GDL Manual. You can't use DIFFERENT QUOTE SIGNS as delimiters for strings. This has to be read literally. You are not allowed to use an open-close quote pair. The best is to use the single or double "vertical" quote,  usually found on the keyboard. But if you use an open-quote to start the string, you have to use the same open-quote at the end. &lt;BR /&gt;
To be clear: &lt;BR /&gt;
'string' ! OK &lt;BR /&gt;
"string" ! OK &lt;BR /&gt;
“string“ ! OK &lt;BR /&gt;
”string” ! OK &lt;BR /&gt;
“string” ! No, this doesn't work. &lt;BR /&gt;
(so two of the three examples on page 11 of the GDL User Manual are wrong) &lt;BR /&gt;
 &lt;BR /&gt;
5. There is no END statement before the Subroutine, so the program will run to the RETURN one more time, and you will get the "Return without Gosub" error. &lt;BR /&gt;
 
&lt;PRE&gt;getValues = 1  
put 0, 0, 0, a, b, zzyzx 
DashLength=.1  
put DashLength 
gosub "Dashed Line"  
END 
 
"Dashed Line":  
!Input: ! - Line end points: (x1, y1, z1~z) and (x2, y2, z2)  
        ! - Dash length: dashLength  
if getValues then  
	x1 = get(1): y1 = get(1): z1 = get(1)  
	x2 = get(1): y2 = get(1): z2 = get(1)  
	dashLength = get(1)  
	getValues = 0  
endif  
!Return: NONE !Draw a dashed line  
              !Calculate the line length and direction vectors  
ux = x2 - x1  
uy = y2 - y1  
uz = z2 - z1  
L  = sqr(ux^2 + uy^2 + uz^2)  
ux = ux/L  
uy = uy/L  
uz = uz/L  
!Calculate the length of the first and last dashes  
nDashes     = int(1 + (L + dashLength)/(2*dashLength))  
extraLength = (nDashes*(2*dashLength)-dashLength)-L  
startLength = dashLength - extraLength/2  
!Draw the lines  
add x1, y1, z1  
lin_ 0, 0, 0,  
    startLength*ux, startLength*uy, startLength*uz  
L1 = startLength + dashLength  
repeat  
  L2 = min(L1 + dashLength, L)  
  lin_ L1*ux, L1*uy, L1*uz,  
       L2*ux, L2*uy, L2*uz  
  L1 = L2 + dashLength  
until L1 &amp;gt; L  
del 1  
return 
&lt;/PRE&gt;</description>
      <pubDate>Mon, 13 May 2013 19:58:02 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Dashed-Line-om-3d-GDL-issue/m-p/145532#M13602</guid>
      <dc:creator>rocorona</dc:creator>
      <dc:date>2013-05-13T19:58:02Z</dc:date>
    </item>
    <item>
      <title>Re: Dashed Line om 3d GDL issue</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Dashed-Line-om-3d-GDL-issue/m-p/145533#M13603</link>
      <description>Grazie mille!&lt;BR /&gt;
&lt;BR /&gt;
That worked perfectly, I'm only learning GDL and I find that it's hard to learn it by books and forums only, I don't have any background on programming so it's a bit harder for me! &lt;BR /&gt;
&lt;BR /&gt;
Thank you again! By the way did u used the same routine? Cause u solved the issue really fast &lt;IMG src="https://community.graphisoft.com/legacyfs/online/emojis/icon_biggrin.gif" style="display : inline;" /&gt; !</description>
      <pubDate>Mon, 13 May 2013 20:21:29 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Dashed-Line-om-3d-GDL-issue/m-p/145533#M13603</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-05-13T20:21:29Z</dc:date>
    </item>
    <item>
      <title>Re: Dashed Line om 3d GDL issue</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Dashed-Line-om-3d-GDL-issue/m-p/145534#M13604</link>
      <description>&lt;BLOCKQUOTE&gt;luisfmoreira wrote:&lt;BR /&gt; Cause u solved the issue really fast &lt;IMG src="https://community.graphisoft.com/legacyfs/online/emojis/icon_biggrin.gif" style="display : inline;" /&gt; !&lt;/BLOCKQUOTE&gt;
I just eliminated errors, as I found them. &lt;BR /&gt;
Maybe I make so many, in my scripting, that I have become skilled at finding them.  &lt;IMG src="https://community.graphisoft.com/legacyfs/online/emojis/icon_wink.gif" style="display : inline;" /&gt;</description>
      <pubDate>Mon, 13 May 2013 20:45:13 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Dashed-Line-om-3d-GDL-issue/m-p/145534#M13604</guid>
      <dc:creator>rocorona</dc:creator>
      <dc:date>2013-05-13T20:45:13Z</dc:date>
    </item>
  </channel>
</rss>

