<?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: in VBA Forum</title>
    <link>https://forums.autodesk.com/t5/vba-forum/i-m-not-understanding-ucs-method/m-p/303137#M65381</link>
    <description>&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;Hi Wayne,&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;Thanks for the ideas. I'll check them &lt;BR /&gt;
out&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;BLOCKQUOTE&gt;&lt;BR /&gt;
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px"&amp;gt;&lt;BR /&gt;
  &lt;DIV&gt;"wivory" &amp;lt;&lt;A&gt;&lt;BR /&gt;
  href="mailto:waynei@wespine.com"&amp;gt;waynei@wespine.com&lt;/A&gt;&amp;gt; wrote in message &lt;BR /&gt;
  &lt;A&gt;&lt;BR /&gt;
  href="news:f149f39.1@WebX.maYIadrTaRb"&amp;gt;news:f149f39.1@WebX.maYIadrTaRb&lt;/A&gt;...&lt;/DIV&gt;&lt;BR /&gt;
  &lt;DIV&gt;An afterthought - LBound and UBound could fail if the TransMatrix Variant &lt;BR /&gt;
  hasn't been initialised at the point where you're testing the bounds.&lt;/DIV&gt;&lt;BR /&gt;
  &lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
  &lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;at the point of error:&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
  &lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;a watch window shows the array to be an array of &lt;BR /&gt;
  four arrays, each with four elements and the tool tip shows the array is good &lt;BR /&gt;
  also,&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
  &lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;must be the other idea you said about another &lt;BR /&gt;
  parameter, i'll check it out&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
  &lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
  &lt;DIV&gt;&amp;nbsp;This seems unlikely since you said it works hardcoded, but it is &lt;BR /&gt;
  something else to consider. You could try doing a Debug.Print &lt;BR /&gt;
  TypeName(TransMatrix) prior to the loop to see what you get. &lt;BR /&gt;
  &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;Regards &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;Wayne&lt;/DIV&gt;&lt;BR /&gt;
  &lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
  &lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;do you agree that hardcoding is not the right way &lt;BR /&gt;
  to do it?&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
  &lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;do you work the night shift or are you on the &lt;BR /&gt;
  other side of the globe? england?&lt;/FONT&gt;&lt;/DIV&gt;&lt;/BLOCKQUOTE&gt;</description>
    <pubDate>Tue, 04 Mar 2003 01:59:55 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2003-03-04T01:59:55Z</dc:date>
    <item>
      <title>I'm not understanding ucs method!?!</title>
      <link>https://forums.autodesk.com/t5/vba-forum/i-m-not-understanding-ucs-method/m-p/303134#M65378</link>
      <description>Can anywone explain the following behaviour to me?&lt;BR /&gt;
It does not seem to work as I would expect. (that's what I get for having&lt;BR /&gt;
expectations!)&lt;BR /&gt;
&lt;BR /&gt;
I start with blank dwg&lt;BR /&gt;
create a box(3dsolid) at 0,0,0&lt;BR /&gt;
W = 3, L = 2, H = 4&lt;BR /&gt;
orbit to sw iso more or less to see the box and ucs icon&lt;BR /&gt;
&lt;BR /&gt;
'...heres a function to change to 'right side ucs'&lt;BR /&gt;
'...it should 'supposedly' change the current ucs (from world or ?) to right&lt;BR /&gt;
side ucs&lt;BR /&gt;
'... it then returns the new ucs object&lt;BR /&gt;
Function UcR() As AcadUCS&lt;BR /&gt;
    Dim Neworigin(0 To 2) As Double&lt;BR /&gt;
    ThisDrawing.Utility.GetPoint Neworigin, "Pick a point, El Cadilator!"&lt;BR /&gt;
'pick the lower right corner of box (world coord: 2,0,0)&lt;BR /&gt;
&lt;BR /&gt;
    Dim xAxisPoint(2) As Double&lt;BR /&gt;
    Dim YAxisPoint(2) As Double&lt;BR /&gt;
    Dim ucsObjR As AcadUCS&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
    xAxisPoint(0) = Neworigin(0): xAxisPoint(1) = Neworigin(1) + 1:&lt;BR /&gt;
xAxisPoint(2) = Neworigin(2)&lt;BR /&gt;
    YAxisPoint(0) = Neworigin(0): YAxisPoint(1) = Neworigin(1):&lt;BR /&gt;
YAxisPoint(2) = Neworigin(2) + 1&lt;BR /&gt;
&lt;BR /&gt;
    Set ucsObjR = ThisDrawing.UserCoordinateSystems.Add(Neworigin,&lt;BR /&gt;
xAxisPoint, YAxisPoint, "UCSRIGHT")&lt;BR /&gt;
    ThisDrawing.ActiveUCS = ucsObjR&lt;BR /&gt;
'when the ucs origin did not change to the origin I sent to the add method&lt;BR /&gt;
'i thought I could force it to move to the correct point with the next line&lt;BR /&gt;
but it did no good....&lt;BR /&gt;
    'ucsObj.origin = Neworigin&lt;BR /&gt;
'that line has no effect...(that I can see)&lt;BR /&gt;
&lt;BR /&gt;
    ThisDrawing.ActiveViewport.UCSIconOn = True&lt;BR /&gt;
    ThisDrawing.ActiveViewport.UCSIconAtOrigin = True&lt;BR /&gt;
'the next line seems like a bug to me....&lt;BR /&gt;
    'ThisDrawing.ActiveViewport = ThisDrawing.ActiveViewport&lt;BR /&gt;
' I would expect that command to move the ucs icon to the point I picked for&lt;BR /&gt;
new origin, instead it changes the ucs to world and zooms to a previous view&lt;BR /&gt;
'if I comment out that line, the ucs changes to right side but the ucs icon&lt;BR /&gt;
does not move to world 2,0,0 as it should according to the function above,&lt;BR /&gt;
but rather it stays at 0,0,0 and just rotates to the right side direction.&lt;BR /&gt;
...what am I not understanding???&lt;BR /&gt;
&lt;BR /&gt;
    Set UcR = ucsObjR&lt;BR /&gt;
End Function&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
...here's a sub to test the above&lt;BR /&gt;
Sub UCSMatrixTest2()&lt;BR /&gt;
    ' Define a new UCS and turn on the UCS icon at the origin.&lt;BR /&gt;
    Dim ucsObj As AcadUCS&lt;BR /&gt;
    Set ucsObj = UcR 'ucs right hand side&lt;BR /&gt;
&lt;BR /&gt;
'again this line, whether inside the function or out here, causes the ucs&lt;BR /&gt;
change to fail and the drawing to revert to world ucs&lt;BR /&gt;
    ThisDrawing.ActiveViewport = ThisDrawing.ActiveViewport&lt;BR /&gt;
&lt;BR /&gt;
    Dim TransMatrix As Variant&lt;BR /&gt;
    TransMatrix = GetUCSMatrix(ucsObj)&lt;BR /&gt;
    Dim strMsg As String&lt;BR /&gt;
&lt;BR /&gt;
    strMsg = "Ucs matrix is: " &amp;amp; vbCr&lt;BR /&gt;
&lt;BR /&gt;
    Dim i As Integer&lt;BR /&gt;
    Dim j As Integer&lt;BR /&gt;
&lt;BR /&gt;
'another weirdness (to me)&lt;BR /&gt;
'this line bombs with subscript out of range (even though it's not)&lt;BR /&gt;
'transmatrix has a lbound of 0 and ubound of 3&lt;BR /&gt;
'when i = 0 I get a subscript out of range&lt;BR /&gt;
    'For i = LBound(TransMatrix) To UBound(TransMatrix)&lt;BR /&gt;
&lt;BR /&gt;
    For i = 0 To 3&lt;BR /&gt;
&lt;BR /&gt;
'and likewise this line bombs like the above with subscript out of range&lt;BR /&gt;
'even though it's not!&lt;BR /&gt;
    'For j = LBound(TransMatrix(i)) To UBound(TransMatrix(i))&lt;BR /&gt;
&lt;BR /&gt;
'this hard code works and since I know the size of the matrix i guess that's&lt;BR /&gt;
ok, except I thought it was bad practice to hard code arbitrary values and&lt;BR /&gt;
it seems like I should be able to read the actual array size with lbound and&lt;BR /&gt;
ubound?!?&lt;BR /&gt;
    For j = 0 To 3&lt;BR /&gt;
&lt;BR /&gt;
    strMsg = strMsg &amp;amp; TransMatrix(i, j) &amp;amp; ", "&lt;BR /&gt;
    Next j&lt;BR /&gt;
    strMsg = strMsg &amp;amp; vbCr&lt;BR /&gt;
    Next i&lt;BR /&gt;
    MsgBox strMsg, vbOKOnly, "Ace Destruction Co. Ucs Matrix Report"&lt;BR /&gt;
&lt;BR /&gt;
End Sub</description>
      <pubDate>Mon, 03 Mar 2003 23:13:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/i-m-not-understanding-ucs-method/m-p/303134#M65378</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2003-03-03T23:13:06Z</dc:date>
    </item>
    <item>
      <title>Re: I'm not understanding ucs method!?!</title>
      <link>https://forums.autodesk.com/t5/vba-forum/i-m-not-understanding-ucs-method/m-p/303135#M65379</link>
      <description>Mark,  &lt;BR /&gt;&lt;BR /&gt;
  &lt;BR /&gt;&lt;BR /&gt;
I don't have time to try your code at the moment, but a couple of ideas spring to mind:  &lt;BR /&gt;&lt;BR /&gt;
  &lt;BR /&gt;&lt;BR /&gt;
&amp;gt; ThisDrawing.ActiveViewport = ThisDrawing.ActiveViewport  &lt;BR /&gt;&lt;BR /&gt;
&amp;gt; I would expect that command to move the ucs icon to the point I picked for new origin, instead it changes the ucs to world and zooms to a previous view  &lt;BR /&gt;&lt;BR /&gt;
My understanding is that this command only affects the view and not the UCS, so your origin could be set and facing where you want, but the view is from/to somewhere else.  &lt;BR /&gt;&lt;BR /&gt;
  &lt;BR /&gt;&lt;BR /&gt;
&amp;gt; the ucs changes to right side but the ucs icon does not move to world 2,0,0 as it should according to the function above, but rather it stays at 0,0,0 and just rotates to the right side direction  &lt;BR /&gt;&lt;BR /&gt;
I've noticed that sometimes AutoCAD "thinks" you won't see the origin icon properly if it puts it where it exists, so it puts it somewhere else and just rotates it correctly.  If you zoom out enough the icon jumps to the right spot.  This might be what's happening here.  &lt;BR /&gt;&lt;BR /&gt;
  &lt;BR /&gt;&lt;BR /&gt;
&amp;gt; For j = LBound(TransMatrix(i)) To UBound(TransMatrix(i))  &lt;BR /&gt;&lt;BR /&gt;
If you lookup the VBA Help for LBound you'll see there is an optional second parameter for using when there are multiple dimensions in an array.  Not sure if that is the entire problem here but I think it is at least part of it.  &lt;BR /&gt;&lt;BR /&gt;
  &lt;BR /&gt;&lt;BR /&gt;
Hope this helps.  &lt;BR /&gt;&lt;BR /&gt;
  &lt;BR /&gt;&lt;BR /&gt;
Regards  &lt;BR /&gt;&lt;BR /&gt;
  &lt;BR /&gt;&lt;BR /&gt;
Wayne Ivory  &lt;BR /&gt;&lt;BR /&gt;
IT Analyst Programmer  &lt;BR /&gt;&lt;BR /&gt;
Wespine Industries Pty Ltd  &lt;BR /&gt;</description>
      <pubDate>Tue, 04 Mar 2003 00:15:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/i-m-not-understanding-ucs-method/m-p/303135#M65379</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2003-03-04T00:15:50Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/vba-forum/i-m-not-understanding-ucs-method/m-p/303136#M65380</link>
      <description>An afterthought - LBound and UBound could fail if the TransMatrix Variant hasn't been initialised at the point where you're testing the bounds.  This seems unlikely since you said it works hardcoded, but it is something else to consider.  You could try doing a Debug.Print TypeName(TransMatrix) prior to the loop to see what you get.  &lt;BR /&gt;&lt;BR /&gt;
  &lt;BR /&gt;&lt;BR /&gt;
Regards  &lt;BR /&gt;&lt;BR /&gt;
  &lt;BR /&gt;&lt;BR /&gt;
Wayne</description>
      <pubDate>Tue, 04 Mar 2003 00:23:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/i-m-not-understanding-ucs-method/m-p/303136#M65380</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2003-03-04T00:23:12Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/vba-forum/i-m-not-understanding-ucs-method/m-p/303137#M65381</link>
      <description>&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;Hi Wayne,&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;Thanks for the ideas. I'll check them &lt;BR /&gt;
out&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;BLOCKQUOTE&gt;&lt;BR /&gt;
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px"&amp;gt;&lt;BR /&gt;
  &lt;DIV&gt;"wivory" &amp;lt;&lt;A&gt;&lt;BR /&gt;
  href="mailto:waynei@wespine.com"&amp;gt;waynei@wespine.com&lt;/A&gt;&amp;gt; wrote in message &lt;BR /&gt;
  &lt;A&gt;&lt;BR /&gt;
  href="news:f149f39.1@WebX.maYIadrTaRb"&amp;gt;news:f149f39.1@WebX.maYIadrTaRb&lt;/A&gt;...&lt;/DIV&gt;&lt;BR /&gt;
  &lt;DIV&gt;An afterthought - LBound and UBound could fail if the TransMatrix Variant &lt;BR /&gt;
  hasn't been initialised at the point where you're testing the bounds.&lt;/DIV&gt;&lt;BR /&gt;
  &lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
  &lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;at the point of error:&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
  &lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;a watch window shows the array to be an array of &lt;BR /&gt;
  four arrays, each with four elements and the tool tip shows the array is good &lt;BR /&gt;
  also,&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
  &lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;must be the other idea you said about another &lt;BR /&gt;
  parameter, i'll check it out&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
  &lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
  &lt;DIV&gt;&amp;nbsp;This seems unlikely since you said it works hardcoded, but it is &lt;BR /&gt;
  something else to consider. You could try doing a Debug.Print &lt;BR /&gt;
  TypeName(TransMatrix) prior to the loop to see what you get. &lt;BR /&gt;
  &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;Regards &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;Wayne&lt;/DIV&gt;&lt;BR /&gt;
  &lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
  &lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;do you agree that hardcoding is not the right way &lt;BR /&gt;
  to do it?&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
  &lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;do you work the night shift or are you on the &lt;BR /&gt;
  other side of the globe? england?&lt;/FONT&gt;&lt;/DIV&gt;&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Tue, 04 Mar 2003 01:59:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/i-m-not-understanding-ucs-method/m-p/303137#M65381</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2003-03-04T01:59:55Z</dc:date>
    </item>
    <item>
      <title>Re: I'm not understanding ucs method!?!</title>
      <link>https://forums.autodesk.com/t5/vba-forum/i-m-not-understanding-ucs-method/m-p/303138#M65382</link>
      <description>Who said programmers don't have a sense of humor?&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&amp;gt; , "Pick a point, El Cadilator!"</description>
      <pubDate>Tue, 04 Mar 2003 05:47:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/i-m-not-understanding-ucs-method/m-p/303138#M65382</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2003-03-04T05:47:09Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/vba-forum/i-m-not-understanding-ucs-method/m-p/303139#M65383</link>
      <description>Wayne's right.&lt;BR /&gt;
   LBound(TransMatrix(i))&lt;BR /&gt;
should be&lt;BR /&gt;
 LBound(TransMatrix, 2)  to get the second index ubound and lbound&lt;BR /&gt;
&lt;BR /&gt;
Also, your code would not run for me until i replaced&lt;BR /&gt;
GetUCSMatrix(ucsObj) with ucsObj.GetUCSMatrix&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
James</description>
      <pubDate>Tue, 04 Mar 2003 06:35:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/i-m-not-understanding-ucs-method/m-p/303139#M65383</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2003-03-04T06:35:07Z</dc:date>
    </item>
    <item>
      <title>Re: I'm not understanding ucs method!?!</title>
      <link>https://forums.autodesk.com/t5/vba-forum/i-m-not-understanding-ucs-method/m-p/303140#M65384</link>
      <description>The way you have your GetPoint set up is not setting the value of&lt;BR /&gt;
Neworigin -- instead it's being used as the base point, and the return value&lt;BR /&gt;
is being lost into the vacuum of VBA.  Try:&lt;BR /&gt;
&lt;BR /&gt;
   Dim Neworigin As Variant&lt;BR /&gt;
   Neworigin = ThisDrawing.Utility.GetPoint(, "Pick a point, El Cadilator!")&lt;BR /&gt;
&lt;BR /&gt;
    xAxisPoint = ...&lt;BR /&gt;
    YAxisPoint = ...&lt;BR /&gt;
&lt;BR /&gt;
    MsgBox "X: " &amp;amp; xAxisPoint(0) &amp;amp; ", " &amp;amp; xAxisPoint(1) &amp;amp; ", " &amp;amp;&lt;BR /&gt;
xAxisPoint(2) &amp;amp; vbCrLf &amp;amp; _&lt;BR /&gt;
           "Y: " &amp;amp; YAxisPoint(0) &amp;amp; ", " &amp;amp; YAxisPoint(1) &amp;amp; ", " &amp;amp;&lt;BR /&gt;
YAxisPoint(2)&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
James</description>
      <pubDate>Tue, 04 Mar 2003 06:45:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/i-m-not-understanding-ucs-method/m-p/303140#M65384</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2003-03-04T06:45:59Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/vba-forum/i-m-not-understanding-ucs-method/m-p/303141#M65385</link>
      <description>The following code moves and rotates the UCS icon to wherever I pick.  I'm&lt;BR /&gt;
not sure exactly which changes made the code seem to work for me now... it&lt;BR /&gt;
just decided to start working.&lt;BR /&gt;
&lt;BR /&gt;
Also, here's the UCS-related variables, in case it was changing one of those&lt;BR /&gt;
that made it work.&lt;BR /&gt;
&lt;BR /&gt;
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -&lt;BR /&gt;
Command: setvar&lt;BR /&gt;
Enter variable name or [?] &lt;UCSVP&gt;: ?&lt;BR /&gt;
&lt;BR /&gt;
Enter variable(s) to list &amp;lt;*&amp;gt;: ucs*&lt;BR /&gt;
&lt;BR /&gt;
UCSAXISANG        90&lt;BR /&gt;
UCSBASE           ""&lt;BR /&gt;
UCSFOLLOW         0&lt;BR /&gt;
UCSICON           3&lt;BR /&gt;
UCSNAME           "UCSRIGHT"                           (read only)&lt;BR /&gt;
UCSORG            0.0000,1.5000,4.0000                 (read only)&lt;BR /&gt;
UCSORTHO          1&lt;BR /&gt;
UCSVIEW           1&lt;BR /&gt;
UCSVP             1&lt;BR /&gt;
UCSXDIR           0.0000,1.0000,0.0000                 (read only)&lt;BR /&gt;
UCSYDIR           0.0000,0.0000,1.0000                 (read only)&lt;BR /&gt;
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -&lt;BR /&gt;
&lt;BR /&gt;
James&lt;BR /&gt;
&lt;BR /&gt;
Function UcRnew() As AcadUCS&lt;BR /&gt;
    Dim Neworigin As Variant&lt;BR /&gt;
    Neworigin = ThisDrawing.Utility.GetPoint(, "Pick a point, El&lt;BR /&gt;
Cadilator!")&lt;BR /&gt;
&lt;BR /&gt;
    Dim xAxisPoint(2) As Double&lt;BR /&gt;
    Dim YAxisPoint(2) As Double&lt;BR /&gt;
    Dim ucsObjR As AcadUCS&lt;BR /&gt;
&lt;BR /&gt;
    xAxisPoint(0) = Neworigin(0): xAxisPoint(1) = Neworigin(1) + 1:&lt;BR /&gt;
xAxisPoint(2) = Neworigin(2)&lt;BR /&gt;
    YAxisPoint(0) = Neworigin(0): YAxisPoint(1) = Neworigin(1):&lt;BR /&gt;
YAxisPoint(2) = Neworigin(2) + 1&lt;BR /&gt;
&lt;BR /&gt;
    Set ucsObjR = ThisDrawing.UserCoordinateSystems.Add(Neworigin,&lt;BR /&gt;
xAxisPoint, YAxisPoint, "UCSRIGHT")&lt;BR /&gt;
&lt;BR /&gt;
    ThisDrawing.ActiveUCS = ucsObjR&lt;BR /&gt;
&lt;BR /&gt;
    ThisDrawing.ActiveViewport.UCSIconOn = True&lt;BR /&gt;
    ThisDrawing.ActiveViewport.UCSIconAtOrigin = True&lt;BR /&gt;
&lt;BR /&gt;
    Set UcRnew = ucsObjR&lt;BR /&gt;
End Function&lt;BR /&gt;
&lt;BR /&gt;
Sub UCSMatrixTest2()&lt;BR /&gt;
    Dim ucsObj As AcadUCS&lt;BR /&gt;
    Set ucsObj = UcRnew&lt;BR /&gt;
    ThisDrawing.ActiveUCS = ucsObj&lt;BR /&gt;
&lt;BR /&gt;
    ThisDrawing.ActiveViewport = ThisDrawing.ActiveViewport&lt;BR /&gt;
&lt;BR /&gt;
End Sub&lt;/UCSVP&gt;</description>
      <pubDate>Tue, 04 Mar 2003 07:51:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/i-m-not-understanding-ucs-method/m-p/303141#M65385</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2003-03-04T07:51:58Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/vba-forum/i-m-not-understanding-ucs-method/m-p/303142#M65386</link>
      <description>Aha! Thank you James,&lt;BR /&gt;
&lt;BR /&gt;
That's how I had it at first, then I glanced at some help example and saw&lt;BR /&gt;
that point arg and my brain thought it was a byref arg getting set by the&lt;BR /&gt;
getpoint function (something like getxdata), DUH!!! DOUBLE DUH!!!&lt;BR /&gt;
&lt;BR /&gt;
Thanks for clearing the cobwebs.&lt;BR /&gt;
Mark&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
"James Belshan" &lt;BELSHAN_JL&gt; wrote in message&lt;BR /&gt;
news:23217ABB274C2BB23F7D109D96788EBE@in.WebX.maYIadrTaRb...&lt;BR /&gt;
&amp;gt; The way you have your GetPoint set up is not setting the value of&lt;BR /&gt;
&amp;gt; Neworigin -- instead it's being used as the base point, and the return&lt;BR /&gt;
value&lt;BR /&gt;
&amp;gt; is being lost into the vacuum of VBA.  Try:&lt;BR /&gt;
&lt;SNIP&gt;&lt;/SNIP&gt;&lt;/BELSHAN_JL&gt;</description>
      <pubDate>Tue, 04 Mar 2003 08:15:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/i-m-not-understanding-ucs-method/m-p/303142#M65386</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2003-03-04T08:15:19Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/vba-forum/i-m-not-understanding-ucs-method/m-p/303143#M65387</link>
      <description>fasculinating!&lt;BR /&gt;
I copy paste your code and if I comment out the one line&lt;BR /&gt;
&lt;BR /&gt;
&amp;gt;     ThisDrawing.ActiveViewport = ThisDrawing.ActiveViewport&lt;BR /&gt;
&lt;BR /&gt;
then it does move the ucs icon, but if I leave it in, it doesn't move it&lt;BR /&gt;
(actually it moves it really fast then back again - I can just see the flash&lt;BR /&gt;
of it changing position and returning)&lt;BR /&gt;
leaving the line in causes the icon to be greyed out and dimmed also!&lt;BR /&gt;
taking the line out causes the icon to be white as usual!&lt;BR /&gt;
the ucs direction does change, but the location of the icon stays at (or&lt;BR /&gt;
actually returns to) wcs 0,0,0&lt;BR /&gt;
in my case the ucs point reads:  id Specify point:  X = 0.0000     Y =&lt;BR /&gt;
0.0000     Z = -3.5200&lt;BR /&gt;
&lt;BR /&gt;
My sys vars are identical to yours.  Your code works exactly as mine does&lt;BR /&gt;
(once I fixed my getpoint - thanks to you).&lt;BR /&gt;
that one line is the buggaboo!?!&lt;BR /&gt;
weirdness rulsez!&lt;BR /&gt;
&lt;BR /&gt;
"James Belshan" &lt;BELSHAN_JL&gt; wrote in message&lt;BR /&gt;
news:7282E4B6B4758CAA1202D94103C15E9C@in.WebX.maYIadrTaRb...&lt;BR /&gt;
&amp;gt; The following code moves and rotates the UCS icon to wherever I pick.  I'm&lt;BR /&gt;
&amp;gt; not sure exactly which changes made the code seem to work for me now... it&lt;BR /&gt;
&amp;gt; just decided to start working.&lt;BR /&gt;
&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; End Sub&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;/BELSHAN_JL&gt;</description>
      <pubDate>Tue, 04 Mar 2003 08:36:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/i-m-not-understanding-ucs-method/m-p/303143#M65387</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2003-03-04T08:36:19Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/vba-forum/i-m-not-understanding-ucs-method/m-p/303144#M65388</link>
      <description>If I open up a new drawing, make a few 3d lines, and then run the VBA macro,&lt;BR /&gt;
I get exactly the behavior you're talking about, and it's that&lt;BR /&gt;
ActiveViewport line that makes the UCS icon move back and go gray.  So there&lt;BR /&gt;
must be some viewport setting that I changed in my first DWG file that&lt;BR /&gt;
allowed the ActiveViewport line to work.  If you really want to track it&lt;BR /&gt;
down I can send you the DWG that works OK with the ActiveVP line... or you&lt;BR /&gt;
can just comment out the line : ).&lt;BR /&gt;
&lt;BR /&gt;
James</description>
      <pubDate>Tue, 04 Mar 2003 11:10:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/i-m-not-understanding-ucs-method/m-p/303144#M65388</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2003-03-04T11:10:19Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/vba-forum/i-m-not-understanding-ucs-method/m-p/303145#M65389</link>
      <description>Hi James,&lt;BR /&gt;
&lt;BR /&gt;
I'm perfectly ok with commenting the line!&lt;BR /&gt;
:-) that's one less line to worry about!&lt;BR /&gt;
It's just my not knowing why that bugs me....doubt if I could figure it out&lt;BR /&gt;
from your dwg but what the heck, if you want to send it I might play around&lt;BR /&gt;
with it a little.&lt;BR /&gt;
mark at atreng dot com&lt;BR /&gt;
&lt;BR /&gt;
any way I appreciate your helping me out on this one.&lt;BR /&gt;
It seems like that line should be necessary, but since it's not ...who needs&lt;BR /&gt;
it?&lt;BR /&gt;
&lt;BR /&gt;
the more I think about it, the viewport is really independent of the ucs, I&lt;BR /&gt;
can be in any ucs while viewing from any one of an infinite number of&lt;BR /&gt;
viewpoints.  So maybe I'm incorrectly extrapolating from some vague help&lt;BR /&gt;
examples, and from that point of view the line shouldn't be necessary.  The&lt;BR /&gt;
viewport must be responding to it's target or direction or center when&lt;BR /&gt;
issuing a 'refresh' of the active viewport, and that wouldn't really have&lt;BR /&gt;
anything to do with the ucs.  Unless I issued a 'plan' command.&lt;BR /&gt;
&lt;BR /&gt;
thanks again,&lt;BR /&gt;
Mark&lt;BR /&gt;
&lt;BR /&gt;
"James Belshan" &lt;BELSHAN_JL&gt; wrote in message&lt;BR /&gt;
news:074BF2EBA7E8985A142F767BB4BBC171@in.WebX.maYIadrTaRb...&lt;BR /&gt;
&amp;gt; If I open up a new drawing, make a few 3d lines, and then run the VBA&lt;BR /&gt;
macro,&lt;BR /&gt;
&amp;gt; I get exactly the behavior you're talking about, and it's that&lt;/BELSHAN_JL&gt;</description>
      <pubDate>Tue, 04 Mar 2003 11:35:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/i-m-not-understanding-ucs-method/m-p/303145#M65389</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2003-03-04T11:35:38Z</dc:date>
    </item>
  </channel>
</rss>

