Example #1
0
        /// <summary>
        /// Returns all sheet metal parts.
        /// </summary>
        /// <param name="assembly">
        /// The <see cref="AssemblyDocument"/> instance that this extension method affects.</param>
        /// <exception cref="ArgumentNullException"><paramref name="assembly"/> is <c>null</c>.</exception>
        public static List <Part> SheetMetalParts(this AssemblyDocument assembly)
        {
            if (assembly == null)
            {
                throw new ArgumentNullException(nameof(assembly));
            }

            return(assembly.Parts().Where(x => x.IsSheetMetal()).Select(Part.AsPart).ToList());
        }
Example #2
0
        /// <summary>
        /// Returns all generic parts.
        /// </summary>
        /// <param name="assembly">
        /// The <see cref="AssemblyDocument"/> instance that this extension method affects.</param>
        /// <exception cref="ArgumentNullException"><paramref name="assembly"/> is <c>null</c>.</exception>
        public static List <PartDocument> GenericParts(this AssemblyDocument assembly)
        {
            if (assembly == null)
            {
                throw new ArgumentNullException(nameof(assembly));
            }

            return(assembly.Parts().Where(x => x.IsGenericPart()).ToList());
        }