Connect to a Revit Server Accelerator

Anonymous

Connect to a Revit Server Accelerator

Anonymous
Not applicable

Any way to leverage the "connect to a Revit Server Accelerator with the following name or IP" through the API?  I am specifically looking for a way to make this more fool proof for users that travel between offices.  

0 Likes
Reply
2,484 Views
7 Replies
Replies (7)

trevor.taylor
Enthusiast
Enthusiast

In our office logon script I check the value of the environment variable LOGONSERVER to determine which office the workstation is in. Based on the return value, I then set the value of RSACCELERATORxxxx

0 Likes

trevor.taylor
Enthusiast
Enthusiast

I should have mentioned that RSACCELERATORxxxx is also an environment variable.

0 Likes

Anonymous
Not applicable
I assumed RSACCELERATORxxxx was also an environment variable. In my situation, we have one host server with different accelerators. If I'm reading the host variable to set the accelerator variable, this will not work in my case correct?
0 Likes

trevor.taylor
Enthusiast
Enthusiast

Host doesn't matter in the case of the workstation configuration. RSACCELERATOR is the important bit. The tricky part is, of course, getting your logon script to know where it is. The LOGONSERVER env var has worked for us so far in returning the correct location.

 

I have a standalone EXE that our logon script runs at client workstation startup and login. However, you could do similar with a batch file or powershell. The RSACCELERATOR env var is a user var, so you could try something like this. This works in my world because the first character of the logonserver name identifies the office.

 

//-------------------------------------------------------------------------------
// SET UP REVIT SERVER ENVIRONMENT
//-------------------------------------------------------------------------------
// Set Appropriate Revit Server:
string localLogonServer = Environment.GetEnvironmentVariable("LOGONSERVER").Replace("\\\\","");
string localLogonServerPrefix = localLogonServer.Substring(0, 1).ToUpper();
string revitServerName;
switch localLogonServerPrefix)
{
    case "P":
        revitServerName = REVIT_SERVER_PDX;
        break;
    case "S":
        revitServerName = REVIT_SERVER_SEA;
        break;
    case "L":
        revitServerName = REVIT_SERVER_LAX;
        break;
    case "W":
        revitServerName = REVIT_SERVER_DC;
        break;
    case "N":
        revitServerName = REVIT_SERVER_NYC;
        break;
    default:
        revitServerName = string.Empty;
        break;
}

0 Likes

jeremytammik
Autodesk
Autodesk

Thank you very much, Trevor, for sharing your solution.

 

I contacted the developement team regarding the original question and I am sorry to say that the result is rather meagre:

We currently do not have an API for connecting to accelerator.

I hope this helps.

Best regards,

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

0 Likes

trevor.taylor
Enthusiast
Enthusiast

My network administrator suggests using the IP address of the local machine rather than the LOGONSERVER environment variable as it is more reliable. In our office for instance, the first two octets of the workstation's IP address identifiy the office: e.g: 111.222.333.444

 

Following is a  function to get the IP address, which you could  parse to determine the local office of the worstation and therby which Revit Server to assign:

 

/// <summary>

/// Gets the IPv4 Address of the workstation executing this function

/// </summary>

/// <returns></returns>

public static string GetLocalIP()

{

    string myIP = null;

    System.Net.IPHostEntry IpHostEntry = System.Net.Dns.GetHostEntry(System.Net.Dns.GetHostName());

 

    foreach (System.Net.IPAddress ipAddress in IpHostEntry.AddressList)

    {

       if (ipAddress.AddressFamily.ToString() == "InterNetwork")

       {

          myIP = ipAddress.ToString();

       }

    }

    return myIP;

}

 

0 Likes

Anonymous
Not applicable

hi all

 

I am trying to setup revit server please help. I used serverA as local server, in which variable is set to Accelertor,admin. The central server ServerB is set to Host, admin. When I try to open ServerA  via open dialog box, it gives an error, "the operation cannot be completed ". As per my understanding, i have to connect to local server ServerA to open the file and local server syncs with ServerB to get the data. Am i following the correct procedure. Please help

 

 

Thanks

Naveen

0 Likes