Issues Creating a Custom Projected Coordinate System

Discussion created by nieltown on Nov 1, 2011
Latest reply on Dec 13, 2012 by 1066design
Hey, Folks:

I'm trying to create a custom coordinate system using NAD27 as my GCS and Albers Equal-Area Conic as my projection.  My program throws an AutomationException with no further info when I try to execute the .define(...) method in the following code block:

ISpatialReferenceFactory spatialReferenceFactory = new SpatialReferenceEnvironment();

ILinearUnit unit = (ILinearUnit) spatialReferenceFactory
IGeographicCoordinateSystem gcs = spatialReferenceFactory
IProjectionGEN projection = (IProjectionGEN) spatialReferenceFactory
IParameter[] parameters = projection

IProjectedCoordinateSystemEdit pcsEdit = new ProjectedCoordinateSystem();

Object name = "MyProjection";
Object alias = "My Alias";
Object abbreviation = "MP";
Object remarks = "Remarky Mark and the Funky Bunch";
Object usage = "Use this projection when creating an example for the good people of the ArcGIS forums.";
Object gcsObject = gcs;
Object unitObject = unit;
Object projectionObject = projection;
Object parametersObject = parameters;

pcsEdit.define(name, alias, abbreviation, remarks, usage, gcsObject, unitObject, projectionObject, parametersObject);

When writing the above code, I followed this example:

Again, the AutomationException is thrown when I call pcsEdit.define().

Could anyone please provide guidance?  I'm pretty stumped.