• Industries
  • Products
  • Buy
  • Services & Support
  • Communities
  • Discussion Groups

    Autodesk Revit API

    Reply
    Active Member
    Posts: 7
    Registered: ‎02-02-2007

    "Duplicate" 3D view

    168 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?

     

    Thanks.

    Quyet 

    Please use plain text.
    ADN Support Specialist
    Posts: 150
    Registered: ‎04-30-2009

    Re: "Duplicate" 3D view

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

    Hi,

     

    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 + ")";
    
        TaskDialog.Show("Revit",message);
    }

    <<<

     

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

     

     

    Regards,



    Augusto Goncalves
    Autodesk Developer Network
    Please use plain text.