コード例 #1
0
ファイル: BCFUtil.cs プロジェクト: webdada/HOK-Revit-Addins
        private Markup WriteDefaultMarkup()
        {
            Markup markup = new Markup();

            try
            {
                HeaderFile[] headerfiles = new HeaderFile[1];
                HeaderFile   header      = new HeaderFile();
                header.IfcProject = GUIDUtil.CreateGUID(m_doc.ProjectInformation);
                header.Filename   = m_doc.Title;
                header.Date       = DateTime.Now;
                headerfiles[0]    = header;
                markup.Header     = headerfiles;

                Topic topic = new Topic();
                topic.Guid  = Guid.NewGuid().ToString();
                topic.Title = "Color Schemes Editor";

                BimSnippet bimSnippet      = new BimSnippet();
                string     currentAssembly = System.Reflection.Assembly.GetAssembly(this.GetType()).Location;
                string     schemaPath      = Path.GetDirectoryName(currentAssembly) + "\\Resources\\colorscheme.xsd";
                bimSnippet.ReferenceSchema = schemaPath;
                bimSnippet.Reference       = "colorscheme.xml";
                topic.BimSnippet           = bimSnippet;
                markup.Topic = topic;

                Comment[] comments = new Comment[1];
                Comment   comment  = new Comment();
                comment.Guid     = Guid.NewGuid().ToString();
                comment.Date     = header.Date;
                comment.Author   = Environment.UserName;
                comment.Comment1 = "Color Schemes and Color Filters by Add-Ins";
                CommentTopic commentTopic = new CommentTopic();
                commentTopic.Guid = topic.Guid;
                comment.Topic     = commentTopic;
                comments[0]       = comment;
                markup.Comment    = comments;
            }
            catch (Exception ex)
            {
                MessageBox.Show("Failed to wirte the default Markup.\n" + ex.Message, "Write Default Markup", MessageBoxButton.OK, MessageBoxImage.Warning);
            }
            return(markup);
        }