/// <summary>
        /// 先检查是否能添加此种类型的约束,然后确定是否添加约束
        /// </summary>
        /// <param name="skeRelMgr"><see cref="ISketchRelationManager"/> Interface</param>
        /// <param name="swConstraintType"><see cref="swConstraintType_e"/></param>
        /// <param name="sketchRelationResult"><see cref="ISketchRelation"/> 输出参数</param>
        /// <param name="entities">需要被约束的草图实体</param>
        /// <returns></returns>
        public static bool TryAddRelationEx(this ISketchRelationManager skeRelMgr, swConstraintType_e swConstraintType, out ISketchRelation sketchRelationResult, params object[] entities)
        {
            var consTypes = skeRelMgr.GetAllowedRelationsEx(entities);

            if (consTypes.Contains(swConstraintType))
            {
                sketchRelationResult = skeRelMgr.AddRelationEx(swConstraintType, entities);
                return(true);
            }
            else
            {
                sketchRelationResult = null;
                return(false);
            }
        }
Example #2
0
 public ISketchRelationObject(ISketchRelation ISketchRelationinstance)
 {
     ISketchRelationInstance = ISketchRelationinstance;
 }