<?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: 3D polyline using in Libraries &amp; objects</title>
    <link>https://community.graphisoft.com/t5/Libraries-objects/3D-polyline-using/m-p/228971#M7782</link>
    <description>You need to mark position of the change - and check if it is before or after the object placement. If after do nothing...if before the number of placing segment must go down by 1 if the node is subtracted or go up by 1 if added. &lt;BR /&gt;
&lt;BR /&gt;
(I did not analyze the object You quoted, but I made something similar some time ago...times of ver 12)&lt;BR /&gt;
&lt;BR /&gt;
Best Regards,&lt;BR /&gt;
Piotr</description>
    <pubDate>Wed, 14 Sep 2016 07:48:38 GMT</pubDate>
    <dc:creator>Piotr Dobrowolski</dc:creator>
    <dc:date>2016-09-14T07:48:38Z</dc:date>
    <item>
      <title>3D polyline using</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/3D-polyline-using/m-p/228968#M7779</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;&lt;T&gt;Hi, I wanted to use in my object the 3D polyline that I have found some time ago on this forum (credit to the author). &lt;BR /&gt;
&lt;BR /&gt;
I would like to enable user to put in a certain segment a geometry (for example a sphere). &lt;BR /&gt;
Let's assume there are 8 segments, and I pick the 6th one to place there a sphere. &lt;BR /&gt;
The problem is that when I reduce the number of points then the sphere jumps forward to another segment (because obviously the 6th segment is in different place now).&lt;BR /&gt;
&lt;BR /&gt;
I'm run out of ideas how can I make it stay in the previous position, anyone can help me?&lt;/T&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 13 Sep 2016 17:12:00 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/3D-polyline-using/m-p/228968#M7779</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-09-13T17:12:00Z</dc:date>
    </item>
    <item>
      <title>Re: 3D polyline using</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/3D-polyline-using/m-p/228969#M7780</link>
      <description>"the author" here.&lt;BR /&gt;
&lt;BR /&gt;
In essence, the interpretation is correct because the geometry gets placed on the specified segment. You can modify any of the segments after the selected one and the geometry will stay on the specified segment. If you modify any segment before the selected one, obviously the numbering of segments changes and so does the sphere's placement.&lt;BR /&gt;
&lt;BR /&gt;
To correct this, you would need to identify which point is being moved or which segment is about to be removed. If it is one before where the user has selected to place the sphere, you'd need to modify the selected segment for placement (to the previous one). You'd need to put special attention on what to do when the user is about to remove the segment where the sphere is currently placed.&lt;BR /&gt;
&lt;BR /&gt;
Best regards.</description>
      <pubDate>Wed, 14 Sep 2016 00:03:12 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/3D-polyline-using/m-p/228969#M7780</guid>
      <dc:creator>sinceV6</dc:creator>
      <dc:date>2016-09-14T00:03:12Z</dc:date>
    </item>
    <item>
      <title>Re: 3D polyline using</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/3D-polyline-using/m-p/228970#M7781</link>
      <description>&lt;BLOCKQUOTE&gt;jasiek772 wrote:&lt;BR /&gt;Hi, I wanted to use in my object the 3D polyline that I have found some time ago on this forum (credit to the author). &lt;BR /&gt;
&lt;BR /&gt;
I would like to enable user to put in a certain segment a geometry (for example a sphere). &lt;BR /&gt;
Let's assume there are 8 segments, and I pick the 6th one to place there a sphere. &lt;BR /&gt;
The problem is that when I reduce the number of points then the sphere jumps forward to another segment (because obviously the 6th segment is in different place now).&lt;BR /&gt;
&lt;BR /&gt;
I'm run out of ideas how can I make it stay in the previous position, anyone can help me?&lt;/BLOCKQUOTE&gt;

&lt;PRE&gt;IF GLOB_MODPAR_NAME = "IXYZ" THEN

	FOR i=1 to points
		IF ABS(IXYZ&lt;I&gt;&lt;X&gt;-IXYZP&lt;I&gt;&lt;X&gt;)&amp;gt;EPS OR ABS(IXYZ&lt;I&gt;&lt;Y&gt;-IXYZP&lt;I&gt;&lt;Y&gt;)&amp;gt;EPS THEN
			insertIndex_2=i
			newX_2=IXYZ&lt;I&gt;&lt;X&gt;
			newY_2=IXYZ&lt;I&gt;&lt;Y&gt;
			newZ_2=IXYZ&lt;I&gt;&lt;Z&gt;

		ENDIF
	NEXT i


	IF insertIndex_2&amp;gt;0 THEN
	points=points+1


		FOR i=points TO insertIndex_2+2 STEP -1
			XYZ&lt;I&gt;&lt;X&gt;=XYZ[i-1]&lt;X&gt;
			XYZ&lt;I&gt;&lt;Y&gt;=XYZ[i-1]&lt;Y&gt;
			XYZ&lt;I&gt;&lt;Z&gt;=XYZ[i-1]&lt;Z&gt;

		NEXT i

		XYZ[insertIndex_2+1]&lt;X&gt;=newX_2
		XYZ[insertIndex_2+1]&lt;Y&gt;=newY_2
		XYZ[insertIndex_2+1]&lt;Z&gt;=newZ_2


	ENDIF
ENDIF
!===================================================================
!===FOR REMOVING POINTS=============================================
remainingPoints_2=1


FOR i=1 TO points-1

	hypotenuse_2 = sqr((XYZ[i+1]&lt;X&gt;-XYZ&lt;I&gt;&lt;X&gt;)^2 +(XYZ[i+1]&lt;Y&gt;-XYZ&lt;I&gt;&lt;Y&gt;)^2)
	IF hypotenuse_2&amp;gt;EPS THEN
		remainingPoints_2 = remainingPoints_2+1
		PUT XYZ[i+1]&lt;X&gt;,XYZ[i+1]&lt;Y&gt;,XYZ[i+1]&lt;Z&gt;
	ENDIF

NEXT i

!PRINT remainingPoints

FOR i=2 TO remainingPoints_2
	XYZ&lt;I&gt;&lt;X&gt;=GET(1)
	XYZ&lt;I&gt;&lt;Y&gt;=GET(1)
	XYZ&lt;I&gt;&lt;Z&gt;=GET(1)
NEXT i

points=remainingPoints_2&lt;/Z&gt;&lt;/I&gt;&lt;/Y&gt;&lt;/I&gt;&lt;/X&gt;&lt;/I&gt;&lt;/Z&gt;&lt;/Y&gt;&lt;/X&gt;&lt;/Y&gt;&lt;/I&gt;&lt;/Y&gt;&lt;/X&gt;&lt;/I&gt;&lt;/X&gt;&lt;/Z&gt;&lt;/Y&gt;&lt;/X&gt;&lt;/Z&gt;&lt;/Z&gt;&lt;/I&gt;&lt;/Y&gt;&lt;/Y&gt;&lt;/I&gt;&lt;/X&gt;&lt;/X&gt;&lt;/I&gt;&lt;/Z&gt;&lt;/I&gt;&lt;/Y&gt;&lt;/I&gt;&lt;/X&gt;&lt;/I&gt;&lt;/Y&gt;&lt;/I&gt;&lt;/Y&gt;&lt;/I&gt;&lt;/X&gt;&lt;/I&gt;&lt;/X&gt;&lt;/I&gt;&lt;/PRE&gt;

Its in here somewere &lt;IMG src="https://community.graphisoft.com/legacyfs/online/emojis/icon_smile.gif" style="display : inline;" /&gt; took me a min to figure it out</description>
      <pubDate>Wed, 14 Sep 2016 01:48:47 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/3D-polyline-using/m-p/228970#M7781</guid>
      <dc:creator>SenecaDesignLLC</dc:creator>
      <dc:date>2016-09-14T01:48:47Z</dc:date>
    </item>
    <item>
      <title>Re: 3D polyline using</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/3D-polyline-using/m-p/228971#M7782</link>
      <description>You need to mark position of the change - and check if it is before or after the object placement. If after do nothing...if before the number of placing segment must go down by 1 if the node is subtracted or go up by 1 if added. &lt;BR /&gt;
&lt;BR /&gt;
(I did not analyze the object You quoted, but I made something similar some time ago...times of ver 12)&lt;BR /&gt;
&lt;BR /&gt;
Best Regards,&lt;BR /&gt;
Piotr</description>
      <pubDate>Wed, 14 Sep 2016 07:48:38 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/3D-polyline-using/m-p/228971#M7782</guid>
      <dc:creator>Piotr Dobrowolski</dc:creator>
      <dc:date>2016-09-14T07:48:38Z</dc:date>
    </item>
    <item>
      <title>Re: 3D polyline using</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/3D-polyline-using/m-p/228972#M7783</link>
      <description>&lt;BLOCKQUOTE&gt;SenecaDesignLLC wrote:&lt;BR /&gt;

&lt;PRE&gt;IF GLOB_MODPAR_NAME = "IXYZ" THEN

	FOR i=1 to points
		IF ABS(IXYZ&lt;I&gt;&lt;X&gt;-IXYZP&lt;I&gt;&lt;X&gt;)&amp;gt;EPS OR ABS(IXYZ&lt;I&gt;&lt;Y&gt;-IXYZP&lt;I&gt;&lt;Y&gt;)&amp;gt;EPS THEN
			insertIndex_2=i
			newX_2=IXYZ&lt;I&gt;&lt;X&gt;
			newY_2=IXYZ&lt;I&gt;&lt;Y&gt;
			newZ_2=IXYZ&lt;I&gt;&lt;Z&gt;

		ENDIF
	NEXT i


	IF insertIndex_2&amp;gt;0 THEN
	points=points+1


		FOR i=points TO insertIndex_2+2 STEP -1
			XYZ&lt;I&gt;&lt;X&gt;=XYZ[i-1]&lt;X&gt;
			XYZ&lt;I&gt;&lt;Y&gt;=XYZ[i-1]&lt;Y&gt;
			XYZ&lt;I&gt;&lt;Z&gt;=XYZ[i-1]&lt;Z&gt;

		NEXT i

		XYZ[insertIndex_2+1]&lt;X&gt;=newX_2
		XYZ[insertIndex_2+1]&lt;Y&gt;=newY_2
		XYZ[insertIndex_2+1]&lt;Z&gt;=newZ_2


	ENDIF
ENDIF
!===================================================================
!===FOR REMOVING POINTS=============================================
remainingPoints_2=1


FOR i=1 TO points-1

	hypotenuse_2 = sqr((XYZ[i+1]&lt;X&gt;-XYZ&lt;I&gt;&lt;X&gt;)^2 +(XYZ[i+1]&lt;Y&gt;-XYZ&lt;I&gt;&lt;Y&gt;)^2)
	IF hypotenuse_2&amp;gt;EPS THEN
		remainingPoints_2 = remainingPoints_2+1
		PUT XYZ[i+1]&lt;X&gt;,XYZ[i+1]&lt;Y&gt;,XYZ[i+1]&lt;Z&gt;
	ENDIF

NEXT i

!PRINT remainingPoints

FOR i=2 TO remainingPoints_2
	XYZ&lt;I&gt;&lt;X&gt;=GET(1)
	XYZ&lt;I&gt;&lt;Y&gt;=GET(1)
	XYZ&lt;I&gt;&lt;Z&gt;=GET(1)
NEXT i

points=remainingPoints_2&lt;/Z&gt;&lt;/I&gt;&lt;/Y&gt;&lt;/I&gt;&lt;/X&gt;&lt;/I&gt;&lt;/Z&gt;&lt;/Y&gt;&lt;/X&gt;&lt;/Y&gt;&lt;/I&gt;&lt;/Y&gt;&lt;/X&gt;&lt;/I&gt;&lt;/X&gt;&lt;/Z&gt;&lt;/Y&gt;&lt;/X&gt;&lt;/Z&gt;&lt;/Z&gt;&lt;/I&gt;&lt;/Y&gt;&lt;/Y&gt;&lt;/I&gt;&lt;/X&gt;&lt;/X&gt;&lt;/I&gt;&lt;/Z&gt;&lt;/I&gt;&lt;/Y&gt;&lt;/I&gt;&lt;/X&gt;&lt;/I&gt;&lt;/Y&gt;&lt;/I&gt;&lt;/Y&gt;&lt;/I&gt;&lt;/X&gt;&lt;/I&gt;&lt;/X&gt;&lt;/I&gt;&lt;/PRE&gt;

Its in here somewere &lt;IMG src="https://community.graphisoft.com/legacyfs/online/emojis/icon_smile.gif" style="display : inline;" /&gt; took me a min to figure it out&lt;/BLOCKQUOTE&gt;

Could you please spend another min to explain it to me somehow? Because to me it looks like you simply replaced some one-dimensional arrays into two-dimensional in existing script, but why? Or maybe you don't mean to replace existing lines but just to add your lines below?&lt;BR /&gt;
&lt;BR /&gt;
Thank you all for your consideration!&lt;BR /&gt;
"Piotr Dobrowolski" and "SenecaDesignLLC" of course I know it should be divided into few different cases, whether reducing or adding points in certain places changes anything or not, so the question is not when I should divide it, or what should I take under consideration writing the script, but how to write it?</description>
      <pubDate>Wed, 14 Sep 2016 12:23:58 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/3D-polyline-using/m-p/228972#M7783</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-09-14T12:23:58Z</dc:date>
    </item>
    <item>
      <title>Re: 3D polyline using</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/3D-polyline-using/m-p/228973#M7784</link>
      <description>Hi.&lt;BR /&gt;
&lt;BR /&gt;
In that old version of the script, you can start with something as simple as these couple of edits:&lt;BR /&gt;

&lt;PRE&gt;!===FOR ADDING POINTS===============================================
IF GLOB_MODPAR_NAME = "insertX" OR GLOB_MODPAR_NAME = "insertY" THEN
	FOR i=1 to points
		IF ABS(insertX&lt;I&gt;-insertXPrev&lt;I&gt;)&amp;gt;EPS OR ABS(insertY&lt;I&gt;-insertYPrev&lt;I&gt;)&amp;gt;EPS THEN
			insertIndex=i
			newX=insertX&lt;I&gt;
			newY=insertY&lt;I&gt;
			newZ=insertZ&lt;I&gt;
		ENDIF
	NEXT i

	IF insertIndex&amp;gt;0 THEN
	points=points+1
		FOR i=points TO insertIndex+2 STEP -1
			x&lt;I&gt;=x[i-1]
			y&lt;I&gt;=y[i-1]
			z&lt;I&gt;=z[i-1]
		NEXT i
		x[insertIndex+1]=newX
		y[insertIndex+1]=newY
		z[insertIndex+1]=newZ
		
	!!!THESE LINES--------------------------------------	
	If insertIndex&amp;lt;brnr THEN
		brnr=brnr+1
	ENDIF
	!-----------------------------------------------------------

	ENDIF
ENDIF
!===================================================================

!===FOR REMOVING POINTS=============================================
remainingPoints=1
FOR i=1 TO points-1
	hypotenuse = sqr((x[i+1]-x&lt;I&gt;)^2 +(y[i+1]-y&lt;I&gt;)^2)
	IF hypotenuse&amp;gt;EPS THEN
		remainingPoints = remainingPoints+1
		PUT x[i+1],y[i+1],z[i+1]
		
	ENDIF

!!!THESE LINES-------------------------------------
	IF hypotenuse&amp;lt;EPS AND brnr&amp;gt;i THEN
		brnr=brnr-1
	ENDIF
!!!--------------------------------------------------

NEXT i&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/PRE&gt;

Although I changed the parameter script to:
&lt;PRE&gt;!my VALUES


!!!VALUES 'brnr' listar
VALUES 'brnr' RANGE[1,segments]
PARAMETERS brnr=brnr
&lt;/PRE&gt;

See if that works for you.&lt;BR /&gt;
Best regards.</description>
      <pubDate>Wed, 14 Sep 2016 19:39:31 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/3D-polyline-using/m-p/228973#M7784</guid>
      <dc:creator>sinceV6</dc:creator>
      <dc:date>2016-09-14T19:39:31Z</dc:date>
    </item>
    <item>
      <title>Re: 3D polyline using</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/3D-polyline-using/m-p/228974#M7785</link>
      <description>Well it turns out that I forgot just one thing: &lt;BR /&gt;
"PARAMETERS brnr=brnr "&lt;BR /&gt;
Such a stupid oversight...&lt;BR /&gt;
&lt;BR /&gt;
Thank you very much for your help!</description>
      <pubDate>Wed, 14 Sep 2016 23:07:59 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/3D-polyline-using/m-p/228974#M7785</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-09-14T23:07:59Z</dc:date>
    </item>
  </channel>
</rss>

