Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    How to get the Ethernet ID List [SOLVED]

    SDK Help
    0
    5
    1.3k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H
      Helper
      last edited by

      On 23/04/2018 at 13:21, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   16+ 
      Platform:   Windows  ;   Mac OSX  ; 
      Language(s) :     C++  ;

      ---------
      Hello,

      As the title suggests, I am looking for a way to get the local Ethernet ID list, as displayed in the Personalize window. 
      I thought about using MachineInfo, but it does not provide the Enternet ID among its macros.

      Thanks for any help on the subject.

      1 Reply Last reply Reply Quote 0
      • H
        Helper
        last edited by

        On 24/04/2018 at 02:43, xxxxxxxx wrote:

        Hi,

        By Ethernet ID I believe you mean MAC address.
        The API provides the function GetMacAddress() (declared in c4d_network.h ). Here's how it can be used:

        maxon::BaseArray<UChar> macAddress;
        if (GetMacAddress(macAddress))
        {
          String macAddressStr;
          for (Int32 i = 0; i < 6; i++)
          {
            if (i > 0)
              macAddressStr += "-";
          
            macAddressStr += String::HexToString((UInt32)macAddress[i], false).Right(2);
          }
          GePrint(macAddressStr);
        }
        
        1 Reply Last reply Reply Quote 0
        • H
          Helper
          last edited by

          On 24/04/2018 at 05:33, xxxxxxxx wrote:

          Thank you for your reply Yannick.

          This however does not give me the DEFAULT ETHERNET ID (as displayed in Help-Personalize). It does give the Mac Address of the attached device, but as soon as it is unplugged, the returned value changes.

          So I am looking for a consistent way to get the default Ethernet Adapater Physical Address value, as in Help - Personalize, which lists the default Ethernet ID, plus any attached devices IDs.

          Thanks

          1 Reply Last reply Reply Quote 0
          • H
            Helper
            last edited by

            On 25/04/2018 at 01:58, xxxxxxxx wrote:

            Hi,

            The Ethernet ID shown in the Personalize dialog is not given by GetMacAddress().
            The Cinema 4D API only provides GetMacAddress() to get the MAC address of the current machine.
            If it doesn't fit your needs then you should use an operating system function. There are useful resources on the web, for instance this interesting article with code.

            1 Reply Last reply Reply Quote 0
            • H
              Helper
              last edited by

              On 25/04/2018 at 05:04, xxxxxxxx wrote:

              Thank you for the link Yannick.

              1 Reply Last reply Reply Quote 0
              • First post
                Last post