ArcGIS Pro 3.2 API Reference Guide
ArcGIS.Core.Geometry Namespace / SpatialReferenceBuilder Class / SpatialReferenceBuilder Constructor / SpatialReferenceBuilder Constructor(Int32)
The well-known ID that represents the Spatial Reference.
Example

In This Topic
    SpatialReferenceBuilder Constructor(Int32)
    In This Topic
    Creates a new instance of the SpatialReferenceBuilder class. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax
    public SpatialReferenceBuilder( 
       int wkid
    )
    Public Function New( _
       ByVal wkid As Integer _
    )

    Parameters

    wkid
    The well-known ID that represents the Spatial Reference.
    Exceptions
    ExceptionDescription
    This method or property must be called within the lambda passed to QueuedTask.Run.
    Example
    Construct a SpatialReference - from a well-known ID
    // Use a builder convenience method or use a builder constructor.
    
    // SpatialReferenceBuilder convenience methods don't need to run on the MCT.
    SpatialReference sr3857 = SpatialReferenceBuilder.CreateSpatialReference(3857);
    
    // SpatialReferenceBuilder constructors need to run on the MCT.
    ArcGIS.Desktop.Framework.Threading.Tasks.QueuedTask.Run(() =>
    {
      using (SpatialReferenceBuilder srBuilder = new SpatialReferenceBuilder(3857))
      {
        // do something with the builder
    
        sr3857 = srBuilder.ToSpatialReference();
      }
    });
    
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also