Quantcast
Channel: Scripting - McNeel Forum
Viewing all articles
Browse latest Browse all 5750

Get Screen Size

$
0
0

@eric.bunn wrote:

Hi,

I was search around looking for a way to capture the size of the screen using python and found this link:
[https://developer.rhino3d.com/api/rhinoscript/utility_methods/getsystemmetrics.htm]

I cannot seem to locate this in the help files for Rhinoscript? I’ve used this Windows Function in VBA for many years but cannot determine how to do this in Python.

In VBA I would access it this way:

Private Declare PtrSafe Function GetSystemMetrics32 Lib “user32” Alias “GetSystemMetrics” ( _
ByVal nIndex As LongPtr) As LongPtr

Private Sub GetWindowSize(lngWidth As LongPtr, lngHeight As LongPtr)

Set swApp = Application.SldWorks
swApp.Visible = True
swApp.UserControl = True

lngWidth = GetSystemMetrics32(0) ' width in points
lngHeight = GetSystemMetrics32(1) ' height in points

End Sub

Any help would be greatly appreciated.

Eric

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 5750

Trending Articles