Revit API

Active Member
Posts: 7
Registered: ‎02-02-2007
Message 1 of 2 (220 Views)

"Duplicate" 3D view

220 Views, 1 Replies
09-29-2012 06:30 PM

Im using Revit 2012, from my understand, revit api will not allow to duplicate a view. I try to walk a round by create one origin 3D view, then set the properities of new view same as origin, for instance such as: . CropBox or .SectionBox.


But i'm struggeling at how to set the view orientation exactly same as origin view. I have try but not successful. Does anyone know how to solve this?




ADN Support Specialist
Posts: 358
Registered: ‎04-30-2009
Message 2 of 2 (201 Views)

Re: "Duplicate" 3D view

10-04-2012 10:50 AM in reply to: phanmanhquyet



Not sure if I'm following, but the View3d object on 2012 API have two relevant methods: eyeposition and sectionbox. Below is a sample from the help file, please take a look.



private void Getinfo_View3D(View3D view3D)
    string message = "View3D: ";
    // The position of the camera.
    XYZ eyePosition = view3D.EyePosition;
    message += "\nCamera position: (" + eyePosition.X + ", " +
                eyePosition.Y + ", " + eyePosition.Z + ")";

    // Identifies whether this is a perspective view. 
    if (view3D.IsPerspective)
        message += "\nThe view is a perspective.";

    // The section box of the 3D view cuts the model by its bounds.
    BoundingBoxXYZ sectionBox = view3D.SectionBox;
    XYZ max = sectionBox.Max; //Maximum coordinates (upper-right-front corner of the box).
    XYZ min = sectionBox.Min; //Minimum coordinates (lower-left-rear corner of the box).
    message += "\nSection Box: ";
    message += "\nMaximum coordinates: (" + max.X + ", " + max.Y + ", " + max.Z + ")";
    message += "\nMinimum coordinates: (" + min.X + ", " + min.Y + ", " + min.Z + ")";




Hope this help, please let me know if it doesn't.




Augusto Goncalves
Autodesk Developer Network
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.