Syncing Camera Positioning

Syncing Camera Positioning

dustina
Participant Participant
2,190 Views
5 Replies
Message 1 of 6

Syncing Camera Positioning

dustina
Participant
Participant

I have a project with multiple 3D views. Each view has three identical views corresponding to existing, demolition and new construction phases. I am trying identify if there is a known work flow for syncing camera views. Essentially, I want to update the camera angle in the New Construction views and have them ripple throughout the existing and demolition. 

 

Thanks,

 

Dustin 

0 Likes
Accepted solutions (1)
2,191 Views
5 Replies
Replies (5)
Message 2 of 6

Alan.johnson1970
Advisor
Advisor

I don't think you can do that.

 

AJ.
0 Likes
Message 3 of 6

ToanDN
Consultant
Consultant

You can copy paste camera from one plan view to another plan view but it will create a new 3d view, not update the old one.  So it is easier to duplicate one view and change phase/phase filter to create others.

 

0 Likes
Message 4 of 6

dustina
Participant
Participant

Appreciate the response, however trying to avoid the need to replace the views on sheets with updated views. Given the quantity of views I am dealing it could be quite time consuming to always replace the views every time I need to slightly tweak the camera view. 

0 Likes
Message 5 of 6

ToanDN
Consultant
Consultant
Accepted solution

Well, you can just open the 3d view you want to fix the camera angle, right click on the view cube, choose orient to view, and pick the 3d view with the correct camera angle.

Message 6 of 6

DanielKP2Z9V
Advocate
Advocate

I got something similar working from C# - synchronizes all currently opened 3d views and also works with other view types (plans, elevations, sections etc.). If syncing 3d views it only "pans" and "zooms", but doesn't rotate yet. Also syncing 2d views with 3d works well, but not the other way around yet. Also doesn't handle sheets yet (not sure how it would work, perhaps only if a view was activated).

 

 

using Autodesk.Revit.Attributes;
using Autodesk.Revit.DB;
using Autodesk.Revit.UI;
using System.Collections.Generic;
using System.Linq;

namespace scripts
{
    [Transaction(TransactionMode.Manual)]
    [Regeneration(RegenerationOption.Manual)]
    public class SynchronizeSelectedViews : IExternalCommand
    {
        public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
        {
            Document doc = commandData.Application.ActiveUIDocument.Document;
            UIDocument uidoc = commandData.Application.ActiveUIDocument;

            View activeView = doc.ActiveView;
            UIView activeuiView = uidoc?.GetOpenUIViews()?.FirstOrDefault(item => item.ViewId == uidoc.ActiveView.Id);

            // Get the corners of the current UIView
            IList<XYZ> corners = activeuiView.GetZoomCorners();
            XYZ topLeft = corners[0];
            XYZ bottomRight = corners[1];

            // Loop through all other open UI views and move them to the same position
            foreach (UIView otherUIView in commandData.Application.ActiveUIDocument.GetOpenUIViews())
            {
                if (otherUIView.ViewId != activeView.Id)
                {
                    if (!(doc.GetElement(otherUIView.ViewId) is ViewSheet))
                    {
                    otherUIView.ZoomAndCenterRectangle(topLeft, bottomRight);
                    }
                }
            }

            return Result.Succeeded;
        }
    }
}

 

 

 

 

 

 

0 Likes