示例#1
0
        public bool TryGet(string name, out IXModelView ent)
        {
            var viewNames = m_Doc.Model.GetModelViewNames() as string[];

            if (viewNames.Contains(name, StringComparer.CurrentCultureIgnoreCase))
            {
                //TODO: move the view creation to SwObject.FromDispatch
                ent = new SwNamedView(m_Doc.Model, null, m_MathUtils, name);
                return(true);
            }
            else
            {
                ent = null;
                return(false);
            }
        }
        /// <summary>
        /// Creates a view based on the model 3D view
        /// </summary>
        /// <param name="repo">Views repositry</param>
        /// <param name="view">Model based view to create drawing view from</param>
        /// <returns>Created drawing view</returns>
        public static IXModelViewBasedDrawingView CreateModelViewBased(this IXDrawingViewRepository repo, IXModelView view)
        {
            var drwView = repo.PreCreate <IXModelViewBasedDrawingView>();

            drwView.SourceModelView = view;

            repo.Add(drwView);

            return(drwView);
        }