<?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 Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/camera-upvector/m-p/757642#M170555</link>
    <description>Kent,&lt;BR /&gt;
&lt;BR /&gt;
Using an entirely different approach, the following code WILL rotate your view 90 degrees&lt;BR /&gt;
around the X axis, but it is probably not exactly what you are looking for, nor how accurate&lt;BR /&gt;
it proves to be over continued use.&lt;BR /&gt;
&lt;BR /&gt;
Bob Schader&lt;BR /&gt;
&lt;BR /&gt;
Code snippet:&lt;BR /&gt;
'This is the number representing one degree&lt;BR /&gt;
' in Inventor's Camera.ComputeWithMouseInput Method&lt;BR /&gt;
' I figured this out by determining through experimentation&lt;BR /&gt;
' that 90 degrees is represented as 10 * pi&lt;BR /&gt;
Const rfactor As Double = 0.3490658504&lt;BR /&gt;
&lt;BR /&gt;
Public Sub RotX90()&lt;BR /&gt;
' This example simply rotates the view -90 degrees around x axis.&lt;BR /&gt;
' Change the rval1 value to get other rotations&lt;BR /&gt;
    Dim aView As View&lt;BR /&gt;
    Dim camera As camera&lt;BR /&gt;
    Dim FPoint As Point2d&lt;BR /&gt;
    Dim TPoint1 As Point2d 'rotation points&lt;BR /&gt;
    Dim rval1 As Double 'rotation values&lt;BR /&gt;
    Dim yval As Double&lt;BR /&gt;
    Dim oDoc As Document&lt;BR /&gt;
    Set oDoc = ThisApplication.ActiveDocument&lt;BR /&gt;
&lt;BR /&gt;
    rval1 = -90 * rfactor&lt;BR /&gt;
&lt;BR /&gt;
    Set FPoint = ThisApplication.TransientGeometry.CreatePoint2d(0, 0)&lt;BR /&gt;
    Set TPoint1 = ThisApplication.TransientGeometry.CreatePoint2d(0, rval1)&lt;BR /&gt;
    Set aView = ThisApplication.ActiveView&lt;BR /&gt;
    Set camera = aView.camera&lt;BR /&gt;
&lt;BR /&gt;
    camera.ComputeWithMouseInput FPoint, TPoint1, 0, kRotateViewOperation&lt;BR /&gt;
    camera.Fit&lt;BR /&gt;
    camera.Apply&lt;BR /&gt;
    aView.Update&lt;BR /&gt;
    ThisApplication.ActiveDocument.Update&lt;BR /&gt;
&lt;BR /&gt;
End Sub&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
"Kent Keller" &lt;KENT&gt; wrote in message news:8B0DB107941C183E37AC3ED61D927BD2@in.WebX.maYIadrTaRb...&lt;BR /&gt;
&amp;gt; Thanks Thilak&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; I have made a dialog that lists the Eye coords, the Target Coords and the UpVector coords&lt;BR /&gt;
&amp;gt; for any view that I click a button in.   This has helped a lot but from what I have seen I&lt;BR /&gt;
&amp;gt; am guessing there must be a way to use some sort of transformation matrix to deal with it&lt;BR /&gt;
&amp;gt; or??&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; What I am trying to do in one case is to mimic the way the view reacts if you click on a&lt;BR /&gt;
&amp;gt; edge of the Glass Box.  The right and left code below works if you are looking at the XY&lt;BR /&gt;
&amp;gt; plane, but any other plane and it doesn't   The up and down code has some problems I&lt;BR /&gt;
&amp;gt; haven't figured out yet, but I would guess if I found the problem it would also only be&lt;BR /&gt;
&amp;gt; valid when viewing from one direction.  What I am trying to do there is to rotate 90 on&lt;BR /&gt;
&amp;gt; the viewing X axis similar to in AutoCAD... UCS, X, 90,  Plan&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Often times after the line ocamera.UpVector = oNewUp the two sets of values don't match??&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; So is there a matrix I need to use, or do I have to try to map out every possibility for&lt;BR /&gt;
&amp;gt; the ortho views or ??&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Thanks for any help.&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;     Dim oView As View&lt;BR /&gt;
&amp;gt;     Set oView = oApp.ActiveView&lt;BR /&gt;
&amp;gt;     Dim ocamera As Camera&lt;BR /&gt;
&amp;gt;     Set ocamera = oView.Camera&lt;BR /&gt;
&amp;gt;     Dim oVect As UnitVector&lt;BR /&gt;
&amp;gt;     Set oVect = ocamera.UpVector&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;     Select Case Index&lt;BR /&gt;
&amp;gt;         Case 0  ' Spin Right&lt;BR /&gt;
&amp;gt;         Set oNewUp = oApp.TransientGeometry.CreateUnitVector( _&lt;BR /&gt;
&amp;gt;             ocamera.UpVector.Y, -ocamera.UpVector.X, ocamera.UpVector.Z)&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;         Case 1  ' Spin Left&lt;BR /&gt;
&amp;gt;         Set oNewUp = oApp.TransientGeometry.CreateUnitVector( _&lt;BR /&gt;
&amp;gt;             -ocamera.UpVector.Y, ocamera.UpVector.X, ocamera.UpVector.Z)&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;         Case 2  '  Up&lt;BR /&gt;
&amp;gt;         Set oNewUp = oApp.TransientGeometry.CreateUnitVector( _&lt;BR /&gt;
&amp;gt;             ocamera.UpVector.X, ocamera.UpVector.Z, -ocamera.UpVector.Y)&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;         Case 3  ' Down&lt;BR /&gt;
&amp;gt;         Set oNewUp = oApp.TransientGeometry.CreateUnitVector( _&lt;BR /&gt;
&amp;gt;             ocamera.UpVector.X, -ocamera.UpVector.Z, ocamera.UpVector.Y)&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;         Case Else&lt;BR /&gt;
&amp;gt;             Exit Sub&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;         End Select&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;     ocamera.UpVector = oNewUp&lt;BR /&gt;
&amp;gt;     ocamera.Apply&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; --&lt;BR /&gt;
&amp;gt; Kent&lt;BR /&gt;
&amp;gt; Assistant Moderator&lt;BR /&gt;
&amp;gt; Autodesk Discussion Forum Moderator Program&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; "raot" &lt;THILAKNR&gt; wrote in message&lt;BR /&gt;
&amp;gt; news:E1C3EC0BD2D49D424D2E90301AD9EF9C@in.WebX.maYIadrTaRb...&lt;BR /&gt;
&amp;gt; &amp;gt; Hi Kent,&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; Sometime back I began writing an article on handling views in Inventor&lt;BR /&gt;
&amp;gt; &amp;gt; through API but stalled it for&lt;BR /&gt;
&amp;gt; &amp;gt; a while as I got sucked into other activities.&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; UpVector is the vector that is vertical or rather that would be parallel to&lt;BR /&gt;
&amp;gt; &amp;gt; the left frame of the document window.&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; To understand it better:&lt;BR /&gt;
&amp;gt; &amp;gt; 1. Open any part file and switch to any isometric view.&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; 2. Use the following code to change the upvector:&lt;BR /&gt;
&amp;gt; &amp;gt; Sub test()&lt;BR /&gt;
&amp;gt; &amp;gt;     Dim ocam As Camera&lt;BR /&gt;
&amp;gt; &amp;gt;     Set ocam = ThisDocument.Views(1).Camera&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;     Dim ovec As UnitVector&lt;BR /&gt;
&amp;gt; &amp;gt;     Set ovec = ThisApplication.TransientGeometry.CreateUnitVector(0, 0, 1)&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;     ocam.UpVector = ovec&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;     ocam.Apply&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; End Sub&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; 3. The above code makes the Z axis (Blue) to be pointing vertically upwards.&lt;BR /&gt;
&amp;gt; &amp;gt; Similarly if you input (1,0,0) then X axis (Red) will be pointing vertically&lt;BR /&gt;
&amp;gt; &amp;gt; upwards.&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; You may try with various inputs.....such as (1,1,0)&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; cheers,&lt;BR /&gt;
&amp;gt; &amp;gt; thilak&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; "Kent Keller" &lt;KENT&gt; wrote in message&lt;BR /&gt;
&amp;gt; &amp;gt; news:736D07C3600E36A7BF882B5426497DDD@in.WebX.maYIadrTaRb...&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; I'm Back  8^)&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt;     I tried the basic code below  and it works for one Revolution, but&lt;BR /&gt;
&amp;gt; &amp;gt; then not the next.&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; If you manually rotate the view another 90 then the code works again.    I&lt;BR /&gt;
&amp;gt; &amp;gt; am guessing&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; what is happening is the UnitVector is seeing that it is going to be a&lt;BR /&gt;
&amp;gt; &amp;gt; impossible&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; coordinate so it errors.   I have tried setting the coordinates in a&lt;BR /&gt;
&amp;gt; &amp;gt; normal Vector first,&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; and then using it to supply the UnitVector with them all at once, but it&lt;BR /&gt;
&amp;gt; &amp;gt; says it is a type&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; mismatch.  I also tried making a dummy array and supplying that to the&lt;BR /&gt;
&amp;gt; &amp;gt; UnitVector but that&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; didn't work either.&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; So I am back to how do you rotate a view90º&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; Dim oUp As UnitVector&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; Set oUp = ocamera.UpVector&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; oUp.X = ocamera.UpVector.Y&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; oUp.Y = -ocamera.UpVector.X&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; oUp.Z = ocamera.UpVector.Z&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; ocamera.UpVector = oUp&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; ocamera.Apply&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; --&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; Kent&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; Assistant Moderator&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; Autodesk Discussion Forum Moderator Program&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
---&lt;BR /&gt;
Outgoing mail is certified Virus Free.&lt;BR /&gt;
Checked by AVG anti-virus system (http://www.grisoft.com).&lt;BR /&gt;
Version: 6.0.465 / Virus Database: 263 - Release Date: 3/25/2003&lt;/KENT&gt;&lt;/THILAKNR&gt;&lt;/KENT&gt;</description>
    <pubDate>Tue, 08 Apr 2003 10:57:24 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2003-04-08T10:57:24Z</dc:date>
    <item>
      <title>Camera UpVector</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/camera-upvector/m-p/757637#M170550</link>
      <description>I have been trying to figure out how the Camera UpVector works.    I started out with a&lt;BR /&gt;
straight on view of the XY plane.   Got the UpVector  XYZ settings, rotated 90CCW and got&lt;BR /&gt;
them again etc.   See below.  The first line is the XYZ values and the second is the&lt;BR /&gt;
ViewOrientation type.    You can see when I had gone a full 360 I have different values&lt;BR /&gt;
than what I started with.       I guess I don't get the whole concept.  I would have&lt;BR /&gt;
expected the value to be in radians and changing on the Z axis.&lt;BR /&gt;
&lt;BR /&gt;
Is there a  reasonably easy way to rotate a view 90º CW or CCW?  I can't come up with a&lt;BR /&gt;
good way just by looking at the existing values.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
0,1,0&lt;BR /&gt;
 10764&lt;BR /&gt;
&lt;BR /&gt;
1,2.22044604925031E-16,0&lt;BR /&gt;
 10763&lt;BR /&gt;
&lt;BR /&gt;
4.44089209850063E-16,-1,0&lt;BR /&gt;
 10763&lt;BR /&gt;
&lt;BR /&gt;
-1,-6.66133814775094E-16,0&lt;BR /&gt;
 10763&lt;BR /&gt;
&lt;BR /&gt;
-8.88178419700125E-16,1,0&lt;BR /&gt;
 10764&lt;BR /&gt;
&lt;BR /&gt;
1,1.11022302462516E-15,0&lt;BR /&gt;
 10763&lt;BR /&gt;
&lt;BR /&gt;
1.33226762955019E-15,-1,0&lt;BR /&gt;
 10763&lt;BR /&gt;
&lt;BR /&gt;
--&lt;BR /&gt;
Kent&lt;BR /&gt;
Assistant Moderator&lt;BR /&gt;
Autodesk Discussion Forum Moderator Program</description>
      <pubDate>Mon, 07 Apr 2003 12:54:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/camera-upvector/m-p/757637#M170550</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2003-04-07T12:54:28Z</dc:date>
    </item>
    <item>
      <title>Re: Camera UpVector</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/camera-upvector/m-p/757638#M170551</link>
      <description>Never mind... I think I got most of it sorted out... now if I can just figure out how to&lt;BR /&gt;
manipulate it.   8^)&lt;BR /&gt;
&lt;BR /&gt;
--&lt;BR /&gt;
Kent&lt;BR /&gt;
Assistant Moderator&lt;BR /&gt;
Autodesk Discussion Forum Moderator Program&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
"Kent Keller" &lt;KENT&gt; wrote in message&lt;BR /&gt;
news:3BE8B7A02ADC2F5ABE2A42D99A4F1EE0@in.WebX.maYIadrTaRb...&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; I have been trying to figure out how the Camera UpVector works.&lt;/KENT&gt;</description>
      <pubDate>Mon, 07 Apr 2003 13:11:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/camera-upvector/m-p/757638#M170551</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2003-04-07T13:11:42Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/camera-upvector/m-p/757639#M170552</link>
      <description>I'm Back  8^)&lt;BR /&gt;
&lt;BR /&gt;
    I tried the basic code below  and it works for one Revolution, but then not the next.&lt;BR /&gt;
If you manually rotate the view another 90 then the code works again.    I am guessing&lt;BR /&gt;
what is happening is the UnitVector is seeing that it is going to be a impossible&lt;BR /&gt;
coordinate so it errors.   I have tried setting the coordinates in a normal Vector first,&lt;BR /&gt;
and then using it to supply the UnitVector with them all at once, but it says it is a type&lt;BR /&gt;
mismatch.  I also tried making a dummy array and supplying that to the UnitVector but that&lt;BR /&gt;
didn't work either.&lt;BR /&gt;
&lt;BR /&gt;
So I am back to how do you rotate a view90º&lt;BR /&gt;
&lt;BR /&gt;
Dim oUp As UnitVector&lt;BR /&gt;
Set oUp = ocamera.UpVector&lt;BR /&gt;
oUp.X = ocamera.UpVector.Y&lt;BR /&gt;
oUp.Y = -ocamera.UpVector.X&lt;BR /&gt;
oUp.Z = ocamera.UpVector.Z&lt;BR /&gt;
&lt;BR /&gt;
ocamera.UpVector = oUp&lt;BR /&gt;
ocamera.Apply&lt;BR /&gt;
&lt;BR /&gt;
--&lt;BR /&gt;
Kent&lt;BR /&gt;
Assistant Moderator&lt;BR /&gt;
Autodesk Discussion Forum Moderator Program</description>
      <pubDate>Mon, 07 Apr 2003 14:23:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/camera-upvector/m-p/757639#M170552</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2003-04-07T14:23:20Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/camera-upvector/m-p/757640#M170553</link>
      <description>Hi Kent,&lt;BR /&gt;
&lt;BR /&gt;
Sometime back I began writing an article on handling views in Inventor&lt;BR /&gt;
through API but stalled it for&lt;BR /&gt;
a while as I got sucked into other activities.&lt;BR /&gt;
&lt;BR /&gt;
UpVector is the vector that is vertical or rather that would be parallel to&lt;BR /&gt;
the left frame of the document window.&lt;BR /&gt;
&lt;BR /&gt;
To understand it better:&lt;BR /&gt;
1. Open any part file and switch to any isometric view.&lt;BR /&gt;
&lt;BR /&gt;
2. Use the following code to change the upvector:&lt;BR /&gt;
Sub test()&lt;BR /&gt;
    Dim ocam As Camera&lt;BR /&gt;
    Set ocam = ThisDocument.Views(1).Camera&lt;BR /&gt;
&lt;BR /&gt;
    Dim ovec As UnitVector&lt;BR /&gt;
    Set ovec = ThisApplication.TransientGeometry.CreateUnitVector(0, 0, 1)&lt;BR /&gt;
&lt;BR /&gt;
    ocam.UpVector = ovec&lt;BR /&gt;
&lt;BR /&gt;
    ocam.Apply&lt;BR /&gt;
&lt;BR /&gt;
End Sub&lt;BR /&gt;
&lt;BR /&gt;
3. The above code makes the Z axis (Blue) to be pointing vertically upwards.&lt;BR /&gt;
Similarly if you input (1,0,0) then X axis (Red) will be pointing vertically&lt;BR /&gt;
upwards.&lt;BR /&gt;
&lt;BR /&gt;
You may try with various inputs.....such as (1,1,0)&lt;BR /&gt;
&lt;BR /&gt;
cheers,&lt;BR /&gt;
thilak&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
"Kent Keller" &lt;KENT&gt; wrote in message&lt;BR /&gt;
news:736D07C3600E36A7BF882B5426497DDD@in.WebX.maYIadrTaRb...&lt;BR /&gt;
&amp;gt; I'm Back  8^)&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;     I tried the basic code below  and it works for one Revolution, but&lt;BR /&gt;
then not the next.&lt;BR /&gt;
&amp;gt; If you manually rotate the view another 90 then the code works again.    I&lt;BR /&gt;
am guessing&lt;BR /&gt;
&amp;gt; what is happening is the UnitVector is seeing that it is going to be a&lt;BR /&gt;
impossible&lt;BR /&gt;
&amp;gt; coordinate so it errors.   I have tried setting the coordinates in a&lt;BR /&gt;
normal Vector first,&lt;BR /&gt;
&amp;gt; and then using it to supply the UnitVector with them all at once, but it&lt;BR /&gt;
says it is a type&lt;BR /&gt;
&amp;gt; mismatch.  I also tried making a dummy array and supplying that to the&lt;BR /&gt;
UnitVector but that&lt;BR /&gt;
&amp;gt; didn't work either.&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; So I am back to how do you rotate a view90º&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Dim oUp As UnitVector&lt;BR /&gt;
&amp;gt; Set oUp = ocamera.UpVector&lt;BR /&gt;
&amp;gt; oUp.X = ocamera.UpVector.Y&lt;BR /&gt;
&amp;gt; oUp.Y = -ocamera.UpVector.X&lt;BR /&gt;
&amp;gt; oUp.Z = ocamera.UpVector.Z&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; ocamera.UpVector = oUp&lt;BR /&gt;
&amp;gt; ocamera.Apply&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; --&lt;BR /&gt;
&amp;gt; Kent&lt;BR /&gt;
&amp;gt; Assistant Moderator&lt;BR /&gt;
&amp;gt; Autodesk Discussion Forum Moderator Program&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;/KENT&gt;</description>
      <pubDate>Mon, 07 Apr 2003 23:16:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/camera-upvector/m-p/757640#M170553</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2003-04-07T23:16:58Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/camera-upvector/m-p/757641#M170554</link>
      <description>Thanks Thilak&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
I have made a dialog that lists the Eye coords, the Target Coords and the UpVector coords&lt;BR /&gt;
for any view that I click a button in.   This has helped a lot but from what I have seen I&lt;BR /&gt;
am guessing there must be a way to use some sort of transformation matrix to deal with it&lt;BR /&gt;
or??&lt;BR /&gt;
&lt;BR /&gt;
What I am trying to do in one case is to mimic the way the view reacts if you click on a&lt;BR /&gt;
edge of the Glass Box.  The right and left code below works if you are looking at the XY&lt;BR /&gt;
plane, but any other plane and it doesn't   The up and down code has some problems I&lt;BR /&gt;
haven't figured out yet, but I would guess if I found the problem it would also only be&lt;BR /&gt;
valid when viewing from one direction.  What I am trying to do there is to rotate 90 on&lt;BR /&gt;
the viewing X axis similar to in AutoCAD... UCS, X, 90,  Plan&lt;BR /&gt;
&lt;BR /&gt;
Often times after the line ocamera.UpVector = oNewUp the two sets of values don't match??&lt;BR /&gt;
&lt;BR /&gt;
So is there a matrix I need to use, or do I have to try to map out every possibility for&lt;BR /&gt;
the ortho views or ??&lt;BR /&gt;
&lt;BR /&gt;
Thanks for any help.&lt;BR /&gt;
&lt;BR /&gt;
    Dim oView As View&lt;BR /&gt;
    Set oView = oApp.ActiveView&lt;BR /&gt;
    Dim ocamera As Camera&lt;BR /&gt;
    Set ocamera = oView.Camera&lt;BR /&gt;
    Dim oVect As UnitVector&lt;BR /&gt;
    Set oVect = ocamera.UpVector&lt;BR /&gt;
&lt;BR /&gt;
    Select Case Index&lt;BR /&gt;
        Case 0  ' Spin Right&lt;BR /&gt;
        Set oNewUp = oApp.TransientGeometry.CreateUnitVector( _&lt;BR /&gt;
            ocamera.UpVector.Y, -ocamera.UpVector.X, ocamera.UpVector.Z)&lt;BR /&gt;
&lt;BR /&gt;
        Case 1  ' Spin Left&lt;BR /&gt;
        Set oNewUp = oApp.TransientGeometry.CreateUnitVector( _&lt;BR /&gt;
            -ocamera.UpVector.Y, ocamera.UpVector.X, ocamera.UpVector.Z)&lt;BR /&gt;
&lt;BR /&gt;
        Case 2  '  Up&lt;BR /&gt;
        Set oNewUp = oApp.TransientGeometry.CreateUnitVector( _&lt;BR /&gt;
            ocamera.UpVector.X, ocamera.UpVector.Z, -ocamera.UpVector.Y)&lt;BR /&gt;
&lt;BR /&gt;
        Case 3  ' Down&lt;BR /&gt;
        Set oNewUp = oApp.TransientGeometry.CreateUnitVector( _&lt;BR /&gt;
            ocamera.UpVector.X, -ocamera.UpVector.Z, ocamera.UpVector.Y)&lt;BR /&gt;
&lt;BR /&gt;
        Case Else&lt;BR /&gt;
            Exit Sub&lt;BR /&gt;
&lt;BR /&gt;
        End Select&lt;BR /&gt;
&lt;BR /&gt;
    ocamera.UpVector = oNewUp&lt;BR /&gt;
    ocamera.Apply&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
--&lt;BR /&gt;
Kent&lt;BR /&gt;
Assistant Moderator&lt;BR /&gt;
Autodesk Discussion Forum Moderator Program&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
"raot" &lt;THILAKNR&gt; wrote in message&lt;BR /&gt;
news:E1C3EC0BD2D49D424D2E90301AD9EF9C@in.WebX.maYIadrTaRb...&lt;BR /&gt;
&amp;gt; Hi Kent,&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Sometime back I began writing an article on handling views in Inventor&lt;BR /&gt;
&amp;gt; through API but stalled it for&lt;BR /&gt;
&amp;gt; a while as I got sucked into other activities.&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; UpVector is the vector that is vertical or rather that would be parallel to&lt;BR /&gt;
&amp;gt; the left frame of the document window.&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; To understand it better:&lt;BR /&gt;
&amp;gt; 1. Open any part file and switch to any isometric view.&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; 2. Use the following code to change the upvector:&lt;BR /&gt;
&amp;gt; Sub test()&lt;BR /&gt;
&amp;gt;     Dim ocam As Camera&lt;BR /&gt;
&amp;gt;     Set ocam = ThisDocument.Views(1).Camera&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;     Dim ovec As UnitVector&lt;BR /&gt;
&amp;gt;     Set ovec = ThisApplication.TransientGeometry.CreateUnitVector(0, 0, 1)&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;     ocam.UpVector = ovec&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;     ocam.Apply&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; End Sub&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; 3. The above code makes the Z axis (Blue) to be pointing vertically upwards.&lt;BR /&gt;
&amp;gt; Similarly if you input (1,0,0) then X axis (Red) will be pointing vertically&lt;BR /&gt;
&amp;gt; upwards.&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; You may try with various inputs.....such as (1,1,0)&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; cheers,&lt;BR /&gt;
&amp;gt; thilak&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; "Kent Keller" &lt;KENT&gt; wrote in message&lt;BR /&gt;
&amp;gt; news:736D07C3600E36A7BF882B5426497DDD@in.WebX.maYIadrTaRb...&lt;BR /&gt;
&amp;gt; &amp;gt; I'm Back  8^)&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;     I tried the basic code below  and it works for one Revolution, but&lt;BR /&gt;
&amp;gt; then not the next.&lt;BR /&gt;
&amp;gt; &amp;gt; If you manually rotate the view another 90 then the code works again.    I&lt;BR /&gt;
&amp;gt; am guessing&lt;BR /&gt;
&amp;gt; &amp;gt; what is happening is the UnitVector is seeing that it is going to be a&lt;BR /&gt;
&amp;gt; impossible&lt;BR /&gt;
&amp;gt; &amp;gt; coordinate so it errors.   I have tried setting the coordinates in a&lt;BR /&gt;
&amp;gt; normal Vector first,&lt;BR /&gt;
&amp;gt; &amp;gt; and then using it to supply the UnitVector with them all at once, but it&lt;BR /&gt;
&amp;gt; says it is a type&lt;BR /&gt;
&amp;gt; &amp;gt; mismatch.  I also tried making a dummy array and supplying that to the&lt;BR /&gt;
&amp;gt; UnitVector but that&lt;BR /&gt;
&amp;gt; &amp;gt; didn't work either.&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; So I am back to how do you rotate a view90º&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; Dim oUp As UnitVector&lt;BR /&gt;
&amp;gt; &amp;gt; Set oUp = ocamera.UpVector&lt;BR /&gt;
&amp;gt; &amp;gt; oUp.X = ocamera.UpVector.Y&lt;BR /&gt;
&amp;gt; &amp;gt; oUp.Y = -ocamera.UpVector.X&lt;BR /&gt;
&amp;gt; &amp;gt; oUp.Z = ocamera.UpVector.Z&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; ocamera.UpVector = oUp&lt;BR /&gt;
&amp;gt; &amp;gt; ocamera.Apply&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; --&lt;BR /&gt;
&amp;gt; &amp;gt; Kent&lt;BR /&gt;
&amp;gt; &amp;gt; Assistant Moderator&lt;BR /&gt;
&amp;gt; &amp;gt; Autodesk Discussion Forum Moderator Program&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;/KENT&gt;&lt;/THILAKNR&gt;</description>
      <pubDate>Tue, 08 Apr 2003 08:59:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/camera-upvector/m-p/757641#M170554</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2003-04-08T08:59:52Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/camera-upvector/m-p/757642#M170555</link>
      <description>Kent,&lt;BR /&gt;
&lt;BR /&gt;
Using an entirely different approach, the following code WILL rotate your view 90 degrees&lt;BR /&gt;
around the X axis, but it is probably not exactly what you are looking for, nor how accurate&lt;BR /&gt;
it proves to be over continued use.&lt;BR /&gt;
&lt;BR /&gt;
Bob Schader&lt;BR /&gt;
&lt;BR /&gt;
Code snippet:&lt;BR /&gt;
'This is the number representing one degree&lt;BR /&gt;
' in Inventor's Camera.ComputeWithMouseInput Method&lt;BR /&gt;
' I figured this out by determining through experimentation&lt;BR /&gt;
' that 90 degrees is represented as 10 * pi&lt;BR /&gt;
Const rfactor As Double = 0.3490658504&lt;BR /&gt;
&lt;BR /&gt;
Public Sub RotX90()&lt;BR /&gt;
' This example simply rotates the view -90 degrees around x axis.&lt;BR /&gt;
' Change the rval1 value to get other rotations&lt;BR /&gt;
    Dim aView As View&lt;BR /&gt;
    Dim camera As camera&lt;BR /&gt;
    Dim FPoint As Point2d&lt;BR /&gt;
    Dim TPoint1 As Point2d 'rotation points&lt;BR /&gt;
    Dim rval1 As Double 'rotation values&lt;BR /&gt;
    Dim yval As Double&lt;BR /&gt;
    Dim oDoc As Document&lt;BR /&gt;
    Set oDoc = ThisApplication.ActiveDocument&lt;BR /&gt;
&lt;BR /&gt;
    rval1 = -90 * rfactor&lt;BR /&gt;
&lt;BR /&gt;
    Set FPoint = ThisApplication.TransientGeometry.CreatePoint2d(0, 0)&lt;BR /&gt;
    Set TPoint1 = ThisApplication.TransientGeometry.CreatePoint2d(0, rval1)&lt;BR /&gt;
    Set aView = ThisApplication.ActiveView&lt;BR /&gt;
    Set camera = aView.camera&lt;BR /&gt;
&lt;BR /&gt;
    camera.ComputeWithMouseInput FPoint, TPoint1, 0, kRotateViewOperation&lt;BR /&gt;
    camera.Fit&lt;BR /&gt;
    camera.Apply&lt;BR /&gt;
    aView.Update&lt;BR /&gt;
    ThisApplication.ActiveDocument.Update&lt;BR /&gt;
&lt;BR /&gt;
End Sub&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
"Kent Keller" &lt;KENT&gt; wrote in message news:8B0DB107941C183E37AC3ED61D927BD2@in.WebX.maYIadrTaRb...&lt;BR /&gt;
&amp;gt; Thanks Thilak&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; I have made a dialog that lists the Eye coords, the Target Coords and the UpVector coords&lt;BR /&gt;
&amp;gt; for any view that I click a button in.   This has helped a lot but from what I have seen I&lt;BR /&gt;
&amp;gt; am guessing there must be a way to use some sort of transformation matrix to deal with it&lt;BR /&gt;
&amp;gt; or??&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; What I am trying to do in one case is to mimic the way the view reacts if you click on a&lt;BR /&gt;
&amp;gt; edge of the Glass Box.  The right and left code below works if you are looking at the XY&lt;BR /&gt;
&amp;gt; plane, but any other plane and it doesn't   The up and down code has some problems I&lt;BR /&gt;
&amp;gt; haven't figured out yet, but I would guess if I found the problem it would also only be&lt;BR /&gt;
&amp;gt; valid when viewing from one direction.  What I am trying to do there is to rotate 90 on&lt;BR /&gt;
&amp;gt; the viewing X axis similar to in AutoCAD... UCS, X, 90,  Plan&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Often times after the line ocamera.UpVector = oNewUp the two sets of values don't match??&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; So is there a matrix I need to use, or do I have to try to map out every possibility for&lt;BR /&gt;
&amp;gt; the ortho views or ??&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Thanks for any help.&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;     Dim oView As View&lt;BR /&gt;
&amp;gt;     Set oView = oApp.ActiveView&lt;BR /&gt;
&amp;gt;     Dim ocamera As Camera&lt;BR /&gt;
&amp;gt;     Set ocamera = oView.Camera&lt;BR /&gt;
&amp;gt;     Dim oVect As UnitVector&lt;BR /&gt;
&amp;gt;     Set oVect = ocamera.UpVector&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;     Select Case Index&lt;BR /&gt;
&amp;gt;         Case 0  ' Spin Right&lt;BR /&gt;
&amp;gt;         Set oNewUp = oApp.TransientGeometry.CreateUnitVector( _&lt;BR /&gt;
&amp;gt;             ocamera.UpVector.Y, -ocamera.UpVector.X, ocamera.UpVector.Z)&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;         Case 1  ' Spin Left&lt;BR /&gt;
&amp;gt;         Set oNewUp = oApp.TransientGeometry.CreateUnitVector( _&lt;BR /&gt;
&amp;gt;             -ocamera.UpVector.Y, ocamera.UpVector.X, ocamera.UpVector.Z)&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;         Case 2  '  Up&lt;BR /&gt;
&amp;gt;         Set oNewUp = oApp.TransientGeometry.CreateUnitVector( _&lt;BR /&gt;
&amp;gt;             ocamera.UpVector.X, ocamera.UpVector.Z, -ocamera.UpVector.Y)&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;         Case 3  ' Down&lt;BR /&gt;
&amp;gt;         Set oNewUp = oApp.TransientGeometry.CreateUnitVector( _&lt;BR /&gt;
&amp;gt;             ocamera.UpVector.X, -ocamera.UpVector.Z, ocamera.UpVector.Y)&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;         Case Else&lt;BR /&gt;
&amp;gt;             Exit Sub&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;         End Select&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;     ocamera.UpVector = oNewUp&lt;BR /&gt;
&amp;gt;     ocamera.Apply&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; --&lt;BR /&gt;
&amp;gt; Kent&lt;BR /&gt;
&amp;gt; Assistant Moderator&lt;BR /&gt;
&amp;gt; Autodesk Discussion Forum Moderator Program&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; "raot" &lt;THILAKNR&gt; wrote in message&lt;BR /&gt;
&amp;gt; news:E1C3EC0BD2D49D424D2E90301AD9EF9C@in.WebX.maYIadrTaRb...&lt;BR /&gt;
&amp;gt; &amp;gt; Hi Kent,&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; Sometime back I began writing an article on handling views in Inventor&lt;BR /&gt;
&amp;gt; &amp;gt; through API but stalled it for&lt;BR /&gt;
&amp;gt; &amp;gt; a while as I got sucked into other activities.&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; UpVector is the vector that is vertical or rather that would be parallel to&lt;BR /&gt;
&amp;gt; &amp;gt; the left frame of the document window.&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; To understand it better:&lt;BR /&gt;
&amp;gt; &amp;gt; 1. Open any part file and switch to any isometric view.&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; 2. Use the following code to change the upvector:&lt;BR /&gt;
&amp;gt; &amp;gt; Sub test()&lt;BR /&gt;
&amp;gt; &amp;gt;     Dim ocam As Camera&lt;BR /&gt;
&amp;gt; &amp;gt;     Set ocam = ThisDocument.Views(1).Camera&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;     Dim ovec As UnitVector&lt;BR /&gt;
&amp;gt; &amp;gt;     Set ovec = ThisApplication.TransientGeometry.CreateUnitVector(0, 0, 1)&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;     ocam.UpVector = ovec&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;     ocam.Apply&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; End Sub&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; 3. The above code makes the Z axis (Blue) to be pointing vertically upwards.&lt;BR /&gt;
&amp;gt; &amp;gt; Similarly if you input (1,0,0) then X axis (Red) will be pointing vertically&lt;BR /&gt;
&amp;gt; &amp;gt; upwards.&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; You may try with various inputs.....such as (1,1,0)&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; cheers,&lt;BR /&gt;
&amp;gt; &amp;gt; thilak&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; "Kent Keller" &lt;KENT&gt; wrote in message&lt;BR /&gt;
&amp;gt; &amp;gt; news:736D07C3600E36A7BF882B5426497DDD@in.WebX.maYIadrTaRb...&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; I'm Back  8^)&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt;     I tried the basic code below  and it works for one Revolution, but&lt;BR /&gt;
&amp;gt; &amp;gt; then not the next.&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; If you manually rotate the view another 90 then the code works again.    I&lt;BR /&gt;
&amp;gt; &amp;gt; am guessing&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; what is happening is the UnitVector is seeing that it is going to be a&lt;BR /&gt;
&amp;gt; &amp;gt; impossible&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; coordinate so it errors.   I have tried setting the coordinates in a&lt;BR /&gt;
&amp;gt; &amp;gt; normal Vector first,&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; and then using it to supply the UnitVector with them all at once, but it&lt;BR /&gt;
&amp;gt; &amp;gt; says it is a type&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; mismatch.  I also tried making a dummy array and supplying that to the&lt;BR /&gt;
&amp;gt; &amp;gt; UnitVector but that&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; didn't work either.&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; So I am back to how do you rotate a view90º&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; Dim oUp As UnitVector&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; Set oUp = ocamera.UpVector&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; oUp.X = ocamera.UpVector.Y&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; oUp.Y = -ocamera.UpVector.X&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; oUp.Z = ocamera.UpVector.Z&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; ocamera.UpVector = oUp&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; ocamera.Apply&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; --&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; Kent&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; Assistant Moderator&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; Autodesk Discussion Forum Moderator Program&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
---&lt;BR /&gt;
Outgoing mail is certified Virus Free.&lt;BR /&gt;
Checked by AVG anti-virus system (http://www.grisoft.com).&lt;BR /&gt;
Version: 6.0.465 / Virus Database: 263 - Release Date: 3/25/2003&lt;/KENT&gt;&lt;/THILAKNR&gt;&lt;/KENT&gt;</description>
      <pubDate>Tue, 08 Apr 2003 10:57:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/camera-upvector/m-p/757642#M170555</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2003-04-08T10:57:24Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/camera-upvector/m-p/757643#M170556</link>
      <description>Actually, I should clarify that the code I posted rotates the view around the current&lt;BR /&gt;
SCREEN or "VIEW" X axis, not the "UCS" axis.&lt;BR /&gt;
Bob&lt;BR /&gt;
&lt;BR /&gt;
"Bob Schader" &lt;BOB&gt; wrote in message news:016E5DC1A1F13537A9A7BE006B136330@in.WebX.maYIadrTaRb...&lt;BR /&gt;
&amp;gt; Kent,&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Using an entirely different approach, the following code WILL rotate your view 90 degrees&lt;BR /&gt;
&amp;gt; around the X axis, but it is probably not exactly what you are looking for, nor how accurate&lt;BR /&gt;
&amp;gt; it proves to be over continued use.&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
---&lt;BR /&gt;
Outgoing mail is certified Virus Free.&lt;BR /&gt;
Checked by AVG anti-virus system (http://www.grisoft.com).&lt;BR /&gt;
Version: 6.0.465 / Virus Database: 263 - Release Date: 3/25/2003&lt;/BOB&gt;</description>
      <pubDate>Tue, 08 Apr 2003 11:02:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/camera-upvector/m-p/757643#M170556</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2003-04-08T11:02:47Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/camera-upvector/m-p/757644#M170557</link>
      <description>Hi Bob&lt;BR /&gt;
&lt;BR /&gt;
I (along with some help)  was able to come up with this that seems to work pretty well at&lt;BR /&gt;
least in VBA code.  I just tried to transfer it to my addin, and it is whacking out the&lt;BR /&gt;
view??  Fun and games.&lt;BR /&gt;
&lt;BR /&gt;
Private Sub cmdLeft_Click()&lt;BR /&gt;
&lt;BR /&gt;
Dim oview As View&lt;BR /&gt;
Set oview = ThisApplication.ActiveView&lt;BR /&gt;
Dim ocamera As Camera&lt;BR /&gt;
Set ocamera = oview.Camera&lt;BR /&gt;
&lt;BR /&gt;
Dim oCamVect As UnitVector&lt;BR /&gt;
&lt;BR /&gt;
Set oCamVect = ThisApplication.TransientGeometry.CreateUnitVector( _&lt;BR /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ocamera.Eye.x - ocamera.Target.x, ocamera.Eye.Y - ocamera.Target.Y,&lt;BR /&gt;
ocamera.Eye.Z - ocamera.Target.Z)&lt;BR /&gt;
&lt;BR /&gt;
ocamera.UpVector = ocamera.UpVector.CrossProduct(oCamVect)&lt;BR /&gt;
ocamera.Apply&lt;BR /&gt;
&lt;BR /&gt;
End Sub&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
--&lt;BR /&gt;
Kent&lt;BR /&gt;
Assistant Moderator&lt;BR /&gt;
Autodesk Discussion Forum Moderator Program&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
"Bob Schader" &lt;BOB&gt; wrote in message&lt;BR /&gt;
news:016E5DC1A1F13537A9A7BE006B136330@in.WebX.maYIadrTaRb...&lt;BR /&gt;
&amp;gt; Kent,&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Using an entirely different approach, the following code WILL rotate your view 90&lt;BR /&gt;
degrees&lt;/BOB&gt;</description>
      <pubDate>Tue, 08 Apr 2003 11:34:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/camera-upvector/m-p/757644#M170557</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2003-04-08T11:34:06Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/camera-upvector/m-p/757645#M170558</link>
      <description>Somehow I have gotten most of what I want to work.    One thing left that is giving me&lt;BR /&gt;
some trouble is how do I reset the target to the middle of the screen? similar to how the&lt;BR /&gt;
rotate tool does when you left click inside it.&lt;BR /&gt;
&lt;BR /&gt;
If I make a cube way away from the origin, .. turn on the origin point and then do a zoom&lt;BR /&gt;
extents, and finally zoom in on my part when I rotate it it fly's off in space because the&lt;BR /&gt;
target is still some point I presume somewhere between the origin point and my cube.   If&lt;BR /&gt;
I do the same steps but before running my routine I use the rotate toolbutton and recenter&lt;BR /&gt;
the view, then I rotate nicely around my part.    So how do I mimic that or how do I set&lt;BR /&gt;
the Target to the center of the viewing screen?&lt;BR /&gt;
&lt;BR /&gt;
--&lt;BR /&gt;
Kent&lt;BR /&gt;
Assistant Moderator&lt;BR /&gt;
Autodesk Discussion Forum Moderator Program</description>
      <pubDate>Tue, 08 Apr 2003 14:04:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/camera-upvector/m-p/757645#M170558</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2003-04-08T14:04:36Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/camera-upvector/m-p/757646#M170559</link>
      <description>I'm still trying to learn VBA, but can you get the window extents and then&lt;BR /&gt;
calculate the center from that? I found this in the Help file:&lt;BR /&gt;
&lt;BR /&gt;
Method that returns the current size and position of the view's window.&lt;BR /&gt;
&lt;BR /&gt;
Syntax&lt;BR /&gt;
GetWindowExtents(&lt;BR /&gt;
Top As Long,&lt;BR /&gt;
Left As Long,&lt;BR /&gt;
height As Long,&lt;BR /&gt;
width As Long)&lt;BR /&gt;
&lt;BR /&gt;
Top Output Long that contains the position of the top of the window. The&lt;BR /&gt;
value returned is in pixels relative to screen space.&lt;BR /&gt;
&lt;BR /&gt;
Left Output Long that contains the position of the left of the window. The&lt;BR /&gt;
value returned is in pixels relative to screen space.&lt;BR /&gt;
&lt;BR /&gt;
height Output Long that contains the height of the window. The value&lt;BR /&gt;
returned is in pixels.&lt;BR /&gt;
&lt;BR /&gt;
width Output Long that contains the width of the window. The value returned&lt;BR /&gt;
is in pixels.</description>
      <pubDate>Wed, 09 Apr 2003 06:01:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/camera-upvector/m-p/757646#M170559</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2003-04-09T06:01:05Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/camera-upvector/m-p/757647#M170560</link>
      <description>Hi Mike&lt;BR /&gt;
&lt;BR /&gt;
    Thanks, but I believe that is just the overall size of the window, and doesn't have&lt;BR /&gt;
much to do with where in space the window is looking.&lt;BR /&gt;
&lt;BR /&gt;
    One of the things I have noticed is that if I do a mouse wheel zoom the target doesn't&lt;BR /&gt;
get reset to the view, but if I use the zoom toolbutton it does.  Just need to figure out&lt;BR /&gt;
how to do that reset in code. 8^)&lt;BR /&gt;
&lt;BR /&gt;
--&lt;BR /&gt;
Kent&lt;BR /&gt;
Assistant Moderator&lt;BR /&gt;
Autodesk Discussion Forum Moderator Program&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
"Mike Maenpaa" &lt;REMOVE__THISMIKE.MAENPAA&gt; wrote in message&lt;BR /&gt;
news:535B00513C57D65594F272AC8D1D4F19@in.WebX.maYIadrTaRb...&lt;BR /&gt;
&amp;gt; I'm still trying to learn VBA, but can you get the window extents and then&lt;BR /&gt;
&amp;gt; calculate the center from that? I found this in the Help file:&lt;/REMOVE__THISMIKE.MAENPAA&gt;</description>
      <pubDate>Wed, 09 Apr 2003 07:25:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/camera-upvector/m-p/757647#M170560</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2003-04-09T07:25:19Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/camera-upvector/m-p/757648#M170561</link>
      <description>Here's some code that will handle the general case of rotating the camera&lt;BR /&gt;
any specified angle.  The first Sub is used to test the UpVectorRotate&lt;BR /&gt;
function which does all of the work.  Hopefully this will help.&lt;BR /&gt;
&lt;BR /&gt;
Public Sub RotateTest()&lt;BR /&gt;
    ' Define Pi.&lt;BR /&gt;
    Dim Pi As Double&lt;BR /&gt;
    Pi = 3.14159265358979&lt;BR /&gt;
&lt;BR /&gt;
    ' Rotate the camera 90 degrees using transition type of apply&lt;BR /&gt;
    Dim oCamera As Camera&lt;BR /&gt;
    Set oCamera = ThisApplication.ActiveView.Camera&lt;BR /&gt;
    Call UpVectorRotate(oCamera, Pi / 2)&lt;BR /&gt;
    oCamera.Apply&lt;BR /&gt;
&lt;BR /&gt;
    ' Rotate another 90 degrees.&lt;BR /&gt;
    Call UpVectorRotate(oCamera, Pi / 2)&lt;BR /&gt;
    oCamera.Apply&lt;BR /&gt;
&lt;BR /&gt;
    ' Rotate another 90 degrees.&lt;BR /&gt;
    Call UpVectorRotate(oCamera, Pi / 2)&lt;BR /&gt;
    oCamera.Apply&lt;BR /&gt;
&lt;BR /&gt;
    ' Rotate the camera in 10 degree increments a full 360 degrees.&lt;BR /&gt;
    ' This applies without a transition so the camera jumps right&lt;BR /&gt;
    ' to the position defined.&lt;BR /&gt;
    Dim i As Long&lt;BR /&gt;
    For i = 1 To 36&lt;BR /&gt;
        Call UpVectorRotate(oCamera, Pi / 18)&lt;BR /&gt;
        oCamera.ApplyWithoutTransition&lt;BR /&gt;
    Next&lt;BR /&gt;
End Sub&lt;BR /&gt;
&lt;BR /&gt;
Public Sub UpVectorRotate(ByRef Camera As Camera, ByVal RotateAngle As&lt;BR /&gt;
Double)&lt;BR /&gt;
    ' Create a vector that defines the rotation axis.&lt;BR /&gt;
    Dim RotateAxis As Vector&lt;BR /&gt;
    Set RotateAxis =&lt;BR /&gt;
ThisApplication.TransientGeometry.CreateVector(Camera.Target.X -&lt;BR /&gt;
Camera.Eye.X, _&lt;BR /&gt;
                    Camera.Target.Y - Camera.Eye.Y, Camera.Target.Z -&lt;BR /&gt;
Camera.Eye.Z)&lt;BR /&gt;
&lt;BR /&gt;
    ' Set-up the matrix that defines the rotation about the axis by the&lt;BR /&gt;
specified angle.&lt;BR /&gt;
    Dim oRotMatrix As Matrix&lt;BR /&gt;
    Set oRotMatrix = ThisApplication.TransientGeometry.CreateMatrix&lt;BR /&gt;
    Call oRotMatrix.SetToRotation(RotateAngle, RotateAxis, Camera.Eye)&lt;BR /&gt;
&lt;BR /&gt;
    ' Define a matrix that defines a point along the up vector.&lt;BR /&gt;
    Dim oUpVector As UnitVector&lt;BR /&gt;
    Set oUpVector = Camera.UpVector&lt;BR /&gt;
    Call oUpVector.TransformBy(oRotMatrix)&lt;BR /&gt;
&lt;BR /&gt;
    ' Set the up vector of the camera.&lt;BR /&gt;
    Camera.UpVector = oUpVector&lt;BR /&gt;
End Sub&lt;BR /&gt;
&lt;BR /&gt;
-Brian&lt;BR /&gt;
&lt;BR /&gt;
"Kent Keller" &lt;KENT&gt; wrote in message&lt;BR /&gt;
news:1C0448F608CF6FCF57843CF3A4622512@in.WebX.maYIadrTaRb...&lt;BR /&gt;
&amp;gt; Hi Mike&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;     Thanks, but I believe that is just the overall size of the window, and&lt;BR /&gt;
doesn't have&lt;BR /&gt;
&amp;gt; much to do with where in space the window is looking.&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;     One of the things I have noticed is that if I do a mouse wheel zoom&lt;BR /&gt;
the target doesn't&lt;BR /&gt;
&amp;gt; get reset to the view, but if I use the zoom toolbutton it does.  Just&lt;BR /&gt;
need to figure out&lt;BR /&gt;
&amp;gt; how to do that reset in code. 8^)&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; --&lt;BR /&gt;
&amp;gt; Kent&lt;BR /&gt;
&amp;gt; Assistant Moderator&lt;BR /&gt;
&amp;gt; Autodesk Discussion Forum Moderator Program&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; "Mike Maenpaa" &lt;REMOVE__THISMIKE.MAENPAA&gt; wrote in message&lt;BR /&gt;
&amp;gt; news:535B00513C57D65594F272AC8D1D4F19@in.WebX.maYIadrTaRb...&lt;BR /&gt;
&amp;gt; &amp;gt; I'm still trying to learn VBA, but can you get the window extents and&lt;BR /&gt;
then&lt;BR /&gt;
&amp;gt; &amp;gt; calculate the center from that? I found this in the Help file:&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;/REMOVE__THISMIKE.MAENPAA&gt;&lt;/KENT&gt;</description>
      <pubDate>Wed, 09 Apr 2003 14:06:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/camera-upvector/m-p/757648#M170561</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2003-04-09T14:06:11Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/camera-upvector/m-p/757649#M170562</link>
      <description>Thanks again Brian.&lt;BR /&gt;
&lt;BR /&gt;
    I think the rotate 90 stuff I posted a couple of posts up, works reasonably well.  The&lt;BR /&gt;
main difference I see off hand is that you are using a matrix, and I am using&lt;BR /&gt;
CrossProduct.&lt;BR /&gt;
&lt;BR /&gt;
    The one that still has me a bit stumped is if I zoom into a area using the mouse it&lt;BR /&gt;
seems like the Target doesn't get set to the new view, so if you rotate with something&lt;BR /&gt;
like this and use the current views Target, then you fly off to space.   If you use the&lt;BR /&gt;
Zoom toolbutton instead you rotate reasonably close around the view.&lt;BR /&gt;
&lt;BR /&gt;
                Set oNewEye = oApp.TransientGeometry.CreatePoint( _&lt;BR /&gt;
                    -1000000, 1000000, 1000000)&lt;BR /&gt;
                Set oNewUp = oApp.TransientGeometry.CreateUnitVector( _&lt;BR /&gt;
                    0.408248290463863, 0.816496580927726, -0.408248290463863)&lt;BR /&gt;
&lt;BR /&gt;
--&lt;BR /&gt;
Kent&lt;BR /&gt;
Assistant Moderator&lt;BR /&gt;
Autodesk Discussion Forum Moderator Program&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
"Brian Ekins (Autodesk)" &lt;BRIAN.EKINS&gt; wrote in message&lt;BR /&gt;
news:7B1F79E144E0611A82AF527BB3A01F1B@in.WebX.maYIadrTaRb...&lt;BR /&gt;
&amp;gt; Here's some code that will handle the general case of rotating the camera&lt;BR /&gt;
&amp;gt; any specified angle.  The first Sub is used to test the UpVectorRotate&lt;BR /&gt;
&amp;gt; function which does all of the work.  Hopefully this will help.&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Public Sub RotateTest()&lt;BR /&gt;
&amp;gt;     ' Define Pi.&lt;BR /&gt;
&amp;gt;     Dim Pi As Double&lt;BR /&gt;
&amp;gt;     Pi = 3.14159265358979&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;     ' Rotate the camera 90 degrees using transition type of apply&lt;BR /&gt;
&amp;gt;     Dim oCamera As Camera&lt;BR /&gt;
&amp;gt;     Set oCamera = ThisApplication.ActiveView.Camera&lt;BR /&gt;
&amp;gt;     Call UpVectorRotate(oCamera, Pi / 2)&lt;BR /&gt;
&amp;gt;     oCamera.Apply&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;     ' Rotate another 90 degrees.&lt;BR /&gt;
&amp;gt;     Call UpVectorRotate(oCamera, Pi / 2)&lt;BR /&gt;
&amp;gt;     oCamera.Apply&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;     ' Rotate another 90 degrees.&lt;BR /&gt;
&amp;gt;     Call UpVectorRotate(oCamera, Pi / 2)&lt;BR /&gt;
&amp;gt;     oCamera.Apply&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;     ' Rotate the camera in 10 degree increments a full 360 degrees.&lt;BR /&gt;
&amp;gt;     ' This applies without a transition so the camera jumps right&lt;BR /&gt;
&amp;gt;     ' to the position defined.&lt;BR /&gt;
&amp;gt;     Dim i As Long&lt;BR /&gt;
&amp;gt;     For i = 1 To 36&lt;BR /&gt;
&amp;gt;         Call UpVectorRotate(oCamera, Pi / 18)&lt;BR /&gt;
&amp;gt;         oCamera.ApplyWithoutTransition&lt;BR /&gt;
&amp;gt;     Next&lt;BR /&gt;
&amp;gt; End Sub&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Public Sub UpVectorRotate(ByRef Camera As Camera, ByVal RotateAngle As&lt;BR /&gt;
&amp;gt; Double)&lt;BR /&gt;
&amp;gt;     ' Create a vector that defines the rotation axis.&lt;BR /&gt;
&amp;gt;     Dim RotateAxis As Vector&lt;BR /&gt;
&amp;gt;     Set RotateAxis =&lt;BR /&gt;
&amp;gt; ThisApplication.TransientGeometry.CreateVector(Camera.Target.X -&lt;BR /&gt;
&amp;gt; Camera.Eye.X, _&lt;BR /&gt;
&amp;gt;                     Camera.Target.Y - Camera.Eye.Y, Camera.Target.Z -&lt;BR /&gt;
&amp;gt; Camera.Eye.Z)&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;     ' Set-up the matrix that defines the rotation about the axis by the&lt;BR /&gt;
&amp;gt; specified angle.&lt;BR /&gt;
&amp;gt;     Dim oRotMatrix As Matrix&lt;BR /&gt;
&amp;gt;     Set oRotMatrix = ThisApplication.TransientGeometry.CreateMatrix&lt;BR /&gt;
&amp;gt;     Call oRotMatrix.SetToRotation(RotateAngle, RotateAxis, Camera.Eye)&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;     ' Define a matrix that defines a point along the up vector.&lt;BR /&gt;
&amp;gt;     Dim oUpVector As UnitVector&lt;BR /&gt;
&amp;gt;     Set oUpVector = Camera.UpVector&lt;BR /&gt;
&amp;gt;     Call oUpVector.TransformBy(oRotMatrix)&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;     ' Set the up vector of the camera.&lt;BR /&gt;
&amp;gt;     Camera.UpVector = oUpVector&lt;BR /&gt;
&amp;gt; End Sub&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; -Brian&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; "Kent Keller" &lt;KENT&gt; wrote in message&lt;BR /&gt;
&amp;gt; news:1C0448F608CF6FCF57843CF3A4622512@in.WebX.maYIadrTaRb...&lt;BR /&gt;
&amp;gt; &amp;gt; Hi Mike&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;     Thanks, but I believe that is just the overall size of the window, and&lt;BR /&gt;
&amp;gt; doesn't have&lt;BR /&gt;
&amp;gt; &amp;gt; much to do with where in space the window is looking.&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;     One of the things I have noticed is that if I do a mouse wheel zoom&lt;BR /&gt;
&amp;gt; the target doesn't&lt;BR /&gt;
&amp;gt; &amp;gt; get reset to the view, but if I use the zoom toolbutton it does.  Just&lt;BR /&gt;
&amp;gt; need to figure out&lt;BR /&gt;
&amp;gt; &amp;gt; how to do that reset in code. 8^)&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; --&lt;BR /&gt;
&amp;gt; &amp;gt; Kent&lt;BR /&gt;
&amp;gt; &amp;gt; Assistant Moderator&lt;BR /&gt;
&amp;gt; &amp;gt; Autodesk Discussion Forum Moderator Program&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; "Mike Maenpaa" &lt;REMOVE__THISMIKE.MAENPAA&gt; wrote in message&lt;BR /&gt;
&amp;gt; &amp;gt; news:535B00513C57D65594F272AC8D1D4F19@in.WebX.maYIadrTaRb...&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; I'm still trying to learn VBA, but can you get the window extents and&lt;BR /&gt;
&amp;gt; then&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; calculate the center from that? I found this in the Help file:&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;/REMOVE__THISMIKE.MAENPAA&gt;&lt;/KENT&gt;&lt;/BRIAN.EKINS&gt;</description>
      <pubDate>Wed, 09 Apr 2003 14:40:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/camera-upvector/m-p/757649#M170562</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2003-04-09T14:40:45Z</dc:date>
    </item>
  </channel>
</rss>

