<?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: Problem with AcDbPolyline::convertTo() function in ObjectARX Forum</title>
    <link>https://forums.autodesk.com/t5/objectarx-forum/problem-with-acdbpolyline-convertto-function/m-p/985170#M31427</link>
    <description>:((
dear michael, what sense programing ARX if you use comands?? Try returning
to lisp.
I was expecting more pertinent answers...

"MiChaeL" &lt;MCL_Z&gt; wrote in message news:40606296_1@newsprd01...
&amp;gt; Command: convert
&amp;gt; Enter type of objects to convert [Hatch/Polyline/All] &lt;ALL&gt;:
&amp;gt;
&amp;gt;
&amp;gt;&lt;/ALL&gt;&lt;/MCL_Z&gt;</description>
    <pubDate>Wed, 24 Mar 2004 08:10:44 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2004-03-24T08:10:44Z</dc:date>
    <item>
      <title>Problem with AcDbPolyline::convertTo() function</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/problem-with-acdbpolyline-convertto-function/m-p/985165#M31422</link>
      <description>I want to convert a pline (type 2 or 1) to a 2dpline (type 0). I didn't find
any sample on that...so what should be open for write...
my algorithm is:
- select an entity
- chech it's type
- if  isKindOf  AcDbPolyline
   - it should be converted to AcDb2dPolyline

or, what type of pline is best to use? (plinetype); I want my users not to
worry with plinetype,
so a pline manipulation function must behave the same for all type of
plines...Since I don't know how to
iterate trough vertices of an AcDbPolyline, I want to use just
AcDb2dPolyline (or 3d...). I hope I was clear enough...

Thanks, ing. Vladimir Gora</description>
      <pubDate>Mon, 22 Mar 2004 09:44:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/problem-with-acdbpolyline-convertto-function/m-p/985165#M31422</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2004-03-22T09:44:49Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with AcDbPolyline::convertTo() function</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/problem-with-acdbpolyline-convertto-function/m-p/985166#M31423</link>
      <description>Well, I did it myself. If it can use...here is the source:

///////////////////////////////////////////////
void TestPline()
{
  int rc;
  ads_name en;
  AcGePoint3d pt;
  rc = acedEntSel("\nSelect a polyline: ", en, asDblArray(pt));
  if (rc != RTNORM) { acutPrintf("\nNo entity selected...");
        return; }
  AcDbObjectId eId, eId2;
  acdbGetObjectId(eId, en);

  AcDbObject *pObj;

  AcDbPolyline *pline2;
  AcDb2dPolyline *pline0 = new AcDb2dPolyline;

  acdbOpenObject(pObj, eId, AcDb::kForRead);

  if (pObj-&amp;gt;isKindOf(AcDbPolyline::desc())) {
      pObj-&amp;gt;close();

   acdbGetObjectId(eId2, en);
   acdbOpenObject(pline2, eId2, AcDb::kForWrite);
   acdbOpenObject(pline0, eId, AcDb::kForWrite);
   pline2-&amp;gt;convertTo(pline0, Adesk::kTrue);
   pline2-&amp;gt;close();
   pline0-&amp;gt;close();
   acutPrintf("\nSelected entity is an AcDbPolyline. \n ...but it was
converted to 2d");

  }
  else
  if (pObj-&amp;gt;isKindOf(AcDb2dPolyline::desc()))
  {
     pObj-&amp;gt;close();
     acutPrintf("\nSelected entity is  an AcDb2dPolyline.");
  return;
  }
}</description>
      <pubDate>Mon, 22 Mar 2004 11:52:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/problem-with-acdbpolyline-convertto-function/m-p/985166#M31423</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2004-03-22T11:52:14Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with AcDbPolyline::convertTo() function</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/problem-with-acdbpolyline-convertto-function/m-p/985167#M31424</link>
      <description>&lt;PRE&gt;
Hi Vladimir,
in older AutoCAD versions there were only 2dplines and old applications 
use them. In a new application i would use lwplines. When you save a 
drawing in 14 or 13 format the plines are saved as 2dplines. When you 
then open it you can decide if you want them created as 2dplines ( set 
plinetype =0) or lwplines ( set plinetype =2).
Regards, Petra.

Vladimir Gora wrote:
&amp;gt; I want to convert a pline (type 2 or 1) to a 2dpline (type 0). I didn't find
&amp;gt; any sample on that...so what should be open for write...
&amp;gt; my algorithm is:
&amp;gt; - select an entity
&amp;gt; - chech it's type
&amp;gt; - if  isKindOf  AcDbPolyline
&amp;gt;    - it should be converted to AcDb2dPolyline
&amp;gt; 
&amp;gt; or, what type of pline is best to use? (plinetype); I want my users not to
&amp;gt; worry with plinetype,
&amp;gt; so a pline manipulation function must behave the same for all type of
&amp;gt; plines...Since I don't know how to
&amp;gt; iterate trough vertices of an AcDbPolyline, I want to use just
&amp;gt; AcDb2dPolyline (or 3d...). I hope I was clear enough...
&amp;gt; 
&amp;gt; Thanks, ing. Vladimir Gora
&amp;gt; 
&amp;gt; 
&lt;/PRE&gt;</description>
      <pubDate>Tue, 23 Mar 2004 08:05:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/problem-with-acdbpolyline-convertto-function/m-p/985167#M31424</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2004-03-23T08:05:48Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with AcDbPolyline::convertTo() function</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/problem-with-acdbpolyline-convertto-function/m-p/985168#M31425</link>
      <description>Already know that, the problem is :
if plinetype = 2 (or = 1) =&amp;gt; an AcDbPolyline ( I CAN NOT  ITERATE TROUGH
IT'S VERTICES see AcDbPolyline class)
if plinetype = 0 =&amp;gt; AcDb2DPolyline (easy to work with)

For example RECTANGLE creates an AcDbPolyline, it DOESN'T CARE if plinetype
is 0,1 or 2. So, to work with plines,
I want my users not to be consurned about plinetype variable, but if they
draw an rectangle (for example), my function need to
work with that rectangle as it'ld be an AcDb2DPolyline( or 2d) and NOT an
AcDbPolyline.


"pfluegge" &lt;P.FLUEGGE&gt; wrote in message
news:405fefdd$1_1@newsprd01...
&amp;gt; &lt;PRE&gt;
&amp;gt; Hi Vladimir,
&amp;gt; in older AutoCAD versions there were only 2dplines and old applications
&amp;gt; use them. In a new application i would use lwplines. When you save a
&amp;gt; drawing in 14 or 13 format the plines are saved as 2dplines. When you
&amp;gt; then open it you can decide if you want them created as 2dplines ( set
&amp;gt; plinetype =0) or lwplines ( set plinetype =2).
&amp;gt; Regards, Petra.
&amp;gt;
&amp;gt; Vladimir Gora wrote:
&amp;gt; &amp;gt; I want to convert a pline (type 2 or 1) to a 2dpline (type 0). I didn't
find
&amp;gt; &amp;gt; any sample on that...so what should be open for write...
&amp;gt; &amp;gt; my algorithm is:
&amp;gt; &amp;gt; - select an entity
&amp;gt; &amp;gt; - chech it's type
&amp;gt; &amp;gt; - if  isKindOf  AcDbPolyline
&amp;gt; &amp;gt;    - it should be converted to AcDb2dPolyline
&amp;gt; &amp;gt;
&amp;gt; &amp;gt; or, what type of pline is best to use? (plinetype); I want my users not
to
&amp;gt; &amp;gt; worry with plinetype,
&amp;gt; &amp;gt; so a pline manipulation function must behave the same for all type of
&amp;gt; &amp;gt; plines...Since I don't know how to
&amp;gt; &amp;gt; iterate trough vertices of an AcDbPolyline, I want to use just
&amp;gt; &amp;gt; AcDb2dPolyline (or 3d...). I hope I was clear enough...
&amp;gt; &amp;gt;
&amp;gt; &amp;gt; Thanks, ing. Vladimir Gora
&amp;gt; &amp;gt;
&amp;gt; &amp;gt;
&amp;gt; &lt;/PRE&gt;
&amp;gt;&lt;/P.FLUEGGE&gt;</description>
      <pubDate>Tue, 23 Mar 2004 08:25:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/problem-with-acdbpolyline-convertto-function/m-p/985168#M31425</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2004-03-23T08:25:10Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with AcDbPolyline::convertTo() function</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/problem-with-acdbpolyline-convertto-function/m-p/985169#M31426</link>
      <description>Command: convert
Enter type of objects to convert [Hatch/Polyline/All] &lt;ALL&gt;:&lt;/ALL&gt;</description>
      <pubDate>Tue, 23 Mar 2004 16:03:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/problem-with-acdbpolyline-convertto-function/m-p/985169#M31426</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2004-03-23T16:03:19Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with AcDbPolyline::convertTo() function</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/problem-with-acdbpolyline-convertto-function/m-p/985170#M31427</link>
      <description>:((
dear michael, what sense programing ARX if you use comands?? Try returning
to lisp.
I was expecting more pertinent answers...

"MiChaeL" &lt;MCL_Z&gt; wrote in message news:40606296_1@newsprd01...
&amp;gt; Command: convert
&amp;gt; Enter type of objects to convert [Hatch/Polyline/All] &lt;ALL&gt;:
&amp;gt;
&amp;gt;
&amp;gt;&lt;/ALL&gt;&lt;/MCL_Z&gt;</description>
      <pubDate>Wed, 24 Mar 2004 08:10:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/problem-with-acdbpolyline-convertto-function/m-p/985170#M31427</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2004-03-24T08:10:44Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with AcDbPolyline::convertTo() function</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/problem-with-acdbpolyline-convertto-function/m-p/985171#M31428</link>
      <description>Iterating through vertices in an AcDbPolyline is pretty straightforward...&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
AcDbPolyline* pPline == NULL;&lt;BR /&gt;
&lt;BR /&gt;
//&lt;BR /&gt;
// Open or create pPline here...&lt;BR /&gt;
//&lt;BR /&gt;
&lt;BR /&gt;
AcGePoint3dArray pts;&lt;BR /&gt;
&lt;BR /&gt;
for (int i = 0;  i &amp;lt; pPline-&amp;gt;numVerts();  i++)&lt;BR /&gt;
{&lt;BR /&gt;
AcGePoint3d pt;&lt;BR /&gt;
pPline-&amp;gt;getPointAt(i, pt);&lt;BR /&gt;
pts.append(pt);&lt;BR /&gt;
}&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
...or maybe I'm not understanding what your gettng at?&lt;BR /&gt;
Andy F.</description>
      <pubDate>Tue, 30 Mar 2004 12:16:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/problem-with-acdbpolyline-convertto-function/m-p/985171#M31428</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2004-03-30T12:16:42Z</dc:date>
    </item>
  </channel>
</rss>

