3D view facing North

3D view facing North

Anonymous
Not applicable
1,365 Views
4 Replies
Message 1 of 5

3D view facing North

Anonymous
Not applicable

Hi

 

After a while I have started on the automatic 3D views creation again, still with no luck.

The North direction is still wrong.

When I use the eye, Up, Forward settings as below, North is turning Right insted of up

 

XYZ eye = new XYZ((SecBMin.X + SecBMax.X) / 2, (SecBMin.Y + SecBMax.Y) / 2, 1); // in the middle of the section box

XYZ up = XYZ.BasisY;
XYZ forward = XYZ.BasisZ;

 

If I swap the Up and Forward Z/Y:

XYZ eye = new XYZ((SecBMin.X + SecBMax.X) / 2, (SecBMin.Y + SecBMax.Y) / 2, 1);

XYZ up = XYZ.BasisZ;
XYZ forward = XYZ.BasisY;

 

Now I got the direction right, but the eye target is not placed in the midtel af the outer walls don't seem prarallel.

 

What do I do wrong ?

Isn't it possible to create a 3D perspective facing North ?

 

If not, is it possible to rotate the view after creation ?

 

Best Regards

Anders

0 Likes
Accepted solutions (1)
1,366 Views
4 Replies
Replies (4)
Message 2 of 5

jeremytammik
Autodesk
Autodesk

Dear Anders,

 

Thank you for your query.

 

I cannot say off-hand what might be wrong, but I am certain that you can create the view oriented in the manner you need.

 

Have you taken a look at The Building Coder topic group on Creating and Setting Up a 3D View?

 

http://thebuildingcoder.typepad.com/blog/about-the-author.html#5.37

 

I hope some of the discussions and examples there help resolve the issue.

 

Please let us know how you end up solving this and what the problem was.

 

Thank you!

 

Best regards,

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Message 3 of 5

Anonymous
Not applicable

Hi Jeremy

 

I have tried, and the view is perfect with crop, eye Target etc, if it is in the right direction !!

 

The 3D view have settings like this

Up Direction         (-1, 0, 0)

Right Direction     (0, 1, 0)

View Direction     (0, 0, 1)

 

When I manualy correct the view with Top facing North

The settings look like this

Up Direction         (-1.57009245868378E-16, 1, -2.20937357914267E-16)

Right Direction     (1, -1.57009245868378E-16, -1.53018136212116E-31)

View Direction     (1.18328928261845E-31, 2.20937357914267E-16, 1)

 

Can you get something out of those settings ?

 

For you information, We started the subject at:

http://forums.autodesk.com/t5/revit-api/setting-3dview-to-topview-and-north-upwards/m-p/5612946#M979...

 

Best Regards Anders

0 Likes
Message 4 of 5

jeremytammik
Autodesk
Autodesk

Dear Anders,

 

Thank you for your update.

 

You understand the exponential notation xxxE-16, where x are digits, I assume?

 

E-16 and E-31 means 'multiplied by 10^-16' and 10^-31, respectively.

 

In other words, very small numbers indeed.

 

In other words, these numbers can be equated with zero.

 

In other words, the manually generated settings are

 

 

  Up Direction     (0, 1, 0) = XYZ.BasisY
  Right Direction  (1, 0, 0) = XYZ.BasisX
  View Direction   (0, 0, 1) = XYZ.BasisZ

 

Does that help?

 

Did you look at the background documentation that I pointed to responding to your other related query?

 

http://forums.autodesk.com/t5/revit-api/setting-3dview-to-topview-and-north-upwards/m-p/5612946

 

The description of the views in the developer guide:

 

Welcome to Revit 2016 Learning

 

http://help.autodesk.com/view/RVT/2016/ENU

 

Revit API Developers Guide

 

http://help.autodesk.com/view/RVT/2016/ENU/?guid=GUID-F0A122E0-E556-4D0D-9D0F-7E72A9315A42

 

Basic Interaction with Revit Elements

 

http://help.autodesk.com/view/RVT/2016/ENU/?guid=GUID-54D8EFF1-5274-43D8-BD0C-68209F36BBD2

 

Views

 

http://help.autodesk.com/view/RVT/2016/ENU/?guid=GUID-A7CE4D5C-8839-4CD8-817F-BE8B17F91D97

 

View3D

 

http://help.autodesk.com/view/RVT/2016/ENU/?guid=GUID-A7FA8DBC-830E-482D-9B66-147399524442

 

I hope this helps.

 

Best regards,

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Message 5 of 5

Anonymous
Not applicable
Accepted solution

Hi Jeremy

 

Finally I got I right 

I am not sure it is "by the book" but it is working Smiley Happy

 

I  put in an negativ value in the XYZ forward, then all the 3D view are in the right view, facing North.

 

XYZ eye = new XYZ((SecBMin.X + SecBMax.X) / 2, (SecBMin.Y + SecBMax.Y) / 2, 1); // Center of the sectionBox
XYZ up = XYZ.BasisY;
XYZ forward = -XYZ.BasisZ;

 

view.SetOrientation(new ViewOrientation3D(eye, up, forward));

Then I locked the view 

 

view.SaveOrientationAndLock();

 

and at last set the eye and target elevation to the right value

 

Parameter EYE_ELE = view.get_Parameter(BuiltInParameter.VIEWER_EYE_ELEVATION);
EYE_ELE.Set(....

 

Parameter Tar_ele = view.get_Parameter(BuiltInParameter.VIEWER_TARGET_ELEVATION);
Tar_ele.Set(.....

 

Have a nice weekend

Anders

0 Likes