So I have a guy trying to test DKUI here in Cape Town and my server component shows an error on his machine:
I’ve cut the code down to what I believe shows the issue.
On my machine it shows this:
On his machine it shows this:
Code is attached.
This code uses Rhino.UI.RhinoEtoApp.MainWindow.Screen.Bounds to find the size of the screen that Rhino is on then calculates a position for the DKUI window to open.
He is running on 2x 4K monitors, I’m on 3x FHD - if that makes a difference.
Any tips?
Cheers
DK
250611_Test for Phil.gh (6.5 KB)
SO - this looks like where the issue is coming from:
Rhino.UI.RhinoEtoApp.MainWindow.Screen.Bounds is returning 4dp numbers…
I need to fix the data.
Cheers
DK
250611_Test for Phil3.gh (3.3 KB)
1 Like
Here is my fix for anyone running into this issue (I commented out the Rhino.UI.RhinoEtoApp.MainWindow.Screen.Bounds line and added in a list that that is what was being returned on the other machine)
import Rhino
#r_l = str(Rhino.UI.RhinoEtoApp.MainWindow.Screen.Bounds).split(",")
r_l = ["2194.2856", "0", "2194.2856", "1234.2858"]
r_l_rnd = []
for num in r_l:
result = num.split(".")[0]
r_l_rnd.append(result)
print r_l_rnd
q = int(round((int(r_l_rnd[0])) + (int(r_l_rnd[2])*0.18)))
print q
w = int(round((int(r_l_rnd[1])) + (int(r_l_rnd[3])*0.12)))
print w
Success:
However, it seems VERY strange that Rhino.UI.RhinoEtoApp.MainWindow.Screen.Bounds returns anything other than ints as the measurement is in pixels - I’ve never seen a factional pixel???
Cheers
DK