Page 1 of 3 123 LastLast
Results 1 to 10 of 26

Thread: Create a cropped plan view

  1. #1
    AUGI Addict sfaust's Avatar
    Join Date
    2004-01
    Location
    Littleton, CO (Denver Metro)
    Posts
    1,535
    Login to Give a bone
    0

    Default Create a cropped plan view

    I am trying to take the bounding box of a room, and create a plan of that room by enlarging the bounding box by a couple feet and setting that to the crop box. I've looked through the examples, and have something that seems to work... almost. It is creating the plan just fine, and giving me the crop box just fine, but the view inside is "all messed up" in technical terms

    Basically, most of the elements in my view seem to be semi-invisible. I say semi-invisible because I can't see them, but they pre-highlight, and I can select them. I have checked the view range (it's normal), the visibility and graphics (normal), the view detail level (makes no difference, it's like nothing is being cut) the display mode (wireframe looks like normal wireframe, hidden line is as described).

    I can't figure out why this would be, does anyone know?

    Here is my code:

    PrivateSub CreatePlanView(ByVal rm As Autodesk.Revit.Elements.Room, ByVal doc As Autodesk.Revit.Document)
    Dim NameParam As Autodesk.Revit.Parameters.BuiltInParameter = Parameters.BuiltInParameter.ROOM_NAME
    Dim plan As Autodesk.Revit.Elements.ViewPlan = doc.Create.NewViewPlan("RDS " & rm.Number & " - " & rm.Parameter(NameParam).AsString, rm.Level, Enums.ViewType.FloorPlan)
    Dim RmBB As Autodesk.Revit.Geometry.BoundingBoxXYZ = rm.BoundingBox(plan)
    Try
    'enlarge the bounding box
    Dim MaxPoint AsNew Autodesk.Revit.Geometry.XYZ(RmBB.Max.X + 5, RmBB.Max.Y + 5, RmBB.Max.Z)
    Dim MinPoint AsNew Autodesk.Revit.Geometry.XYZ(RmBB.Min.X - 5, RmBB.Min.Y - 5, RmBB.Min.Z)
    RmBB.Min = MinPoint
    RmBB.Max = MaxPoint
    plan.CropBoxActive =
    True
    plan.CropBox = RmBB
    plan.CropBoxVisible =
    True
    Catch ex As Exception
    MsgBox(ex.ToString)
    EndTry
    EndSub


    edit: I just did some more testing and If I turn off the floor category I can see the elements now, so it seems the floor was hiding some elements (which doesn't make sense). It's still only showing the wall layers in wireframe, though, regardless of detail level...
    Last edited by sfaust; 2008-06-11 at 12:05 AM.

  2. #2
    AUGI Addict sfaust's Avatar
    Join Date
    2004-01
    Location
    Littleton, CO (Denver Metro)
    Posts
    1,535
    Login to Give a bone
    0

    Default Re: Create a cropped plan view

    Also, how do you access the "Appears in Drawing List" parameter? I didn't see it in the built in parameters, and the standard parameters only allow string, elementID, and double I believe (no booleans, which I would assume yes/no parameters are)...

  3. #3
    AUGI Addict sfaust's Avatar
    Join Date
    2004-01
    Location
    Littleton, CO (Denver Metro)
    Posts
    1,535
    Login to Give a bone
    0

    Default Re: Create a cropped plan view

    Attached is a project file that shows this. Look at any of the plans that start with "RDS"
    Attached Files Attached Files

  4. #4
    AUGI Addict
    Join Date
    2003-11
    Location
    New Zealand
    Posts
    1,116
    Login to Give a bone
    0

    Default Re: Create a cropped plan view

    Haven't looked at the other problem but I can answer one question now:

    To get the Appears in drawing list parameter. Do this:
    1.. Get sheets.
    2.. Foreach sheet get the SHEET_SCHEDULED Builtinparameter (int).

    Cheers,

    Guy

  5. #5
    AUGI Addict truevis's Avatar
    Join Date
    2004-07
    Location
    Massachusetts, USA
    Posts
    1,191
    Login to Give a bone
    0

    Default Re: Create a cropped plan view

    When I get weird visibility conditions in the non-API world, I first try applying a view template. Maybe that would fix your problem.

    I'd make sure you are using WU1, too.

  6. #6
    AUGI Addict
    Join Date
    2003-11
    Location
    New Zealand
    Posts
    1,116
    Login to Give a bone
    0

    Default Re: Create a cropped plan view

    truevis is right, apply a view template and you should find the problem disappears.

    Cheers,

    Guy

  7. #7
    I could stop if I wanted to Danny Polkinhorn's Avatar
    Join Date
    2003-12
    Location
    San Francisco, CA
    Posts
    448
    Login to Give a bone
    0

    Default Re: Create a cropped plan view

    Also, yes/no parameters are stored as integers. Zero is false, non-zero is true. Although, 7 days later, you've probably already figured this out.

  8. #8
    AUGI Addict sfaust's Avatar
    Join Date
    2004-01
    Location
    Littleton, CO (Denver Metro)
    Posts
    1,535
    Login to Give a bone
    0

    Default Re: Create a cropped plan view

    Ok, sorry, I got pulled away from this for a while and just now am getting back to it. I tried applying a view template both programatically and just applying it manually afterward and neither fixed the problem...

    I did get the "Appears in Drawing List" parameter figured out, thanks Any other ideas of what may be happening?

    Thanks,
    Steve

  9. #9
    AUGI Addict
    Join Date
    2003-11
    Location
    New Zealand
    Posts
    1,116
    Login to Give a bone
    0

    Default Re: Create a cropped plan view

    If you look at your example project the created views seem to be ceiling views. ie Z is in the wrong direction.

    Also you must set the detail level on the created plan like this (where 1 is course):

    plan.get_Parameter(BuiltInParameter.VIEW_DETAIL_LEVEL).Set(1);

    Cheers,

    Guy

  10. #10
    AUGI Addict sfaust's Avatar
    Join Date
    2004-01
    Location
    Littleton, CO (Denver Metro)
    Posts
    1,535
    Login to Give a bone
    0

    Default Re: Create a cropped plan view

    Ok, sorry, I'm really struggling with this. I looked at it and you're right, they seem to be ceiling plans. However, I can't seem to see how to change the z direction. I looked at the CreateViewSection example in the SDK and looked at how they applied a transform. I tried something similar, but I can't see how to apply the transform to the view. From what I can tell, plans do not take a transform the way sections do.

    I also found the UpDirection, RightDirection, and ViewDirection properties of the plan, which I thought would modify the transform, but they are all readonly properties, so I can't change them.

    the best success I've had is with the code below. This code will create plan views that are right side up, but it doesn't set the cropbox where it should. I even put in the message boxes in there to give the plan cropbox location and minpoint location directly after I set them equal, and they are not equal... I don't understand why it's not setting it.

    I also tried swapping the Z coordinates for the maxpoint and minpoint from the original code I posted, but that gave me an error that the values were "outside the expected range".

    Here's the code mentioned above:

    PHP Code:
            Try
                
    'enlarge the bounding box
                plan.CropBoxActive = True
                plan.CropBoxVisible = True

                Dim MaxPoint As New Autodesk.Revit.Geometry.XYZ(RmBB.Max.X + 5, RmBB.Max.Y + 5, 4)
                Dim MinPoint As New Autodesk.Revit.Geometry.XYZ(RmBB.Min.X - 5, RmBB.Min.Y - 5, 0)

                plan.CropBox.Min.X = MinPoint.X
                plan.CropBox.Min.Y = MinPoint.Y
                plan.CropBox.Max.X = MaxPoint.X
                plan.CropBox.Max.Y = MaxPoint.Y

                MsgBox(plan.CropBox.Min.X.ToString)
                MsgBox(MinPoint.X.ToString)

                PlanViews.Add(plan)

            Catch ex As Exception
                MsgBox(ex.ToString)
            End Try 

Page 1 of 3 123 LastLast

Similar Threads

  1. 2011: Can I dimension beyond cropped view?
    By tedg in forum Revit - Platform
    Replies: 0
    Last Post: 2012-05-08, 07:37 PM
  2. 2011: Create Angled window opening in plan view
    By StephenJ in forum Revit Architecture - General
    Replies: 1
    Last Post: 2011-08-23, 11:31 AM
  3. 2010: Elevation Tag Disappearing When View is Cropped
    By sad407404 in forum Revit Architecture - General
    Replies: 7
    Last Post: 2011-07-21, 07:42 PM
  4. Greying Out Beyond Cropped View?
    By shbrooks in forum Revit Architecture - General
    Replies: 4
    Last Post: 2010-01-06, 04:17 PM
  5. Create Double Plan View Sheet?
    By calissem in forum AutoCAD Civil 3D - General
    Replies: 4
    Last Post: 2008-05-09, 04:13 PM

Posting Permissions

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