Results 1 to 4 of 4

Thread: View Frame Rotation

  1. #1
    Member
    Join Date
    2014-11
    Posts
    2
    Login to Give a bone
    0

    Default View Frame Rotation

    I need to run through each view frame in a group and get the rotation for each frame. As far as I can tell there is no "rotation" property or transform matrix that can be accessed through .NET. I also can't find any such property that you can set in Civil 3D. If anyone can help me out it would be greatly appreciated.

    Here is my simple code section for inspecting the view frames.

    Code:
    CivilDocument cdoc = CivilApplication.ActiveDocument;
                
                // Get editor for command line output
                Document doc = Application.DocumentManager.MdiActiveDocument;
                Editor ed = doc.Editor;
                // Document Database
                Database acDB = doc.Database;
    
    
    
    
                ObjectIdCollection FGGIDs = cdoc.GetViewFrameGroupIds();
    
    
                ed.WriteMessage("Object Class: " + FGGIDs[0].ObjectClass.DxfName + " ::: ");
    
    
                using (Transaction trans = acDB.TransactionManager.StartTransaction())
                {
                    ViewFrameGroup vfg = trans.GetObject(FGGIDs[0], OpenMode.ForRead) as ViewFrameGroup;
                    ObjectIdCollection vFrameIDs = vfg.GetViewFrameIds();
    
    
                    ed.WriteMessage("\nFrame Count: " + vFrameIDs.Count);
    
    
                    foreach (ObjectId vfID in vFrameIDs)
                    {
                        ViewFrame vf = trans.GetObject(vfID, OpenMode.ForWrite) as ViewFrame;
    
    
                        ed.WriteMessage("\nName: " + vf.Name + " Display Name: " + vf.DisplayName);
                    }
                }
    Thank you

  2. #2
    Administrator BlackBox's Avatar
    Join Date
    2009-11
    Posts
    5,714
    Login to Give a bone
    0

    Default Re: View Frame Rotation

    Welcome to AUGI.

    Try calculating the rotation from coordinates that can be culled from:

    Code:
    Curve curve = vf.GetOrthoProjectedCurve(new Plane());


    Cheers
    "How we think determines what we do, and what we do determines what we get."

    Sincpac C3D ~ Autodesk Exchange Apps

    Computer Specs:
    Dell Precision 3660, Core i9-12900K 5.2GHz, 64GB DDR5 RAM, PCIe 4.0 M.2 SSD (RAID 0), 16GB NVIDIA RTX A4000

  3. #3
    Member
    Join Date
    2014-11
    Posts
    2
    Login to Give a bone
    0

    Default Re: View Frame Rotation

    Thanks for the response. I played around with the curve object. I am not sure how to get any coordinates from it. All I could find was the start and end points which both came up as (0,0,0).

  4. #4
    Administrator BlackBox's Avatar
    Join Date
    2009-11
    Posts
    5,714
    Login to Give a bone
    0

    Default Re: View Frame Rotation

    In Visual Studio, simply enter "curve." (without quotes), and use Intellisense to scroll through the various Properties, Methods, Extension Methods, and Events exposed to the Curve Type.

    Pay special attention to anything with "Point" in the name, such as GetPointAtParam... With which StartParam and EndParam will prove useful.

    Cheers
    "How we think determines what we do, and what we do determines what we get."

    Sincpac C3D ~ Autodesk Exchange Apps

    Computer Specs:
    Dell Precision 3660, Core i9-12900K 5.2GHz, 64GB DDR5 RAM, PCIe 4.0 M.2 SSD (RAID 0), 16GB NVIDIA RTX A4000

Similar Threads

  1. view frame creation
    By Wish List System in forum Civil 3D Wish List
    Replies: 2
    Last Post: 2017-10-18, 02:21 PM
  2. view frame orientation
    By Wish List System in forum Civil 3D Wish List
    Replies: 6
    Last Post: 2016-10-22, 01:29 PM
  3. Can't create View Frame
    By sacprasanna383394 in forum AutoCAD Civil 3D - General
    Replies: 0
    Last Post: 2012-06-20, 11:11 AM
  4. View Frame Size
    By jason.cyr13 in forum AutoCAD Civil 3D - General
    Replies: 1
    Last Post: 2007-07-31, 04:05 AM
  5. 3d view rotation
    By bdillon7767881 in forum Revit Architecture - Wish List
    Replies: 4
    Last Post: 2004-04-29, 07:14 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •