<?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: Get Coordinate System in ObjectARX Forum</title>
    <link>https://forums.autodesk.com/t5/objectarx-forum/get-coordinate-system/m-p/6314124#M10090</link>
    <description>&lt;P&gt;What do you mean for "current coordinate system"? Usually it is a UCS (User Coordinate System).&lt;/P&gt;</description>
    <pubDate>Sun, 08 May 2016 12:58:27 GMT</pubDate>
    <dc:creator>Alexander.Rivilis</dc:creator>
    <dc:date>2016-05-08T12:58:27Z</dc:date>
    <item>
      <title>Get Coordinate System</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/get-coordinate-system/m-p/6311475#M10089</link>
      <description>&lt;P&gt;&lt;FONT size="5"&gt;hello&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="5"&gt;i want to get current&amp;nbsp;Coordinate System &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="5"&gt;is WCS or UCS or ECS or DCS &amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="5"&gt;is any function can do it?&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="5"&gt;thanks&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 06 May 2016 06:34:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/get-coordinate-system/m-p/6311475#M10089</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-05-06T06:34:48Z</dc:date>
    </item>
    <item>
      <title>Re: Get Coordinate System</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/get-coordinate-system/m-p/6314124#M10090</link>
      <description>&lt;P&gt;What do you mean for "current coordinate system"? Usually it is a UCS (User Coordinate System).&lt;/P&gt;</description>
      <pubDate>Sun, 08 May 2016 12:58:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/get-coordinate-system/m-p/6314124#M10090</guid>
      <dc:creator>Alexander.Rivilis</dc:creator>
      <dc:date>2016-05-08T12:58:27Z</dc:date>
    </item>
    <item>
      <title>Re: Get Coordinate System</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/get-coordinate-system/m-p/6314828#M10091</link>
      <description>&lt;P&gt;Get/Set UCS:&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; Acad::ErrorStatus acedGetCurrentUCS(AcGeMatrix3d&amp;amp; mat);&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; Acad::ErrorStatus acedSetCurrentUCS(const AcGeMatrix3d &amp;amp; mat);&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;General coordinate system transformation (see docs):&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp; int acedTrans(const ads_point pt, const struct resbuf *from, const resbuf *to, int disp, ads_point result);&lt;/FONT&gt;&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Determine the current view (also shows usage of &lt;FONT face="courier new,courier"&gt;acedTrans(&lt;/FONT&gt;)):&lt;/P&gt;&lt;PRE&gt;void getCurrentView(AcDbViewTableRecord &amp;amp;view)
{
	struct resbuf var; 
	struct resbuf WCS, UCS, DCS; 

	WCS.restype = RTSHORT; 
	WCS.resval.rint = 0; 
	UCS.restype = RTSHORT; 
	UCS.resval.rint = 1; 
	DCS.restype = RTSHORT; 
	DCS.resval.rint = 2; 

	acedGetVar(_T("VIEWMODE"), &amp;amp;var); 
	view.setPerspectiveEnabled(var.resval.rint &amp;amp; 1);
	view.setFrontClipEnabled((var.resval.rint &amp;amp; 2) ? true : false); 
	view.setBackClipEnabled((var.resval.rint &amp;amp; 4) ? true : false); 
	view.setFrontClipAtEye(!(var.resval.rint &amp;amp; 16)); 

	acedGetVar(_T("BACKZ"), &amp;amp;var); 
	view.setBackClipDistance(var.resval.rreal); 

	acedGetVar(_T("VIEWCTR"), &amp;amp;var); 
	acedTrans(var.resval.rpoint, &amp;amp;UCS, &amp;amp;DCS, NULL, var.resval.rpoint); 
	view.setCenterPoint(AcGePoint2d(var.resval.rpoint[X],var.resval.rpoint[Y])); 

	acedGetVar(_T("FRONTZ"), &amp;amp;var); 
	view.setFrontClipDistance(var.resval.rreal); 

	acedGetVar(_T("LENSLENGTH"), &amp;amp;var); 
	view.setLensLength(var.resval.rreal); 

	acedGetVar(_T("TARGET"), &amp;amp;var); 
	acedTrans(var.resval.rpoint, &amp;amp;UCS, &amp;amp;WCS, NULL, var.resval.rpoint); 
	view.setTarget(AcGePoint3d(var.resval.rpoint[X], var.resval.rpoint[Y],var.resval.rpoint[Z])); 

	acedGetVar(_T("VIEWDIR"), &amp;amp;var); 
	acedTrans(var.resval.rpoint, &amp;amp;UCS, &amp;amp;WCS, TRUE, var.resval.rpoint); 
	view.setViewDirection(AcGeVector3d(var.resval.rpoint[X],var.resval.rpoint[Y], var.resval.rpoint[Z]));

	acedGetVar(_T("VIEWSIZE"), &amp;amp;var); 
	view.setHeight(var.resval.rreal); 
	view.setWidth(1); 

	acedGetVar(_T("VIEWTWIST"), &amp;amp;var); 
	view.setViewTwist(var.resval.rreal);
}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Pick whatever you&amp;nbsp; need &lt;img id="smileywink" class="emoticon emoticon-smileywink" src="https://forums.autodesk.com/i/smilies/16x16_smiley-wink.png" alt="Smiley Wink" title="Smiley Wink" /&gt;.&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>Mon, 09 May 2016 07:18:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/get-coordinate-system/m-p/6314828#M10091</guid>
      <dc:creator>tbrammer</dc:creator>
      <dc:date>2016-05-09T07:18:48Z</dc:date>
    </item>
  </channel>
</rss>

