I’m trying to make a script that will create views give them a scope box and place them on sheets. So far I’ve been able to duplicate our base view, rename it, and give it a scope box. I’ve also created sheets using our base sheet for naming and placed the new view on the new sheet. I’m having issues getting the view to be placed on the correct position on the sheet. I used 0,0,0 as the location and it seems like it is using the center of the entire model. I have 8 scope boxes and some of them are rotated so every view I place is not on the sheet. When I used “View.ViewPortBoxCenter” to see what the locations were I was getting numbers like -3.256, 2.45 and -2.78, 0.28. These looked to be accurate to where they were placed assuming that the center of the sheet is 0, 0. I then tried “Viewport.SetBoxCenter” to correct this to 0,0. Now the views read 0,0 but appear to be in the same incorrect locations that they where before. I think this script is already useful but I want to get this last problem fixed before I try to make it more automated. In the screen shot below I have a value of 6 just to see what would happen. It appears to change nothing.
I either don’t understand how this works, or something else is wrong. On the left I have a template sheet and view and on the right I still have the view off to the side. I used sheets and selected my template sheet. I also used Views before this and selected the template view. Same issue.
I’ve changed the sheets to the one’s I created. I’ve used “sheets”, “views” with the template view, and “views” with the template sheet for the template sheet input and it still hasn’t fixed the issue.
I don’t think align sheet node will work. First it isn’t aligning area A correctly which the template is based off of and all the sheets A-H have the view in different positions. I need to find a way to move the viewports so they are in the center of the sheet even if they have scope boxes which I think is the issue here.
When I use “View.ViewPortBoxCenter” it gives the same coordinates for each viewport even though each sheet has the view at a different location which tells me it is not finding the center of the viewport. It’s finding the center of the model. This means I would have to put in a different coordinate for each view.
I’m having a similar issue. What I’m finding is that, for all of the great packages out there able to get the viewport location and move it, the actual bounds of the view are different. What I’m able to see is that despite each view having the same size crop either explicitly, or derivative of a scope box, the extenuating content of the view (annotation and such) will change the bound area of the viewport when placed on the sheet. Crop Box does not equal Viewport the latter of which is effectively random based on the view content (I’ve tested having all of the same annotation crops as well). Unless there is a package out there that can understand the location of the view’s crop boundary as visible through the viewport, it does not appear possible to locate the viewport with any accuracy on the sheet. I really hope I’m wrong on this since I’m not able to use python, so if there is anyone in the community that can show how this can be done I would love to hear it!
This is not the solution to the problem but it is a workaround that I tried out. I made a Metric Generic Annotation - Family with a square made of invisible lines. Then put it on in the views to stretch out the bounding box so it´s the same on every viewport that´s got this invisible square. This keeps the scope box as small as possible and the bounding box does not get effected by the sections or textnotes. But off course the downside is that this family needs to be at the same place in every view. Then I use this script with nodes from the Rhythm and Springs - Packages to align. Align viewports .dyn (26.2 KB)
Is there an update here? I also have the same problem I already have the script to place all the views on the sheets however the Viewport.SetBoxCenter doesn’t help with aligning the views in the same locations