<?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: Regarding the use of AcEdJig class, when AcDbText is being dragged as a mirr in ObjectARX Forum</title>
    <link>https://forums.autodesk.com/t5/objectarx-forum/regarding-the-use-of-acedjig-class-when-acdbtext-is-being/m-p/9545077#M4531</link>
    <description>&lt;P&gt;Sorry, I don't see what you mean.&lt;/P&gt;
&lt;P&gt;I've seen the video and the screenshot. The text is rotated but not mirrored.&lt;/P&gt;
&lt;P&gt;So what's wrong? How would you expect the text to look like?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The only prolems I notices are:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;the text appears mirrored right in the moment when you start rotating.&lt;/LI&gt;
&lt;LI&gt;during the rotation the text has an additional offset to the left (about the width of 'ab').&lt;/LI&gt;
&lt;/OL&gt;</description>
    <pubDate>Thu, 28 May 2020 07:20:44 GMT</pubDate>
    <dc:creator>tbrammer</dc:creator>
    <dc:date>2020-05-28T07:20:44Z</dc:date>
    <item>
      <title>Regarding the use of AcEdJig class, when AcDbText is being dragged as a mirror,</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/regarding-the-use-of-acedjig-class-when-acdbtext-is-being/m-p/9516189#M4524</link>
      <description>&lt;P&gt;Regarding the use of AcEdJig class, when AcDbText is being dragged as a mirror, how to display AcDbText correctly?&lt;/P&gt;&lt;P&gt;mirrtext=0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks.&lt;/P&gt;</description>
      <pubDate>Thu, 14 May 2020 14:15:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/regarding-the-use-of-acedjig-class-when-acdbtext-is-being/m-p/9516189#M4524</guid>
      <dc:creator>7598165</dc:creator>
      <dc:date>2020-05-14T14:15:50Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding the use of AcEdJig class, when AcDbText is being dragged as a mirr</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/regarding-the-use-of-acedjig-class-when-acdbtext-is-being/m-p/9526673#M4525</link>
      <description>&lt;P&gt;I'm not sure what you need exactly. Maybe this code helps:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;void FlipText()
{
	ads_point    pt;
	ads_name     ent;
	AcDbObjectId objId;

	if (acedEntSel(_T("\nSelect text"), ent, pt) != RTNORM)
		return;

	if (acdbGetObjectId(objId, ent) != Acad::eOk) 
		return;

	// Get the current viewdir
	struct resbuf var;
	acedGetVar(_T("VIEWDIR"), &amp;amp;var);
	AcGeVector3d viewdir;
	acdbUcs2Wcs(var.resval.rpoint, asDblArray(viewdir), true);

	Acad::ErrorStatus es;
	AcDbText *text;
	if ((es = acdbOpenObject(text, objId, AcDb::kForRead)) == Acad::eOk)
	{
		AcGeVector3d normal(text-&amp;gt;normal());
		double dp = normal.dotProduct(viewdir);
		if (dp &amp;lt; 0.0) // if &amp;lt;0 we look at the text from the wrong side. Flip it.
		{
			es = text-&amp;gt;upgradeOpen();
			if (!es)
			{
				// Flip the normal but keep the insertion/aligment point
				AcDb::TextHorzMode h = text-&amp;gt;horizontalMode();
				AcDb::TextVertMode v = text-&amp;gt;verticalMode();
				bool bUsePos=((h==AcDb::kTextLeft)&amp;amp;&amp;amp;(v==AcDb::kTextBase));

				AcGePoint3d pt(bUsePos? text-&amp;gt;position() : text-&amp;gt;alignmentPoint());
				text-&amp;gt;setNormal(-normal); // flip the normal

				if (bUsePos)
					es = text-&amp;gt;setPosition(pt);		 
				else
					es = text-&amp;gt;setAlignmentPoint(pt);
			}
		}
		text-&amp;gt;close();
	}
}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 May 2020 14:10:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/regarding-the-use-of-acedjig-class-when-acdbtext-is-being/m-p/9526673#M4525</guid>
      <dc:creator>tbrammer</dc:creator>
      <dc:date>2020-05-19T14:10:49Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding the use of AcEdJig class, when AcDbText is being dragged as a mirr</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/regarding-the-use-of-acedjig-class-when-acdbtext-is-being/m-p/9528141#M4526</link>
      <description>&lt;P&gt;Thank you! What I want is not the final text result after dragging, but the effect that the text correctly reflects when dragging in AcGeJig.Can you Help me ?&lt;/P&gt;&lt;P&gt;Can you help me? Thanks again! !&lt;/P&gt;</description>
      <pubDate>Wed, 20 May 2020 00:39:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/regarding-the-use-of-acedjig-class-when-acdbtext-is-being/m-p/9528141#M4526</guid>
      <dc:creator>7598165</dc:creator>
      <dc:date>2020-05-20T00:39:30Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding the use of AcEdJig class, when AcDbText is being dragged as a mirr</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/regarding-the-use-of-acedjig-class-when-acdbtext-is-being/m-p/9528637#M4527</link>
      <description>&lt;P&gt;Is the &lt;FONT face="courier new,courier"&gt;AcDbText&lt;/FONT&gt; your &lt;FONT face="courier new,courier"&gt;jig-&amp;gt;entity()&lt;/FONT&gt;? Then I would assume that have have to make sure that it's normal points along the viewing direction while dragging. This is what my code sample shows.&lt;/P&gt;
&lt;P&gt;Could you post sample code that allows me to understand and reproduce your problem?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note:&amp;nbsp; &lt;FONT face="courier new,courier"&gt;AcDbText&lt;/FONT&gt; also has these methods:&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; Adesk::Boolean isMirroredInX() const;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; Acad::ErrorStatus mirrorInX(Adesk::Boolean);&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; Adesk::Boolean isMirroredInY() const;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; Acad::ErrorStatus mirrorInY(Adesk::Boolean);&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;But they don't take the current viewing direction into account.&lt;/P&gt;</description>
      <pubDate>Wed, 20 May 2020 07:22:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/regarding-the-use-of-acedjig-class-when-acdbtext-is-being/m-p/9528637#M4527</guid>
      <dc:creator>tbrammer</dc:creator>
      <dc:date>2020-05-20T07:22:25Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding the use of AcEdJig class, when AcDbText is being dragged as a mirr</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/regarding-the-use-of-acedjig-class-when-acdbtext-is-being/m-p/9536894#M4528</link>
      <description>&lt;LI-CODE lang="general"&gt;virtual Adesk::Boolean  subWorldDraw(AcGiWorldDraw* wd)
{
	wd-&amp;gt;geometry().pushModelTransform(m_mat);
	AcDbEntity* pE;
	AcDbRotatedDimension* pDim;
	for (int i = 0; i &amp;lt; m_idArray.length(); i++)
	{
		if (acdbOpenObject(pE, m_idArray[i], AcDb::kForRead) == Acad::eOk)
		{

			///////////////////////////////////////////////////////////////////////////
			// see if the entity is a block reference, if so then check for any attributes so we don't display the 
			// definitions
			AcDbBlockReference* pBlockref = AcDbBlockReference::cast(pE);
			// if it is a block reference
			if (pBlockref != NULL)
			{
				// create an attribute iterator so we can check to see if any attribute asre attached
				AcDbObjectIterator* pAttributeIterator = pBlockref-&amp;gt;attributeIterator();
				// if it allocated ok
				if (pAttributeIterator != NULL)
				{
					AcDbObjectId   ObjId;
					AcDbAttribute* pAttribute = NULL;
					// now loop through them
					int count;
					for (count = 0; !pAttributeIterator-&amp;gt;done(); pAttributeIterator-&amp;gt;step(), ++count)
					{
						// get the object id of the attribute
						ObjId = pAttributeIterator-&amp;gt;objectId();
						// open the object so we can draw it
						if (acdbOpenObject(pAttribute, ObjId, AcDb::kForRead) != Acad::eOk)
							continue;
						// now draw it
						wd-&amp;gt;geometry().draw(pAttribute);
						// now close the attribute
						pAttribute-&amp;gt;close();
					}
					// delete the iterator
					delete pAttributeIterator;
					// see if we have any attributes attached to this block
					// if we have then to stop the attribute definitions being drawn
					if (count)
					{
						AcDbVoidPtrArray entitySet;
						// explode and get some temporary entities
						Acad::ErrorStatus es = pBlockref-&amp;gt;explode(entitySet);
						// if it worked ok
						if (es == Acad::eOk)
						{
							// loop round getting the intersection points
							for (long i = 0l; i &amp;lt; entitySet.length(); ++i)
							{
								// get a pointer to the entity object
								AcDbEntity* pNewEnt = (AcDbEntity*)entitySet.at(i);
								AcDbAttributeDefinition* pAttributeDef = AcDbAttributeDefinition::cast(pNewEnt);
								// if it is NOT an attribute definition
								if (pAttributeDef == NULL)
								{
									// then draw it
									wd-&amp;gt;geometry().draw(pNewEnt);
								}
								// delete the temporary entity
								delete pNewEnt;
							}
						}
					}
					// no attributes - just draw
					else
					{
						wd-&amp;gt;geometry().draw(pE);
					}
				}
				// failed attribute iterator - just draw it
				else
				{
					wd-&amp;gt;geometry().draw(pE);
				}
			}
			if (!DocVars.Xd_Kernel.pCurDwg-&amp;gt;mirrtext() &amp;amp;&amp;amp; (XdGeUtils::IsMirrorMatrix(m_mat)))
			{
				///////////////////////////////////////////
				if (pE-&amp;gt;isKindOf(AcDbText::desc()))
				{
					wd-&amp;gt;geometry().draw(pE);
//how
				}
				else if (pE-&amp;gt;isKindOf(AcDbMText::desc()))
				{
					wd-&amp;gt;geometry().draw(pE);
					//how
				}
			}
			// not a block reference - just draw then
			else
			{
				wd-&amp;gt;geometry().draw(pE);
			}
			pE-&amp;gt;close();
		}
	}
	wd-&amp;gt;geometry().popModelTransform();
	return Adesk::kTrue;
}&lt;/LI-CODE&gt;</description>
      <pubDate>Sun, 24 May 2020 15:54:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/regarding-the-use-of-acedjig-class-when-acdbtext-is-being/m-p/9536894#M4528</guid>
      <dc:creator>7598165</dc:creator>
      <dc:date>2020-05-24T15:54:30Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding the use of AcEdJig class, when AcDbText is being dragged as a mirr</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/regarding-the-use-of-acedjig-class-when-acdbtext-is-being/m-p/9539646#M4529</link>
      <description>&lt;P&gt;I would try something like this:&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;AcDbText *text = AcDbText::cast(pE);
AcGePoint3d pos(text-&amp;gt;position()); // this is the point that will stay fixed
AcGeVector3d zAxis(text-&amp;gt;normal);
AcGeVector3d xAxis = zAxis.perpVector().rotateBy(text-&amp;gt;rotation(), zAxis);
AcGeVector3d yAxis = zAxis.crossProduct(xAxis);

AcGeMatrix3d mirrMat;
mirrMat.setToAlignCoordSys(
	pos,  xAxis, yAxis, zAxis,
	pos, -xAxis, yAxis, zAxis   // -xAxis to flip the X direction. 
);

wd-&amp;gt;geometry().pushModelTransform(mirrMat);
wd-&amp;gt;geometry().draw(pE);
wd-&amp;gt;geometry().popModelTransform();&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 26 May 2020 08:18:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/regarding-the-use-of-acedjig-class-when-acdbtext-is-being/m-p/9539646#M4529</guid>
      <dc:creator>tbrammer</dc:creator>
      <dc:date>2020-05-26T08:18:29Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding the use of AcEdJig class, when AcDbText is being dragged as a mirr</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/regarding-the-use-of-acedjig-class-when-acdbtext-is-being/m-p/9544761#M4530</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mirror.gif" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/776518i82063E2D5ED7DA21/image-size/large?v=v2&amp;amp;px=999" role="button" title="mirror.gif" alt="mirror.gif" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you, according to your code, it was partially successful, but in a certain state, the display is not correct, can you solve it when the following picture is shown?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="搜狗截图20200528110313.jpg" style="width: 973px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/776522iF5B653A27E792941/image-size/large?v=v2&amp;amp;px=999" role="button" title="搜狗截图20200528110313.jpg" alt="搜狗截图20200528110313.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 28 May 2020 03:03:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/regarding-the-use-of-acedjig-class-when-acdbtext-is-being/m-p/9544761#M4530</guid>
      <dc:creator>7598165</dc:creator>
      <dc:date>2020-05-28T03:03:51Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding the use of AcEdJig class, when AcDbText is being dragged as a mirr</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/regarding-the-use-of-acedjig-class-when-acdbtext-is-being/m-p/9545077#M4531</link>
      <description>&lt;P&gt;Sorry, I don't see what you mean.&lt;/P&gt;
&lt;P&gt;I've seen the video and the screenshot. The text is rotated but not mirrored.&lt;/P&gt;
&lt;P&gt;So what's wrong? How would you expect the text to look like?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The only prolems I notices are:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;the text appears mirrored right in the moment when you start rotating.&lt;/LI&gt;
&lt;LI&gt;during the rotation the text has an additional offset to the left (about the width of 'ab').&lt;/LI&gt;
&lt;/OL&gt;</description>
      <pubDate>Thu, 28 May 2020 07:20:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/regarding-the-use-of-acedjig-class-when-acdbtext-is-being/m-p/9545077#M4531</guid>
      <dc:creator>tbrammer</dc:creator>
      <dc:date>2020-05-28T07:20:44Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding the use of AcEdJig class, when AcDbText is being dragged as a mirr</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/regarding-the-use-of-acedjig-class-when-acdbtext-is-being/m-p/9545389#M4532</link>
      <description>&lt;P&gt;Animation of the AutoCAD mirror command&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mirror1.gif" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/776683iEB45564522F64BA8/image-size/large?v=v2&amp;amp;px=999" role="button" title="mirror1.gif" alt="mirror1.gif" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;AcEdJig uses your code, the effect is as follows：&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When the XDir angle of the AcDbText object is between -pi / 2 and pi / 2, the text is not displayed correctly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;virtual Adesk::Boolean  subWorldDraw(AcGiWorldDraw* wd)
{
	wd-&amp;gt;geometry().pushModelTransform(m_mat);
	AcDbEntity* pE;
	for (int i = 0; i &amp;lt; m_idArray.length(); i++)
	{
		if (acdbOpenObject(pE, m_idArray[i], AcDb::kForRead) == Acad::eOk)
		{
			if (pE-&amp;gt;isKindOf(AcDbText::desc()))
			{
				if (!DocVars.Xd_Kernel.pCurDwg-&amp;gt;mirrtext())
				{
					AcGePoint3d ori1;
					AcGeVector3d xAxis1, yAxis1, zAxis1;
					AcDbText* text = AcDbText::cast(pE);
					AcGePoint3d pos(text-&amp;gt;position()); // this is the point that will stay fixed
					AcGeVector3d zAxis(text-&amp;gt;normal());
					AcGeVector3d xAxis = zAxis.perpVector().rotateBy(text-&amp;gt;rotation(), zAxis);
					AcGeVector3d yAxis = zAxis.crossProduct(xAxis);
					AcGePoint3dArray box;
					XdDbUtils::getEntityBoundaryBox(pE, box);
					AcGePoint3d pMid = XdGeUtils::midPoint(box.first(), box[2]);

					AcGeMatrix3d mirrMat;
					mirrMat.setToAlignCoordSys(
						pMid, xAxis, yAxis, zAxis,
						pMid, -xAxis, yAxis, zAxis   // -xAxis to flip the X direction. 
						);
					wd-&amp;gt;geometry().pushModelTransform(mirrMat);
					wd-&amp;gt;geometry().draw(pE);
				}
				else {
					DocVars.mMirrorResultMatrix = m_mat;
					wd-&amp;gt;geometry().draw(pE);
				}
			}
			else
			{
				wd-&amp;gt;geometry().draw(pE);
			}
			pE-&amp;gt;close();
		}
	}
	wd-&amp;gt;geometry().popModelTransform();
	return Adesk::kTrue;
}&lt;/LI-CODE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mirror.gif" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/776684iAFE1D91E358EE037/image-size/large?v=v2&amp;amp;px=999" role="button" title="mirror.gif" alt="mirror.gif" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 28 May 2020 09:42:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/regarding-the-use-of-acedjig-class-when-acdbtext-is-being/m-p/9545389#M4532</guid>
      <dc:creator>7598165</dc:creator>
      <dc:date>2020-05-28T09:42:08Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding the use of AcEdJig class, when AcDbText is being dragged as a mirr</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/regarding-the-use-of-acedjig-class-when-acdbtext-is-being/m-p/9545689#M4533</link>
      <description>&lt;P&gt;In the new animation I see what you mean . If the text is rotated by 90°-270° you would expect it to appear "upside down" but instead it is rotated by additional 180° so that it remains readable. Right?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I don't think it is related to my mirror-flip code.&lt;/P&gt;
&lt;P&gt;I think the text is drawn with one of the two AcGiGeometry::text(..) methods. One passes an&amp;nbsp;AcGiTextStyle and the second one doesn't. It uses a built in style "STANDARD". &lt;/P&gt;
&lt;DIV id="areafixed" class="Element710" style="width: 2147px;"&gt;
&lt;DIV class="Element92"&gt;
&lt;DIV class="Element5"&gt;AcGiTextStyle has the methods setUpsideDown(bool) and bool isUpsideDown(). As far as I understand the text will&lt;/DIV&gt;
&lt;DIV class="Element5"&gt;never be drawn upside down if isUpsideDown()==false.&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Thu, 28 May 2020 12:00:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/regarding-the-use-of-acedjig-class-when-acdbtext-is-being/m-p/9545689#M4533</guid>
      <dc:creator>tbrammer</dc:creator>
      <dc:date>2020-05-28T12:00:57Z</dc:date>
    </item>
  </channel>
</rss>

