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.
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
I should have mentioned that RSACCELERATORxxxx is also an environment variable.
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;
}
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
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;
}
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
Can't find what you're looking for? Ask the community or share your knowledge.