<?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: Moving entity to particular coordinates in ObjectARX Forum</title>
    <link>https://forums.autodesk.com/t5/objectarx-forum/moving-entity-to-particular-coordinates/m-p/5864597#M10780</link>
    <description>&lt;P&gt;Didn't you know the actual position?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you have the actual position, than don't use the absolute new position as vector but the new position - the old position&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(vec = NewPos - OldPos)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Than you have the relative Vector to go to the new absolute position... or get I your question wrong?&lt;/P&gt;</description>
    <pubDate>Fri, 16 Oct 2015 12:40:22 GMT</pubDate>
    <dc:creator>Matti72</dc:creator>
    <dc:date>2015-10-16T12:40:22Z</dc:date>
    <item>
      <title>Moving entity to particular coordinates</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/moving-entity-to-particular-coordinates/m-p/5864578#M10778</link>
      <description>&lt;P&gt;How can we move our entity to particular coordinates.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Like I have a 3dSolid with me, and now I want to move it to (20.0,40.0,0.0)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have used transformby, but it moves my entity in relate to my present coordinates. I want my the centre of my to go at (20.0,40.0,0.0)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is what I have tried&lt;/P&gt;&lt;PRE&gt;AcGeMatrix3d move;
AcGeVector3d vector(0, 0, height);
move.setTranslation(vector);
pSolid-&amp;gt;transformBy(move);&lt;/PRE&gt;&lt;P&gt;I dont want relative movement of my entity but I want absolute movement.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Oct 2015 12:28:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/moving-entity-to-particular-coordinates/m-p/5864578#M10778</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-10-16T12:28:16Z</dc:date>
    </item>
    <item>
      <title>Re: Moving entity to particular coordinates</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/moving-entity-to-particular-coordinates/m-p/5864591#M10779</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&lt;FONT color="#000080"&gt;&amp;gt;&amp;gt; Like I have a 3dSolid with me, and now I want to move it to (20.0,40.0,0.0)&lt;/FONT&gt;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;What point of your 3D-Solid should be at this new coordinate? If your 3D-Solid is e.g. a box, then there are 8 corner points, 6 face-centers, which of them is it?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And if you know that point then evaluate it's current position, having that you can create a transfer vector from the current position to the new position.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;- alfred -&lt;/P&gt;</description>
      <pubDate>Fri, 16 Oct 2015 12:39:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/moving-entity-to-particular-coordinates/m-p/5864591#M10779</guid>
      <dc:creator>Alfred.NESWADBA</dc:creator>
      <dc:date>2015-10-16T12:39:11Z</dc:date>
    </item>
    <item>
      <title>Re: Moving entity to particular coordinates</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/moving-entity-to-particular-coordinates/m-p/5864597#M10780</link>
      <description>&lt;P&gt;Didn't you know the actual position?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you have the actual position, than don't use the absolute new position as vector but the new position - the old position&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(vec = NewPos - OldPos)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Than you have the relative Vector to go to the new absolute position... or get I your question wrong?&lt;/P&gt;</description>
      <pubDate>Fri, 16 Oct 2015 12:40:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/moving-entity-to-particular-coordinates/m-p/5864597#M10780</guid>
      <dc:creator>Matti72</dc:creator>
      <dc:date>2015-10-16T12:40:22Z</dc:date>
    </item>
    <item>
      <title>Re: Moving entity to particular coordinates</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/moving-entity-to-particular-coordinates/m-p/5864616#M10781</link>
      <description>I have a box whose centroid is placed at origin. Now I want to move the centroid of my box to point (20.0,40.0,20.0).&lt;BR /&gt;&lt;BR /&gt;Can you show me how to do it?</description>
      <pubDate>Fri, 16 Oct 2015 12:49:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/moving-entity-to-particular-coordinates/m-p/5864616#M10781</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-10-16T12:49:47Z</dc:date>
    </item>
    <item>
      <title>Re: Moving entity to particular coordinates</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/moving-entity-to-particular-coordinates/m-p/5864625#M10782</link>
      <description>Hi Matti72,&lt;BR /&gt;&lt;BR /&gt;I didnt get your point, how do I do it?&lt;BR /&gt;&lt;BR /&gt;I have a box whose centroid is placed at origin. Now I want to move the centroid of my box to point (20.0,40.0,20.0).&lt;BR /&gt;&lt;BR /&gt;Can you show me how to do it?</description>
      <pubDate>Fri, 16 Oct 2015 12:52:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/moving-entity-to-particular-coordinates/m-p/5864625#M10782</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-10-16T12:52:28Z</dc:date>
    </item>
    <item>
      <title>Re: Moving entity to particular coordinates</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/moving-entity-to-particular-coordinates/m-p/5864833#M10783</link>
      <description>&lt;P&gt;Hi Sandeep,&lt;/P&gt;&lt;P&gt;To move the solid at an absolute position, you first have to know its current position, if it's not the case, you have to "recompute" it. Interrestingly, solids don't have any position information (OCS for instance). So, I think that the best way is to get its centroid is to call AcDb3dSolid::getMassProp (you'll see a "centroid" output parameter).&lt;/P&gt;&lt;P&gt;Since you have this centroid, you'll have to transform you solid like this (pseudo-code):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;solid-&amp;gt;transformBy(-centroid.asVector()+AcGeVector3d(20.0,40.0,0.0));&lt;/PRE&gt;&lt;P&gt;I think it should do the trick.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;let me know&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Oct 2015 14:26:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/moving-entity-to-particular-coordinates/m-p/5864833#M10783</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-10-16T14:26:39Z</dc:date>
    </item>
    <item>
      <title>Re: Moving entity to particular coordinates</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/moving-entity-to-particular-coordinates/m-p/5867425#M10784</link>
      <description>Thanks so much Loic&lt;BR /&gt;&lt;BR /&gt;It did the trick..</description>
      <pubDate>Mon, 19 Oct 2015 11:17:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/moving-entity-to-particular-coordinates/m-p/5867425#M10784</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-10-19T11:17:15Z</dc:date>
    </item>
  </channel>
</rss>

