private void EditAdvancedGetBimFileContentCommandExecute(object sender, EventArgs e)
        {
            try
            {
                Document activeDocument = _envDte.ActiveDocument;
                if (activeDocument != null)
                {
                    string bimFileName = activeDocument.FullName;
                    if (bimFileName == null || !bimFileName.EndsWith(".bim", StringComparison.InvariantCultureIgnoreCase))
                    {
                        System.Windows.Forms.MessageBox.Show("Command to be called on active .BIM file", "Error", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                        return;
                    }

                    string daxFilePath = BimFileIntegration.ConvertBimPathToDaxPath(bimFileName);
                    if (File.Exists(daxFilePath) && (new FileInfo(daxFilePath)).IsReadOnly)
                    {
                        System.Windows.Forms.MessageBox.Show(string.Format("{0} file is read only", daxFilePath), "Error", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                        return;
                    }

                    string fileContents = BimFileIntegration.GetMeasuresFromBimFile(bimFileName);
                    if (fileContents != null)
                    {
                        System.IO.File.WriteAllText(daxFilePath, fileContents);
                        _envDte.ExecuteCommand(string.Format(@"File.OpenFile ""{0}""", daxFilePath));
                    }
                }
            }
            catch (Exception exc)
            {
                DisplayExceptionWindow(exc);
            }
        }
        /// <summary>
        /// Create DAX file from active BIM document
        /// </summary>
        /// <param name="activeDocumentPath">Path to currently opened BIM model</param>
        /// <returns>Path to created DAX file</returns>
        public static string CreateDaxFile(string activeDocumentPath)
        {
            string extension = Path.GetExtension(activeDocumentPath);

            if (!extension.Equals(BimExtension, StringComparison.InvariantCultureIgnoreCase))
            {
                throw new ArgumentException("DAX file can only be created from opened BIM model");
            }
            string daxFilePath = activeDocumentPath.Substring(0, activeDocumentPath.Length - BimExtension.Length) + DaxExtension;

            if (File.Exists(daxFilePath))
            {
                throw new ApplicationException(string.Format("DAX file {0} already exists", daxFilePath));
            }

            string fileContents = BimFileIntegration.GetMeasuresFromBimFile(daxFilePath);

            File.WriteAllText(daxFilePath, string.IsNullOrEmpty(fileContents) ? "" : fileContents);
            return(daxFilePath);
        }