<?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: AcGeCircArc3d start angle and end angle in ObjectARX Forum</title>
    <link>https://forums.autodesk.com/t5/objectarx-forum/acgecircarc3d-start-angle-and-end-angle/m-p/328918#M42004</link>
    <description>Hopefully this will work for you...&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
/***************************************************************************&lt;BR /&gt;
*&lt;BR /&gt;
**&lt;BR /&gt;
**    geCurveToDbCurve&lt;BR /&gt;
**        allocates a new curve!&lt;BR /&gt;
**&lt;BR /&gt;
**    **jma&lt;BR /&gt;
**&lt;BR /&gt;
*************************************/&lt;BR /&gt;
&lt;BR /&gt;
AcDbCurve*&lt;BR /&gt;
geCurveToDbCurve(const AcGeCurve3d* pcurve)&lt;BR /&gt;
{&lt;BR /&gt;
    if (pcurve-&amp;gt;isKindOf(AcGe::kLineSeg3d)) {&lt;BR /&gt;
        const AcGeLineSeg3d *geLine = static_cast&lt;CONST&gt;&lt;BR /&gt;
AcGeLineSeg3d*&amp;gt;(pcurve);&lt;BR /&gt;
        AcDbLine* dbLine = new AcDbLine(geLine-&amp;gt;startPoint(),&lt;BR /&gt;
geLine-&amp;gt;endPoint());&lt;BR /&gt;
        return dbLine;&lt;BR /&gt;
    }&lt;BR /&gt;
    else if (pcurve-&amp;gt;isKindOf(AcGe::kCircArc3d)) {&lt;BR /&gt;
        const AcGeCircArc3d* geCircArc = static_cast&lt;CONST&gt;&lt;BR /&gt;
AcGeCircArc3d*&amp;gt;(pcurve);&lt;BR /&gt;
        if (geCircArc-&amp;gt;isClosed()) {&lt;BR /&gt;
            AcDbCircle* dbCircle = new AcDbCircle(geCircArc-&amp;gt;center(),&lt;BR /&gt;
geCircArc-&amp;gt;normal(),&lt;BR /&gt;
                                         geCircArc-&amp;gt;radius());&lt;BR /&gt;
            return dbCircle;&lt;BR /&gt;
        }&lt;BR /&gt;
        else {&lt;BR /&gt;
            AcGePlane ecsPlane;&lt;BR /&gt;
            Aec::getEcsPlane(geCircArc-&amp;gt;normal(), ecsPlane);&lt;BR /&gt;
            double refAng = geCircArc-&amp;gt;refVec().angleOnPlane(ecsPlane);&lt;BR /&gt;
            AcDbArc* dbArc = new AcDbArc(geCircArc-&amp;gt;center(),&lt;BR /&gt;
geCircArc-&amp;gt;radius(),&lt;BR /&gt;
                                (refAng + geCircArc-&amp;gt;startAng()),&lt;BR /&gt;
                                (refAng + geCircArc-&amp;gt;endAng()));&lt;BR /&gt;
            dbArc-&amp;gt;setNormal(geCircArc-&amp;gt;normal());&lt;BR /&gt;
            return dbArc;&lt;BR /&gt;
        }&lt;BR /&gt;
    }&lt;BR /&gt;
    else if (pcurve-&amp;gt;isKindOf(AcGe::kEllipArc3d)) {&lt;BR /&gt;
        const AcGeEllipArc3d* geEllipArc = static_cast&lt;CONST&gt;&lt;BR /&gt;
AcGeEllipArc3d*&amp;gt;(pcurve);&lt;BR /&gt;
&lt;BR /&gt;
        AcDbEllipse* dbEllipse = new AcDbEllipse;&lt;BR /&gt;
        double ratio = geEllipArc-&amp;gt;minorRadius() /&lt;BR /&gt;
geEllipArc-&amp;gt;majorRadius();&lt;BR /&gt;
        AcGeVector3d majorAxis = geEllipArc-&amp;gt;majorAxis() *&lt;BR /&gt;
geEllipArc-&amp;gt;majorRadius();&lt;BR /&gt;
&lt;BR /&gt;
        if (geEllipArc-&amp;gt;isClosed()) {&lt;BR /&gt;
            dbEllipse-&amp;gt;set(geEllipArc-&amp;gt;center(), geEllipArc-&amp;gt;normal(),&lt;BR /&gt;
                            majorAxis, ratio);&lt;BR /&gt;
        }&lt;BR /&gt;
        else {&lt;BR /&gt;
            dbEllipse-&amp;gt;set(geEllipArc-&amp;gt;center(), geEllipArc-&amp;gt;normal(),&lt;BR /&gt;
                            majorAxis, ratio, geEllipArc-&amp;gt;startAng(),&lt;BR /&gt;
geEllipArc-&amp;gt;endAng());&lt;BR /&gt;
        }&lt;BR /&gt;
&lt;BR /&gt;
        if (dbEllipse-&amp;gt;isNull()) {&lt;BR /&gt;
            delete dbEllipse;&lt;BR /&gt;
            ASSERT(0);&lt;BR /&gt;
            return NULL;&lt;BR /&gt;
        }&lt;BR /&gt;
        else&lt;BR /&gt;
            return dbEllipse;&lt;BR /&gt;
    }&lt;BR /&gt;
    return static_cast&lt;ACDBCURVE&gt;(NULL);&lt;BR /&gt;
}&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Jim Awe&lt;BR /&gt;
Autodesk, Inc.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
"Tim Nary" &lt;TJNJR&gt; wrote in message&lt;BR /&gt;
news:A25C481E1C73DB6A6EF61D622CC6F561@in.WebX.maYIadrTaRb...&lt;BR /&gt;
&amp;gt; I have created a AcGeCircArc3d and I wish to use the data from this to&lt;BR /&gt;
&amp;gt; create an actual arc in AutoCAD. When you get the startAng and endAng&lt;BR /&gt;
&amp;gt; properties of the arc they are set to the refVec() of the arc. How can I&lt;BR /&gt;
&amp;gt; convert this to the actual start and end angles that will generate a arc&lt;BR /&gt;
in&lt;BR /&gt;
&amp;gt; AutoCAD that matches the AcGeCircArc3d? I hope this makes sense to&lt;BR /&gt;
someone.&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;/TJNJR&gt;&lt;/ACDBCURVE&gt;&lt;/CONST&gt;&lt;/CONST&gt;&lt;/CONST&gt;</description>
    <pubDate>Mon, 11 Mar 2002 15:00:58 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2002-03-11T15:00:58Z</dc:date>
    <item>
      <title>AcGeCircArc3d start angle and end angle</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/acgecircarc3d-start-angle-and-end-angle/m-p/328915#M42001</link>
      <description>I have created a AcGeCircArc3d and I wish to use the data from this to&lt;BR /&gt;
create an actual arc in AutoCAD. When you get the startAng and endAng&lt;BR /&gt;
properties of the arc they are set to the refVec() of the arc. How can I&lt;BR /&gt;
convert this to the actual start and end angles that will generate a arc in&lt;BR /&gt;
AutoCAD that matches the AcGeCircArc3d? I hope this makes sense to someone.</description>
      <pubDate>Wed, 06 Mar 2002 13:17:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/acgecircarc3d-start-angle-and-end-angle/m-p/328915#M42001</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2002-03-06T13:17:39Z</dc:date>
    </item>
    <item>
      <title>Re: AcGeCircArc3d start angle and end angle</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/acgecircarc3d-start-angle-and-end-angle/m-p/328916#M42002</link>
      <description>Hi Tim,&lt;BR /&gt;
&lt;BR /&gt;
I'm not sure but i think you must set the current UCS in the plane where&lt;BR /&gt;
your AcDbCircArc entity should be. The x-Axis of this UCS should have the&lt;BR /&gt;
direction of the RefVec. Now you can set start- and endangle  as they are in&lt;BR /&gt;
the AcGeCircArc3d object.&lt;BR /&gt;
Hope this helps.&lt;BR /&gt;
&lt;BR /&gt;
Regards Steffen Lips&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
"Tim Nary" &lt;TJNJR&gt; schrieb im Newsbeitrag&lt;BR /&gt;
news:A25C481E1C73DB6A6EF61D622CC6F561@in.WebX.maYIadrTaRb...&lt;BR /&gt;
&amp;gt; I have created a AcGeCircArc3d and I wish to use the data from this to&lt;BR /&gt;
&amp;gt; create an actual arc in AutoCAD. When you get the startAng and endAng&lt;BR /&gt;
&amp;gt; properties of the arc they are set to the refVec() of the arc. How can I&lt;BR /&gt;
&amp;gt; convert this to the actual start and end angles that will generate a arc&lt;BR /&gt;
in&lt;BR /&gt;
&amp;gt; AutoCAD that matches the AcGeCircArc3d? I hope this makes sense to&lt;BR /&gt;
someone.&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;/TJNJR&gt;</description>
      <pubDate>Wed, 06 Mar 2002 22:43:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/acgecircarc3d-start-angle-and-end-angle/m-p/328916#M42002</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2002-03-06T22:43:22Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/acgecircarc3d-start-angle-and-end-angle/m-p/328917#M42003</link>
      <description>I'm afraid that doesn't help me much.</description>
      <pubDate>Thu, 07 Mar 2002 12:07:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/acgecircarc3d-start-angle-and-end-angle/m-p/328917#M42003</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2002-03-07T12:07:22Z</dc:date>
    </item>
    <item>
      <title>Re: AcGeCircArc3d start angle and end angle</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/acgecircarc3d-start-angle-and-end-angle/m-p/328918#M42004</link>
      <description>Hopefully this will work for you...&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
/***************************************************************************&lt;BR /&gt;
*&lt;BR /&gt;
**&lt;BR /&gt;
**    geCurveToDbCurve&lt;BR /&gt;
**        allocates a new curve!&lt;BR /&gt;
**&lt;BR /&gt;
**    **jma&lt;BR /&gt;
**&lt;BR /&gt;
*************************************/&lt;BR /&gt;
&lt;BR /&gt;
AcDbCurve*&lt;BR /&gt;
geCurveToDbCurve(const AcGeCurve3d* pcurve)&lt;BR /&gt;
{&lt;BR /&gt;
    if (pcurve-&amp;gt;isKindOf(AcGe::kLineSeg3d)) {&lt;BR /&gt;
        const AcGeLineSeg3d *geLine = static_cast&lt;CONST&gt;&lt;BR /&gt;
AcGeLineSeg3d*&amp;gt;(pcurve);&lt;BR /&gt;
        AcDbLine* dbLine = new AcDbLine(geLine-&amp;gt;startPoint(),&lt;BR /&gt;
geLine-&amp;gt;endPoint());&lt;BR /&gt;
        return dbLine;&lt;BR /&gt;
    }&lt;BR /&gt;
    else if (pcurve-&amp;gt;isKindOf(AcGe::kCircArc3d)) {&lt;BR /&gt;
        const AcGeCircArc3d* geCircArc = static_cast&lt;CONST&gt;&lt;BR /&gt;
AcGeCircArc3d*&amp;gt;(pcurve);&lt;BR /&gt;
        if (geCircArc-&amp;gt;isClosed()) {&lt;BR /&gt;
            AcDbCircle* dbCircle = new AcDbCircle(geCircArc-&amp;gt;center(),&lt;BR /&gt;
geCircArc-&amp;gt;normal(),&lt;BR /&gt;
                                         geCircArc-&amp;gt;radius());&lt;BR /&gt;
            return dbCircle;&lt;BR /&gt;
        }&lt;BR /&gt;
        else {&lt;BR /&gt;
            AcGePlane ecsPlane;&lt;BR /&gt;
            Aec::getEcsPlane(geCircArc-&amp;gt;normal(), ecsPlane);&lt;BR /&gt;
            double refAng = geCircArc-&amp;gt;refVec().angleOnPlane(ecsPlane);&lt;BR /&gt;
            AcDbArc* dbArc = new AcDbArc(geCircArc-&amp;gt;center(),&lt;BR /&gt;
geCircArc-&amp;gt;radius(),&lt;BR /&gt;
                                (refAng + geCircArc-&amp;gt;startAng()),&lt;BR /&gt;
                                (refAng + geCircArc-&amp;gt;endAng()));&lt;BR /&gt;
            dbArc-&amp;gt;setNormal(geCircArc-&amp;gt;normal());&lt;BR /&gt;
            return dbArc;&lt;BR /&gt;
        }&lt;BR /&gt;
    }&lt;BR /&gt;
    else if (pcurve-&amp;gt;isKindOf(AcGe::kEllipArc3d)) {&lt;BR /&gt;
        const AcGeEllipArc3d* geEllipArc = static_cast&lt;CONST&gt;&lt;BR /&gt;
AcGeEllipArc3d*&amp;gt;(pcurve);&lt;BR /&gt;
&lt;BR /&gt;
        AcDbEllipse* dbEllipse = new AcDbEllipse;&lt;BR /&gt;
        double ratio = geEllipArc-&amp;gt;minorRadius() /&lt;BR /&gt;
geEllipArc-&amp;gt;majorRadius();&lt;BR /&gt;
        AcGeVector3d majorAxis = geEllipArc-&amp;gt;majorAxis() *&lt;BR /&gt;
geEllipArc-&amp;gt;majorRadius();&lt;BR /&gt;
&lt;BR /&gt;
        if (geEllipArc-&amp;gt;isClosed()) {&lt;BR /&gt;
            dbEllipse-&amp;gt;set(geEllipArc-&amp;gt;center(), geEllipArc-&amp;gt;normal(),&lt;BR /&gt;
                            majorAxis, ratio);&lt;BR /&gt;
        }&lt;BR /&gt;
        else {&lt;BR /&gt;
            dbEllipse-&amp;gt;set(geEllipArc-&amp;gt;center(), geEllipArc-&amp;gt;normal(),&lt;BR /&gt;
                            majorAxis, ratio, geEllipArc-&amp;gt;startAng(),&lt;BR /&gt;
geEllipArc-&amp;gt;endAng());&lt;BR /&gt;
        }&lt;BR /&gt;
&lt;BR /&gt;
        if (dbEllipse-&amp;gt;isNull()) {&lt;BR /&gt;
            delete dbEllipse;&lt;BR /&gt;
            ASSERT(0);&lt;BR /&gt;
            return NULL;&lt;BR /&gt;
        }&lt;BR /&gt;
        else&lt;BR /&gt;
            return dbEllipse;&lt;BR /&gt;
    }&lt;BR /&gt;
    return static_cast&lt;ACDBCURVE&gt;(NULL);&lt;BR /&gt;
}&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Jim Awe&lt;BR /&gt;
Autodesk, Inc.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
"Tim Nary" &lt;TJNJR&gt; wrote in message&lt;BR /&gt;
news:A25C481E1C73DB6A6EF61D622CC6F561@in.WebX.maYIadrTaRb...&lt;BR /&gt;
&amp;gt; I have created a AcGeCircArc3d and I wish to use the data from this to&lt;BR /&gt;
&amp;gt; create an actual arc in AutoCAD. When you get the startAng and endAng&lt;BR /&gt;
&amp;gt; properties of the arc they are set to the refVec() of the arc. How can I&lt;BR /&gt;
&amp;gt; convert this to the actual start and end angles that will generate a arc&lt;BR /&gt;
in&lt;BR /&gt;
&amp;gt; AutoCAD that matches the AcGeCircArc3d? I hope this makes sense to&lt;BR /&gt;
someone.&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;/TJNJR&gt;&lt;/ACDBCURVE&gt;&lt;/CONST&gt;&lt;/CONST&gt;&lt;/CONST&gt;</description>
      <pubDate>Mon, 11 Mar 2002 15:00:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/acgecircarc3d-start-angle-and-end-angle/m-p/328918#M42004</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2002-03-11T15:00:58Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/acgecircarc3d-start-angle-and-end-angle/m-p/328919#M42005</link>
      <description>It almost works, what is the definition of&lt;BR /&gt;
Aec::getEcsPlane(geCircArc-&amp;gt;normal(), ecsPlane); ?</description>
      <pubDate>Tue, 12 Mar 2002 05:11:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/acgecircarc3d-start-angle-and-end-angle/m-p/328919#M42005</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2002-03-12T05:11:17Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/acgecircarc3d-start-angle-and-end-angle/m-p/328920#M42006</link>
      <description>Oops... sorry I didn't see that reference.  Here are two more functions.&lt;BR /&gt;
You have to figure out what the angles of the arc are relative to its ECS,&lt;BR /&gt;
so you need to get the Plane of the Arc's ECS first.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
/***************************************************************************&lt;BR /&gt;
*&lt;BR /&gt;
**&lt;BR /&gt;
**  getEcsToWcsMatrix&lt;BR /&gt;
**      run AutoCAD's arbitrary matrix algorithm for ECS entities&lt;BR /&gt;
**&lt;BR /&gt;
**  **jma&lt;BR /&gt;
**&lt;BR /&gt;
*************************************/&lt;BR /&gt;
&lt;BR /&gt;
void&lt;BR /&gt;
getEcsToWcsMatrix(const AcGePoint3d&amp;amp; origin,&lt;BR /&gt;
                    const AcGeVector3d&amp;amp; zAxis, AcGeMatrix3d&amp;amp; mat)&lt;BR /&gt;
{&lt;BR /&gt;
    const double kArbBound = 0.015625;         //  1/64th&lt;BR /&gt;
&lt;BR /&gt;
        // short circuit if in WCS already&lt;BR /&gt;
    if (zAxis == AcGeVector3d::kZAxis) {&lt;BR /&gt;
        mat.setToIdentity();&lt;BR /&gt;
        return;&lt;BR /&gt;
    }&lt;BR /&gt;
&lt;BR /&gt;
    AcGeVector3d xAxis, yAxis;&lt;BR /&gt;
&lt;BR /&gt;
    ASSERT(zAxis.isUnitLength());&lt;BR /&gt;
&lt;BR /&gt;
    if ((fabs(zAxis.x) &amp;lt; kArbBound) &amp;amp;&amp;amp; (fabs(zAxis.y) &amp;lt; kArbBound))&lt;BR /&gt;
        xAxis = AcGeVector3d::kYAxis.crossProduct(zAxis);&lt;BR /&gt;
    else&lt;BR /&gt;
        xAxis = AcGeVector3d::kZAxis.crossProduct(zAxis);&lt;BR /&gt;
&lt;BR /&gt;
    xAxis.normalize();&lt;BR /&gt;
    yAxis = zAxis.crossProduct(xAxis);&lt;BR /&gt;
    yAxis.normalize();&lt;BR /&gt;
&lt;BR /&gt;
    mat.setCoordSystem(origin, xAxis, yAxis, zAxis);&lt;BR /&gt;
}&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
/***************************************************************************&lt;BR /&gt;
*&lt;BR /&gt;
**&lt;BR /&gt;
**  getEcsPlane&lt;BR /&gt;
**      This is the ECS plane for an AutoCAD entity. It can then be used to&lt;BR /&gt;
**  calculate angles relative to the ECS plane, for instance, angles of&lt;BR /&gt;
**  AcDbArc, AcDbBlockReference&lt;BR /&gt;
**&lt;BR /&gt;
**  **jma&lt;BR /&gt;
**&lt;BR /&gt;
*************************************/&lt;BR /&gt;
&lt;BR /&gt;
void&lt;BR /&gt;
getEcsPlane(const AcGeVector3d&amp;amp; entNormal, AcGePlane&amp;amp; ecsPlane)&lt;BR /&gt;
{&lt;BR /&gt;
    AcGeMatrix3d ecsMat;&lt;BR /&gt;
    getEcsToWcsMatrix(AcGePoint3d::kOrigin, entNormal, ecsMat);&lt;BR /&gt;
&lt;BR /&gt;
    AcGePoint3d origin;&lt;BR /&gt;
    AcGeVector3d xAxis, yAxis, zAxis;&lt;BR /&gt;
    ecsMat.getCoordSystem(origin, xAxis, yAxis, zAxis);&lt;BR /&gt;
    ecsPlane.set(origin, xAxis, yAxis);&lt;BR /&gt;
}&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
"Tim Nary" &lt;TJNJR&gt; wrote in message&lt;BR /&gt;
news:0EEB0A1C1275C7F8D3A454898D1742F2@in.WebX.maYIadrTaRb...&lt;BR /&gt;
&amp;gt; It almost works, what is the definition of&lt;BR /&gt;
&amp;gt; Aec::getEcsPlane(geCircArc-&amp;gt;normal(), ecsPlane); ?&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;/TJNJR&gt;</description>
      <pubDate>Tue, 12 Mar 2002 09:36:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/acgecircarc3d-start-angle-and-end-angle/m-p/328920#M42006</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2002-03-12T09:36:39Z</dc:date>
    </item>
  </channel>
</rss>

