Revit 2020: I am making a script that takes the location of a plan view on a sheet from one mode (eg: the Architectural model) writes that to excel, then using another script reads the excel to generate a similar plan for another discipline in another model (eg: the interiors model).
What is happening is that when i place the viewport on the sheet, it is not in the correct location, but it is reporting its location(x,y) to be correct. However when I access the same viewport location with a separate script than the one that created the viewport, it is reporting its location ‘accurately’. If I then run a separate script to move the location based on the excel, it works perfectly. In order for this script to be useful for my firm, all this needs to happen in one script, not by running 2 separate scripts.
Here are some screenshots that illustrate the problem:
in the excel file, note the following - AE101 is at 1.012 and 1.302 - in this example it will be ‘copied’ to sheet AF501 (so AF501 should be at 1.012 and 1.302)
note the following in the image below: the item is AF501, and is being shown at 1.012 and 1.302. so everything seems correct, except the viewport is visibly in the wrong spot on the sheet. (also a side note: i used a python script as well to create and place the viewports, and i have the exact same results. so i dont thinks its the viewport.create node that’s the issue??)
BUT its completely in the wrong spot on the sheet! It’s visibly way off.
so i got to thinking, and troubleshooting, and then i made a completely separate script that all it did was report back the viewport location, and look at what its saying - (top image is where its putting it for my workstation, and bottom image is where its putting it on our VDI machine) - this x,y location is where its actually appearing on the sheet, not the false location that its reporting in the original script.
If i add in the viewport.setboxcenter to move the viewport inside this new script, and tell it to put it at at 1.012 and 1.302, it properly locates and reports the viewport on the sheet.
Any ideas what is going on?