/// <summary>
        /// Creates instance objects based on a string identifying an item's type in PowerSHAPE.
        /// </summary>
        /// <param name="powerSHAPE">The base instance to interact with PowerShape.</param>
        /// <param name="compositeID">The composite identifier of the entity.</param>
        /// <returns>The new entity.</returns>
        internal static object CreateEntity(PSAutomation powerSHAPE, int compositeID)
        {
            int typeID = compositeID / 20000000;

            switch (typeID)
            {
            case 61:
                return(new PSAnnotation(powerSHAPE, compositeID - 61 * 20000000, null));

            case 52:
                return(new PSArc(powerSHAPE, compositeID - 52 * 20000000, null));

            case 59:
                return(new PSCompCurve(powerSHAPE, compositeID - 59 * 20000000, null));

            case 53:
                return(new PSCurve(powerSHAPE, compositeID - 53 * 20000000, null));

            case 58:
                return(new PSLine(powerSHAPE, compositeID - 58 * 20000000, null));

            case 49:
                return(new PSPoint(powerSHAPE, compositeID - 49 * 20000000, null));

            case 40:
                return(PSSolidFactory.CreateSolid(powerSHAPE, compositeID - 40 * 20000000, null));

            case 60:
                if (powerSHAPE.ReadBoolValue("POINT[ID " + (compositeID - 60 * 20000000) + "].EXISTS"))
                {
                    return(new PSPoint(powerSHAPE, compositeID - 60 * 20000000, null));
                }
                else if (powerSHAPE.ReadBoolValue("ELECTRODE[ID " + (compositeID - 60 * 20000000) + "].EXISTS"))
                {
                    return(new PSElectrode(powerSHAPE, compositeID - 60 * 20000000, null));
                }
                else
                {
                    return(new PSMesh(powerSHAPE, compositeID - 60 * 20000000, null));
                }
                break;

            case 21:
                return(PSSurfaceFactory.CreateSurface(powerSHAPE, compositeID - 21 * 20000000, null));

            case 54:
                return(new PSWorkplane(powerSHAPE, compositeID - 54 * 20000000, null));
            }

            return(null);
        }