Пример #1
0
        /// <summary>
        /// Create a new (or update an existing) coordinate system in the model
        /// </summary>
        /// <param name="cSystem">The geometry coordinate system to assign as this user system</param>
        /// <param name="name">Optional.  The name of the user coordinate system.  If not specified a
        /// name will be automatically generated.</param>
        /// <param name="exInfo">Optional.  The execution information of the current action.
        /// If an object has been created previously with matching execution information then
        /// instead of creating a new item this previous one will be updated and returned instead.
        /// This enables this method to be used parametrically.</param>
        /// <returns>The created or updated user coordinate system.</returns>
        public UserCoordinateSystemReference UserCoordinateSystemReference(ICoordinateSystem cSystem, string name = null, ExecutionInfo exInfo = null)
        {
            UserCoordinateSystemReference result = new UserCoordinateSystemReference();

            result = Model.History.Update(exInfo, result);
            if (name != null)
            {
                result.Name = name;
            }
            if (result.Name == null)
            {
                result.Name = Model.CoordinateSystems.NextAvailableName("Coordinate System", result, true);
            }
            Model.Add(result);
            return(result);
        }
Пример #2
0
 /// <summary>
 /// Add a new user-defined coordinate system to this model, if it does not
 /// already exist within it
 /// </summary>
 /// <param name="cSystem">The user-defined coordinate system to be added.</param>
 /// <returns>True if the coordinate system could be added,
 /// false if it already existed within the model.</returns>
 public bool Add(UserCoordinateSystemReference cSystem)
 {
     return(CoordinateSystems.TryAdd(cSystem));
 }