Example #1
0
        /// <summary>
        /// Adds standard part objects to a part group
        /// </summary>
        /// <param name="partGroupObj"></param>
        /// <param name="partObj"></param>
        public static void AddPart(this ISNPartGroupObj partGroupObj, ISNPartObj partObj)
        {
            var handle = Marshal.GetComInterfaceForObject(partObj, typeof(ISNPartObj));

            partGroupObj.AddInstanceOfPart(handle);
            Marshal.Release(handle);
        }
Example #2
0
        /// <summary>
        /// Removes a part object from its containing list
        /// </summary>
        /// <param name="partObj"></param>
        /// <returns></returns>
        public static bool Remove(this ISNPartObj partObj)
        {
            var partsList = partObj.OwnerList as ISNPartsList;

            if (partsList != null)
            {
                return(partsList.RemoveByName(partObj.Name));
            }

            return(false);
        }
Example #3
0
        /// <summary>
        /// Removes leadins and leadouts from a part
        /// </summary>
        /// <param name="partObj"></param>
        public static void DeleteLeadInOut(this ISNPartObj partObj)
        {
            var partPolyLinesList = partObj.PartPolyLinesList;

            partPolyLinesList.Reset();

            while (!partPolyLinesList.EndOfList)
            {
                var partPolyLineObj = partPolyLinesList.Current;
                partPolyLineObj.DeleteLeadins();
                partPolyLineObj.DeleteLeadouts();

                partPolyLinesList.MoveNext();
            }
        }