<?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: Creating polyline offsets in ObjectARX Forum</title>
    <link>https://forums.autodesk.com/t5/objectarx-forum/creating-polyline-offsets/m-p/6898846#M8688</link>
    <description>&lt;P&gt;Simplest way is getting two polyline:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;polyline-&amp;gt;getOffsetCurves( +offset, offsetPolylinePoints1);
polyline-&amp;gt;getOffsetCurves( -offset, offsetPolylinePoints2);
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;double area1 = 0; offsetPolylinePoints1[0].getArea(area1);
double area2 = 0; offsetPolylinePoints2[0].getArea(area2);&lt;/PRE&gt;
&lt;P&gt;if area1 &amp;gt; area2 then offsetPolylinePoints1[0] is a outside polyline.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 23 Feb 2017 16:21:32 GMT</pubDate>
    <dc:creator>Alexander.Rivilis</dc:creator>
    <dc:date>2017-02-23T16:21:32Z</dc:date>
    <item>
      <title>Creating polyline offsets</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/creating-polyline-offsets/m-p/6898799#M8687</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I trying to create a function that will take a polyline and apply an offset to it with the condition that the offset is always on the outside of the polyline. The problem I am having is that sometimes the offset is inside the polyline not outside and I cant seem to figure out why. The API docs say that a negative offset would indicate to most objects that the curve should be inside so i would guess that a positive offset would indicate that the curve should be outside. My code is below.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;bool createPolylineOffset( AcDbPolyline *polyline, double offset, ACHAR *offsetLayer  )
{
	Acad::ErrorStatus errorStatus;
	AcDbObjectId ownerId;
	AcDbVoidPtrArray offsetPolylinePoints;
	AcDbPolyline *offsetPolyline;


	//Make sure that we are drawing our offset on the outside of the selected polyline
	offset = abs( offset );
	ownerId = polyline-&amp;gt;ownerId();
	errorStatus = polyline-&amp;gt;getOffsetCurves( offset, offsetPolylinePoints );


	if( errorStatus != Acad::eOk )
	{
		acutPrintf( L"\nError: Could not offset points %s", acadErrorStatusText( errorStatus ) );
		return false;
	}
	if( offsetPolylinePoints.length() != 1 )
	{
		acutPrintf( L"\nError: Could not get offset points" );
		deleteArray( offsetPolylinePoints );
		return false;
	}

	offsetPolyline = (AcDbPolyline*)(offsetPolylinePoints[0]);
	offsetPolyline-&amp;gt;setLayer(offsetLayer);

    appendEntity(offsetPolyline, ownerId);
	
	offsetPolyline-&amp;gt;close();
	return true;
}&lt;/PRE&gt;</description>
      <pubDate>Thu, 23 Feb 2017 16:09:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/creating-polyline-offsets/m-p/6898799#M8687</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-02-23T16:09:57Z</dc:date>
    </item>
    <item>
      <title>Re: Creating polyline offsets</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/creating-polyline-offsets/m-p/6898846#M8688</link>
      <description>&lt;P&gt;Simplest way is getting two polyline:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;polyline-&amp;gt;getOffsetCurves( +offset, offsetPolylinePoints1);
polyline-&amp;gt;getOffsetCurves( -offset, offsetPolylinePoints2);
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;double area1 = 0; offsetPolylinePoints1[0].getArea(area1);
double area2 = 0; offsetPolylinePoints2[0].getArea(area2);&lt;/PRE&gt;
&lt;P&gt;if area1 &amp;gt; area2 then offsetPolylinePoints1[0] is a outside polyline.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Feb 2017 16:21:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/creating-polyline-offsets/m-p/6898846#M8688</guid>
      <dc:creator>Alexander.Rivilis</dc:creator>
      <dc:date>2017-02-23T16:21:32Z</dc:date>
    </item>
    <item>
      <title>Re: Creating polyline offsets</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/creating-polyline-offsets/m-p/6898893#M8689</link>
      <description>&lt;P&gt;Thank you for your help that makes a lot of sense.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Feb 2017 16:37:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/creating-polyline-offsets/m-p/6898893#M8689</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-02-23T16:37:06Z</dc:date>
    </item>
  </channel>
</rss>

