Here is a question is related to the 3D views in Revit, i.e. standard, top, left, bottom, etc. and user created, and the corresponding ones in a DWF file. The issue concerns the relationship between the internal Revit coordinate system and the exported coordinates in DWF. For instance, how to create a 3D DWF with a custom view using the coordinates of the 3D view defined in Revit.
In a DWF file, the view is determined byHere is a description of these parameters from the HOOPS/3dGS Programming Guide. These parameters are defined for the standard views in one of the XML files contained in the DWF file.
In Revit, the view is determined by the ViewDirection, UpDirection, and EyePosition properties of the View3D class in the Revit API. When exporting a Revit file to DWF in Revit Architecture 2009, the parameters of the top view in the DWF file, for example (position, target, up vector), are different from the top view properties in Revit. Here are the approximate values of the top view parameters extracted from the Revit file and its corresponding DWF file:
Revit top view:
DWF top view:
Question: What transformation should I apply to the 3D coordinates of view parameters in Revit so that I can get the corresponding 3D coordinates in DWF? When I create custom views in Revit I want to make them available and apply them in the corresponding DWF file as well. I also need to calculate the field width and height parameters of the DWF view, which do not have analogues in the Revit 3D view.
Answer: Here are the transformations used to calculate the parameters of a DWF view from the Revit view. The camera for the default view and named views are defined slightly differently.
This is the definition for the default view:
This is the one for a named view:
Actually, the transformation for the default view is just a special case of the named view one with the unit scale set to one.
Many thanks to Joe Ye for handling this case!