2027 Class
Changes 0
C

City

Description:
An object that contains geographical location information for a known city.
Remarks:
This object contains longitude, latitude, time zone information for a city already known by Revit. Currently Revit does not the ability to add cities to the existing list. The list of known cities can be retrieved using the Cities property on the application object.
Inheritance Hierarchy:
System.Object
  Autodesk.Revit.DB.APIObject
    Autodesk.Revit.DB.City
public class City : APIObject
double angleRatio = Math.PI / 180;   // ratio of Angle

// Get the Latitude information
double latiude = city.Latitude / angleRatio;
String latiudeInfo = "Latitude:      " + latiude.ToString();

// Get the Longitude information
double longitude = city.Longitude / angleRatio;
String longitudeInfo = "Longitude:   " + longitude.ToString();

// Get the TimeZone information
String timeZoneInfo = "TimeZone:   " + city.TimeZone.ToString();

// Set the information text box.
string cityInfo = latiudeInfo + "\n" + longitudeInfo
                            + "\n" + timeZoneInfo;
Name Return Type Description Inherited From
M Dispose() None Causes the object to release immediately any resources it may be utilizing. (Inherited from APIObject ) APIObject
M Equals None Determines whether the specified object is equal to the current object. (Inherited from Object ) Object
M GetHashCode None Serves as the default hash function. (Inherited from Object ) Object
M GetType None Gets the Type of the current instance. (Inherited from Object ) Object
M ToString None Returns a string that represents the current object. (Inherited from Object ) Object
Name Return Type Description Inherited From
P IsReadOnly bool Identifies if the object is read-only or modifiable. (Inherited from APIObject ) APIObject
P Latitude double Latitude of the city
P Longitude double Longitude of the city
P Name string The name of the city
P TimeZone double Time-zone in which the city resides
P WeatherStation string An identifier for the nearest weather station