예제 #1
0
        public void openrfa(string openmodel)
        {
            openfamilypath = openmodel;
            var evgetopen = BtnFamilyBrowser.GetEvent();

            if (evgetopen != null)
            {
                evgetopen.Raise();
            }
        }
예제 #2
0
        public void CreateTables()
        {
            var uiDoc = BtnFamilyBrowser.GetDoc();

            if (uiDoc == null)
            {
                return;
            }
            var document = uiDoc.Document;

            if (document == null)
            {
                return;
            }


            String fileName = RevitBiz.openfamilypath;

            Family family = null;

            using (Transaction tx = new Transaction(document))
            {
                tx.Start("load family");
                document.LoadFamily(fileName, out family);

                tx.Commit();
            }

            foreach (ElementId id in family.GetFamilySymbolIds())
            {
                var symbol = document.GetElement(id) as FamilySymbol;
                if (symbol != null)
                {
                    try
                    {
                        uiDoc.PromptForFamilyInstancePlacement(symbol);
                    }
                    catch (Exception ex)
                    {
                        string sss = ex.ToString();
                    }
                }
            }
        }