See the PC specifications in grasshopper 3d

Hi!!! Is any way or component in grasshopper to get and compare information about the computer, like the serial numbers, cpu type, mac adresses, etc?

Drop a C#.Net script component on the canvas and copy the methods from this page:

// Rolf

Thanks my friend, I will try!!!

Sorry, I’ll try to be more specific because I understand very little of programming … I need my definition to work on only 1 computer. Then I thought of collecting some information from Hardware, and comparing it with some manual input of mine, if it is the conditions are equal the definition continues, otherwise it does nothing. You see? Can you help me with this?

I don’t know of any prebuilt GH components that do that. The only route to that info would be through a custom scripting component, (C#, Python, etc…).

If you wanted to minimize the use of a scripting component, maybe a wierd/round about way would be to use a builtin windows command to get that info to a text file, then read it into your GH definition?
dxdiag.exe->save the output to a text file->read the file into GH->use some parsing mechanism.

With that said, I acknowledge that you mentioned you don’t have a lot of experience with programming, but, (as suggested previously), you could probably put something together in a scripting component with a little research.
Here is a link that shows where you would want your script to look, for various hardware info: (network card for example)
https://docs.microsoft.com/en-us/windows/desktop/cimwin32prov/win32-networkadapterconfiguration

If you were to cut and paste the code below into a python component, it might get you in the right direction.

#Original Source from sbaer here:
#https://discourse.mcneel.com/t/python-wishes-and-help-needed/4950/8
"""Provides a scripting component.
    Inputs:
        x: The x script variable
        y: The y script variable
    Output:
        a: The a output variable
        b: The b output variable
        c: The c output variable"""

__author__ = "chanley"
__version__ = "2018.09.24"

import clr
clr.AddReference("System.Management")
import System.Management


def video_information():
    select = "SELECT * FROM Win32_VideoController"
    arrInfo = System.Management.ManagementObjectSearcher(select)
    lines = []
    for strInfo in arrInfo.Get():
        lines.append("\nYour Graphic Card Data:\n-----------------------\n")
        names = "AdapterCompatibility", "VideoProcessor", "DriverVersion"
        for prop in strInfo.Properties:
            if prop.Name in names:
                lines.append("{0}: {1}".format(prop.Name,prop.Value))
            elif prop.Name=="AdapterRAM":
                lines.append("{0}: {1}".format(prop.Name,(prop.Value)/1048576))

    #return "\n".join(lines)
    return lines
    
def memory_information():
    select = "SELECT * FROM WIN32_PhysicalMemory"
    arrInfo = System.Management.ManagementObjectSearcher(select)
    lines = []
    for strInfo in arrInfo.Get():
        lines.append("\nYour Installed Memory Data:\n-----------------------\n")
        names = "BankLabel"
        for prop in strInfo.Properties:
            if prop.Name in names:
                lines.append("{0}: {1}".format(prop.Name,prop.Value))
            elif prop.Name=="Capacity":
                lines.append("{0}: {1}".format(prop.Name,(prop.Value)/1048576))
    return lines
    
def network_information():
    select = "SELECT * FROM WIN32_NetworkAdapterConfiguration"
    arrInfo = System.Management.ManagementObjectSearcher(select)
    lines = []
    for strInfo in arrInfo.Get():
        lines.append("\nYour Network Adapter Data:\n-----------------------\n")
        names = "IPAddress", "MACAddress"
        for prop in strInfo.Properties:
            if prop.Name in names and prop.Value != None:
                lines.append("{0}: {1}".format(prop.Name,prop.Value))
    return lines
    

a = video_information()
b = memory_information()
c = network_information()

I’m not aware of any existing plug-ins that get that type of info…but maybe someone else knows of one?

Dear Chris, thanks a lot for your time and your explanation… I will try and I come back with information.

Thanks a lot one more time!

It worked!!! It worked!!! Thank you very much for the strength and the time dedicated! Now I have the solution I needed! I hope one day I will be able to give you back the information I have provided! :grinning:

1 Like

Great! Glad you got what you needed!
For reference, the original source from that came from @stevebaer and can be found in this thread here:

There is a command in Rhino that also gives Video Card information, (SystemInfo). It’s often used to help troubleshoot dispay/performance related issues). It’s not a grasshopper command…but maybe it could be?

Thinking a bit more complex now, if I have the information to be compared in a file in the dropbox, google drive for example would it be possible this comparison with the script? Have you ever thought of something like this?

I think there are some plug-ins that read/connect to files hosted on certain web services…but I don’t know/remember off hand. I don’t have them, (and I don’t know if they are still supported), but I think there was one called Mosquito and another called GHowl? I don’t know the specifics but I think one of them allowed you to connect to a file on your google drive. I don’t remember the particulars. Do you have an end goal in mind for this project?

Yes, the goal is to make my settings work only on my computer, or on the computer I refer to, and when I mentioned something more complex, I would release the use or not on certain computers over the internet. What do you think of my idea?

I don’t think I fully understand your idea to offer any substantive opinion. Also, I would just be offering an opinion, which probably isn’t the best starting point for trying to decide whether to develop a plug-in. As a rule of thumb, I would probably ask a few basic “filtering” questions.
1 - what problem does is solve?
2 - how often does the problem present itself?
3 - are there any existing methods that provide the information/functionality you are looking for?

If the end goal is to provide a mechanism that checks a machines hardware specs, then make a decision whether to proceed, or not, with an operation…then I think. maybe that’s the wrong approach. It might make sense to rethink the operation in the first place, optimize it, and make sure it can run on a machine that fits within the recommended specs for the application.
https://www.rhino3d.com/6/system_requirements

Although, with that said, maybe some type of “system info” plugin could be useful for something…I’m just not entirely certain what that use would be. Maybe in some type of help-desk/support/troubleshooting capacity?
Maybe to save the information/write the information to a panel in the definition to describe the specs of the machine that last saved the file?

This is just my opinion, you can obviously do/develop whatever you want.

My friend, I am very grateful for all your help, the main problem you have already helped me too! I’ll try to evolve into something, and when it’s okay, I’ll bring the feedback here. Thank you one more time !!!