Extracting Curves of Viewport

Hey everyone,

 

I was wanting to try to get the curves of a view port (crop region) of a view. Does this seem possible, currently I am unsure of how to achieve this.

 

Thanks!

Hi John,

I’m pretty sure that we don’t expose anything in Dynamo to get these curves . . . not sure if it’s there in the Revit API. What are you trying to do?

 

Thanks

Z

John,

You would want to get a CropBox of a given view. API method is View.CropBox and it will return a BoundingBoxXYZ object. You can then query that object for a min and max value. bbox.Min and bbox.Max and that will give you two points in the opposite corners. From there its straight forward. the two missing points of the rectangle (I am assuming you want to construct a polyline) would be:

XYZ(bbox.Max.X, bbox.Min.Y, bbox.Min.Z)

XYZ(bbox.Min.X, bbox.Max.Y, bbox.Max.Z)

That should work. I hope that should work.

If its a plan view then Z values should be zero.

Good luck!

Thanks so much Konrad, I will check it out.

Zach- I am trying to extract the boundary of a viewport that is rotated on the sheet so I can then try to define a path that is orthagonal (stair stepped) rather than angular.

The reason for this effort is because of the issue when plotting a custom sketched crop region from Revit. When the crop region contains angles, the sheet files size becomes super bloated (1 sheet = 200 MB) http://forums.autodesk.com/t5/revit-architecture/custom-crop-region-causes-super-slow-and-large-pdf-s-and-dwf-s/td-p/4914424/page/2

This is a known issue and updated print drivers help compress the files but it still takes forever to print. (10 minutes per sheet) After some trial I found that if your crop region consists of verticals and horizontals, this is fixed.

That’s where the idea of using Dynamo to “sawtooth” the viewport came into play. That way I don’t have to manually draw every vertical and horizontal.

The picture on the left will actually result in a 200 MB file, the right will be roughly 600 KB

2015-03-04_13h13_51

 

Hi John,

I believe what you want is doable, however you’ll need to access the API.

If the view’s crop region has been changed by sketching, you can access the lines with the “View.GetCropRegionShapeManager()” and “ViewCropRegionShapeManager.GetCropRegionShape()” methods.

Interestingly there doesn’t seem to be a way to set the shape manger, once you have modified the geometry of the curves… A workaround would be to send the boundaries as model curves, manually select the model curves inside the Revit UI, cut them, enter the crop editing manager and paste the model curves as “Aligned to Current View”.

 

Thanks Dimitar, I am working on that method now. I’ve just got to figure out how to define a “Stair” step through two points. I will let you know what I get.

John,

When you said 200MB vs. 600KB my ears perked up. I must have drawn some angled crop regions myself and never realized that this might cause a slow down. I am going to test it, and if that’s the case then it will be worthwhile to investigate further.

Very interesting.

 

Konrad, it is a know issue, and if you use a newer printer driver they typically compress it. The problem is the time to compress is terrible. I am going to make a video that demonstrates this soon.

I’ve mostly seen it on floor plans, where the crop is custom sketched with angular lines.

Did you ever find a solution to this? I’m trying to do something similar and have hit some road blocks.

I haven’t had a chance to revisit this issue at this time. We implemented an internal workflow to have people stray away from angled custom crop regions. I do mean to get back into this soon though.

Will there be Dynamo nodes which work with Viewports and their boundaries / crops? We can’t just program the API…

We managed to find the cuboids of views on a sheet, but they are created at thee same scale as the real model, for example detail views at 3" scale are very small boxes.

We figured out that Viewports and Views are two very different things, so, is there an equivalent way to find the crop region of viewports on a sheet?

 

Thank you!

Gio

 

So, Viewport elements appear to have no geometry, or location in Dynamo…

What else can we try to see where these elements are on the sheet?

thank you

Capture

1 Like

can any one develop a custom node that can edit the location and the size of plan crop size

Hi @mohamedsafy

This is a help forum to ask for help with things that you cannot figure out on your own, but actually tried. Read this how to ask help https://forum.dynamobim.com/t/how-to-get-help-on-the-dynamo-forums/46772

Hope that make sense!

1 Like

i tried and i already have a topic to discuss it
i’m just checking with people if they have any newer achievement