Quantcast
Channel: RevitNetAddinWizard & NavisworksNetAddinWizard
Viewing all 872 articles
Browse latest View live

Revit .NET API: Drag & Drop UIApplication.DoDragDrop (pt. 4 Import DWG)

$
0
0

Revit .NET has provided the Drag & Drop API (UIApplication.DoDragDrop) since version 2013. In this series of posts, we are going to explore the Revit Drag & Drop .NET API (UIApplication.DoDragDrop) case by case.

We loaded a family (.RFA) such as a column into the current document through drag & drop from a WPF label element, opened a project (.RVT) file as well through drag & drop but from a WPF button, and loaded all good families from a folder through drag & drop but from a WPF CheckBox element in previous cases.

In this case, let’s import an AutoCAD drawing (.DWG file) into the current Revit document through drag & drop an item (ComboBoxItem) of a WPF combo box (ComboBox).

•    Make sure the WPF Window UI and class are still there in the project.
•    Add a ComboBox element along with a ComboBoxItem to the WPF Window and make the ComboBoxItem as dragging source.
        <ComboBox Height="23" HorizontalAlignment="Left" Margin="12,106,0,0" Name="comboBox1" VerticalAlignment="Top" Width="254" SelectedIndex="0">
            <ComboBoxItem Name="cbItem1" Tag="C:\temp\1.dwg" MouseMove="comboBox1_MouseMove" >Revit Drag and Drop - Import DWG</ComboBoxItem>
        </ComboBox>

•    Implement the MouseMove event callback as follows into the Window1 class to make the WPF ComboBoxItem as the drag & drop source but the Revit window as the drag & drop target:
        private void comboBox1_MouseMove(object sender, MouseEventArgs e)
        {
            if (e.LeftButton == MouseButtonState.Pressed)
            {
                List<String> pathes = new List<String> { (sender as ComboBoxItem).Tag as string };
                Autodesk.Revit.UI.UIApplication.DoDragDrop(pathes);
            }
        }
•    Make sure the following code is still there in the Execute() of the external command:
                Window1 win = new Window1();
                win.Show();

The check for whether the left mouse button is pressed is done here in the MouseMove callback; otherwise it might be impossible to select the item or do any interactions to the ComboBoxItem due to the endless message loop. It is a good practice to do the same for other static WPF elements such as Label, Button, and CheckBox, which were demonstrated before, even if they don’t provide much interaction capability.

By the way, the drag & drop behavior here (default or standard) is provided by the UIApplication.DoDragDrop call automatically. That is, if the DWG is good as specified in the drag & drop data, it will be imported into the current Revit document directly.

That is about it. If we press the F5 key to give it a try in Revit 2014, as chosen during the project creation time by Revit .NET Addin Wizard (RevitNetAddinWizard), we will get the assembly loaded and the command registered properly by Revit. After the command being issued, the WPF window will appear.

After the DWG ComboBoxItem drag & drop into the Revit drawing area, the DWG file as specified by the tag of the current ComboBoxItem will be imported into the current document.
  UIApplication.DoDragDrop_DwgImport

Revit Addin Wizard (RevitAddinWizard) provides various wizards, coders and widgets to help program Revit addins. It can be downloaded from the Download link at the bottom of the blog index page.


Revit .NET API: Drag & Drop UIApplication.DoDragDrop (pt. 5 Import Image e.g. PNG & JPG)

$
0
0

Revit .NET has provided the Drag & Drop API (UIApplication.DoDragDrop) since version 2013. In this series of posts, we are going to explore the Revit Drag & Drop .NET API (UIApplication.DoDragDrop) case by case.

We loaded a family (.RFA) such as a column into the current document through drag & drop from a WPF label element, opened a project (.RVT) file as well through drag & drop but from a WPF button, and loaded all good families from a folder through drag & drop but from a WPF CheckBox element in previous cases. We also imported an AutoCAD drawing (.DWG file) into the current Revit document through drag & drop an item (ComboBoxItem) of a WPF combo box (ComboBox).

In this case, let’s import an image (.PNG) also through drag & drop an item (ComboBoxItem) of a WPF combo box (ComboBox).

•    Make sure the WPF Window UI and class are still there in the project.
•    Add one more ComboBoxItem to the ComboBox of the same WPF Window and make the ComboBoxItem as dragging source.
            <ComboBoxItem Name="cbItem2" Tag="C:\temp\sample.png" MouseMove="comboBox1_MouseMove" >Revit Drag and Drop - Import PNG</ComboBoxItem>

•    Or:
            <ComboBoxItem Name="cbItem8" Tag="C:\temp\sample.jpg" MouseMove="comboBox1_MouseMove" >Revit Drag and Drop - Import JPG</ComboBoxItem>


•    Make sure the comboBox1_MouseMove callback is still there. No need to change anything to it!
•    Make sure the following code is still there in the Execute() of the external command:
                Window1 win = new Window1();
                win.Show();

The check for whether the left mouse button is pressed is done here in the MouseMove callback; otherwise it might be impossible to select the item or do any interactions to the ComboBoxItem due to the endless message loop. It is a good practice to do the same for other static WPF elements such as Label, Button, and CheckBox, which were demonstrated before, even if they don’t provide much interaction capability.

By the way, the drag & drop behavior here (default or standard) is provided by the UIApplication.DoDragDrop call automatically. That is, if the PNG is good as specified in the drag & drop data, it will be imported into the current Revit document directly.

That is about it. If we press the F5 key to give it a try in Revit 2014, as chosen during the project creation time by Revit .NET Addin Wizard (RevitNetAddinWizard), we will get the assembly loaded and the command registered properly by Revit. After the command being issued, the WPF window will appear.

After the PNG ComboBoxItem drag & drop into the Revit drawing area, the PNG file as specified by the tag of the current ComboBoxItem will be imported into the current document.
UIApplication.DoDragDrop_PgnImport
 
Revit Addin Wizard (RevitAddinWizard) provides various wizards, coders and widgets to help program Revit addins. It can be downloaded from the Download link at the bottom of the blog index page.

Revit .NET API: Drag & Drop UIApplication.DoDragDrop (pt. 6 Import Other Formats like GBXML DXF DGN and SAT)

$
0
0

Revit .NET has provided the Drag & Drop API (UIApplication.DoDragDrop) since version 2013. In this series of posts, we are going to explore the Revit Drag & Drop .NET API (UIApplication.DoDragDrop) case by case.

We loaded a family (.RFA) such as a column into the current document through drag & drop from a WPF label element, opened a project (.RVT) file as well through drag & drop but from a WPF button, and loaded all good families from a folder through drag & drop but from a WPF CheckBox element in previous cases. We also imported an AutoCAD drawing (.DWG file) and a PNG image into the current Revit document through drag & drop an item (ComboBoxItem) of a WPF combo box (ComboBox).

In this case, let’s import more formats also through drag & drop an item (ComboBoxItem) of a WPF combo box (ComboBox).

•    Make sure the WPF Window UI and class are still there in the project.
•    Add some more ComboBoxItem to the ComboBox of the same WPF Window and make them as dragging source.
            <ComboBoxItem Name="cbItem3" Tag="C:\temp\sample.xml" MouseMove="comboBox1_MouseMove" >Revit Drag and Drop - Import GBXML</ComboBoxItem>
            <ComboBoxItem Name="cbItem4" Tag="C:\temp\sample.sat" MouseMove="comboBox1_MouseMove" >Revit Drag and Drop - Import SAT</ComboBoxItem>
            <ComboBoxItem Name="cbItem5" Tag="C:\temp\sample.skp" MouseMove="comboBox1_MouseMove" >Revit Drag and Drop - Import SKP</ComboBoxItem>
            <ComboBoxItem Name="cbItem6" Tag="C:\temp\sample.dgn" MouseMove="comboBox1_MouseMove" >Revit Drag and Drop - Import DGN</ComboBoxItem>
            <ComboBoxItem Name="cbItem7" Tag="C:\temp\sample.dxf" MouseMove="comboBox1_MouseMove" >Revit Drag and Drop - Import DXF</ComboBoxItem>

•    Make sure the comboBox1_MouseMove callback is still there. No need to change anything to it!
•    Make sure the following code is still there in the Execute() of the external command:
                Window1 win = new Window1();
                win.Show();

The check for whether the left mouse button is pressed is done here in the MouseMove callback; otherwise it might be impossible to select the item or do any interactions to the ComboBoxItem due to the endless message loop. It is a good practice to do the same for other static WPF elements such as Label, Button, and CheckBox, which were demonstrated before, even if they don’t provide much interaction capability.

By the way, the drag & drop behavior here (default or standard) is provided by the UIApplication.DoDragDrop call automatically. That is, if the format is supported and the file is good as specified in the drag & drop data, it will be imported into the current Revit document directly.

That is about it. If we press the F5 key to give it a try in Revit 2014, as chosen during the project creation time by Revit .NET Addin Wizard (RevitNetAddinWizard), we will get the assembly loaded and the command registered properly by Revit. After the command being issued, the WPF window will appear.

After a ComboBoxItem being drag & drop into the Revit drawing area, the file as specified by the tag of the current ComboBoxItem will be imported into the current document if the UIApplication.DoDragDrop supports the format and the file is good.

Revit Addin Wizard (RevitAddinWizard) provides various wizards, coders and widgets to help program Revit addins. It can be downloaded from the Download link at the bottom of the blog index page.

Revit .NET API: Drag & Drop UIApplication.DoDragDrop (pt. 7 Open Family)

$
0
0

Revit .NET has provided the Drag & Drop API (UIApplication.DoDragDrop) since version 2013. In this series of posts, we are going to explore the Revit Drag & Drop .NET API (UIApplication.DoDragDrop) case by case.

In this case, let’s open a family rather than load it into Revit through drag & drop from a WPF element. As introduced earlier, if we provide a .RFA file to the Autodesk.Revit.UI.UIApplication.DoDragDrop() and only rely on Revit itself for the drag and drop action, it will load the family into the current Revit document, but what if users want to open the family file instead?

Don’t worry. The Revit .NET Drag & Drop API provides another mechanism to support custom drag & drop behavior. More specifically, another signature of the Autodesk.Revit.UI.UIApplication.DoDragDrop() method and the IDropHandler interface come to rescue. We are going to address it in this post.

•    Add one more Label element to the WPF Window and make it the dragging source.
        <Label Content="Revit Drag and Drop - Open Family" Height="28" HorizontalAlignment="Left" Margin="12,135,0,0" Name="label2" Tag="C:\ProgramData\Autodesk\RVT 2014\Libraries\US Imperial\Columns\Round Column.rfa" VerticalAlignment="Top" Width="254" MouseMove="label2_MouseMove" />

•    Implement the MouseMove event callback as follows into the Window1 class to make the WPF Label as the drag & drop source,  the Revit window as the drag & drop target, and our custom drag & drop handler as the action:
        private void label2_MouseMove(object sender, MouseEventArgs e)
        {
            if (e.LeftButton == MouseButtonState.Pressed)
            {
                OpenFamilyDropHandler dropHandler = new OpenFamilyDropHandler();
                Autodesk.Revit.UI.UIApplication.DoDragDrop((sender as Label).Tag, dropHandler);
            }
        }
•    Implement the custom IDropHandler interface as follows:
    public class OpenFamilyDropHandler : Autodesk.Revit.UI.IDropHandler
    {
        public void Execute(Autodesk.Revit.UI.UIDocument document, object data)
        {
            document.Application.OpenAndActivateDocument((string)data);
        }
    }

•    Make sure the following code is still in the Execute of the external command class:
                Window1 win = new Window1();
                win.Show();

So this time, the action is not provided by the Revit default (standard) drag & drop behavior anymore. That is, the .RFA file will be opened into Revit session rather than loaded into the current Revit document.

That is about it. If we press the F5 key to give it a try in Revit 2014, as chosen during the project creation time by Revit .NET Addin Wizard (RevitNetAddinWizard), we will get the assembly loaded and the command registered properly by Revit. After the command being issued, the WPF window will appear.
After the label drag & drop into the Revit drawing area, the round column family as specified by the tag of the Label element will be opened into the Revit session so as for us to inspect its content or even modify it if necessary.
  UIApplication.DoDragDrop_OpenFamily

Revit Addin Wizard (RevitAddinWizard) provides various wizards, coders and widgets to help program Revit addins. It can be downloaded from the Download link at the bottom of the blog index page.

Revit .NET API: Custom Drag & Drop - UIApplication.DoDragDrop & IDropHandler (pt. 8 Link Revit Project)

$
0
0

Revit .NET has provided the Drag & Drop API (UIApplication.DoDragDrop) since version 2013. In this series of posts, we are going to explore the Revit Drag & Drop .NET API (UIApplication.DoDragDrop) case by case.

In this case, let’s link a Revit project into the current model rather than open it into Revit through drag & drop from a WPF element. As introduced earlier, if we provide a .RVT file to the Autodesk.Revit.UI.UIApplication.DoDragDrop() and only rely on Revit itself for the drag and drop action, it will open the project into Revit, but what if users want to link the project into the current one instead?

Don’t worry. The Revit .NET Drag & Drop API provides another mechanism to support custom drag & drop behavior. More specifically, another signature of the Autodesk.Revit.UI.UIApplication.DoDragDrop() method and the IDropHandler interface come to rescue. We are going to address it in this post.

•    Add a LisbBox and a couple of LisBoxItem instances to the WPF Window and make each item the dragging source.
        <ListBox Height="38" HorizontalAlignment="Left" Margin="12,158,0,0" Name="listBox1" VerticalAlignment="Top" Width="254" >
            <ListBoxItem Name="lbItem1" Tag="c:\temp\project1.rvt" MouseMove="lbItem1_MouseMove">Revit Drag &amp; Drop - Link Project (.RVT)</ListBoxItem>
            <ListBoxItem Name="lbItem2" Tag="c:\temp\1.dwg" MouseMove="lbItem1_MouseMove">Revit Drag &amp; Drop - Link AutoCAD DWG</ListBoxItem>
        </ListBox>

•    Implement the MouseMove event callback as follows into the Window1 class to make the WPF element as the drag & drop source,  the Revit window as the drag & drop target, and our custom drag & drop handler as the action:
        private void lbItem1_MouseMove(object sender, MouseEventArgs e)
        {
            if (e.LeftButton == MouseButtonState.Pressed)
            {
                LinkDropHandler dropHandler = new LinkDropHandler();
                Autodesk.Revit.UI.UIApplication.DoDragDrop((sender as FrameworkElement).Tag, dropHandler);
            }
        }
•    Implement the custom IDropHandler interface as follows:
    public class LinkDropHandler : Autodesk.Revit.UI.IDropHandler
    {
        public void Execute(Autodesk.Revit.UI.UIDocument document, object data)
        {
            string path = (string)data;
            try
            {
                using (Transaction trans = new Transaction(document.Document, "RevitLinkCreate"))
                {
                    trans.Start();
                    FilePath filePath = new FilePath(path);
                    RevitLinkOptions rvtLnkOpt = new RevitLinkOptions(false);
                    RevitLinkLoadResult revitLinkRes = RevitLinkType.Create(document.Document, filePath, rvtLnkOpt);
                    trans.Commit();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, path);
            }
        }
    }

•    Make sure the following code is still in the Execute of the external command class:
                Window1 win = new Window1();
                win.Show();

So this time, the action is not provided by the Revit default (standard) drag & drop behavior anymore. That is, the .RVT file will be linked into the current Revit document rather than opened into the Revit session.

That is about it. If we press the F5 key to give it a try in Revit 2014, as chosen during the project creation time by Revit .NET Addin Wizard (RevitNetAddinWizard), we will get the assembly loaded and the command registered properly by Revit. After the command being issued, the WPF window will appear.

After the WPF element drag & drop into the Revit drawing area, the Revit project (.RVT file) will be linked into the current Revit document, which can be checked with the Link Manager dialog.
UIApplication.DoDragDrop_LinkRVT
 
Revit Addin Wizard (RevitAddinWizard) provides various wizards, coders and widgets to help program Revit addins. It can be downloaded from the Download link at the bottom of the blog index page.

Revit .NET API: Custom Drag & Drop - UIApplication.DoDragDrop & IDropHandler (pt. 9 Link AutoCAD .DWG)

$
0
0

Revit .NET has provided the Drag & Drop API (UIApplication.DoDragDrop) since version 2013. In this series of posts, we are going to explore the Revit Drag & Drop .NET API (UIApplication.DoDragDrop) case by case.

In this case, let’s try to link an AutoCAD DWG into the current model rather than import it through drag & drop from a WPF element. As introduced earlier, if we provide a .DWG file to the Autodesk.Revit.UI.UIApplication.DoDragDrop() and only rely on Revit itself for the drag and drop action, the DWG will be imported into the current model, but what if users want to link the AutoCAD Drawing instead?

Don’t worry. The Revit .NET Drag & Drop API provides another mechanism to support custom drag & drop behavior. More specifically, another signature of the Autodesk.Revit.UI.UIApplication.DoDragDrop() method and the IDropHandler interface come to rescue.

In fact, we already tried so previously. As can be seen, there were two list box items added into the ListBox of the same WPF window, and the second one was for an AutoCAD DWG instead of Revit RVT. Unfortunately, the DWG drag and drop would fail if it were tried.  The failure reason was simple, the RevitLinkType.Create() was used to create the CAD/DWG link. Obviously, the RevitLinkType.Create() did not support file formats other than .RVT, but the thing was that the CADLinkType does not have a similar Create() method! The problem was not with the Revit drag & drop API; instead it was because we could not create a CAD/DWG with Revit API at present. Not sure why the limitation was imposed there, or simply something was ignored.

So, we had to give up!

Revit Addin Wizard (RevitAddinWizard) provides various wizards, coders and widgets to help program Revit addins. It can be downloaded from the Download link at the bottom of the blog index page.

Revit .NET API: Custom Drag & Drop - UIApplication.DoDragDrop & IDropHandler (pt. 10 Create Note from Image like PNG/BMP)

$
0
0

Revit .NET has provided the Drag & Drop API (UIApplication.DoDragDrop) since version 2013. In this series of posts, we are going to explore the Revit Drag & Drop .NET API (UIApplication.DoDragDrop) case by case.

In this case, let’s create some note into the active view of Revit from a valid image file as specified through drag & drop rather than import it as the standard drag & drop behavior provides. As introduced earlier, if we provide an image file to the Autodesk.Revit.UI.UIApplication.DoDragDrop() call and rely on Revit itself for the drag and drop action, the image no matter PNG or BMP will be imported into the current model, but what if users want to create some note about the image instead?

The Revit .NET Drag & Drop API provides another mechanism to support custom drag & drop behavior. More specifically, another signature of the Autodesk.Revit.UI.UIApplication.DoDragDrop() method and the IDropHandler interface come to rescue.

•    Add a RadioButton to the WPF Window and make it the dragging source.
        <RadioButton Content="Revit Drag &amp; Drop - Create Note from Image" Height="16" HorizontalAlignment="Left" Margin="12,202,0,0" Name="radioButton1" VerticalAlignment="Top" MouseMove="radioButton1_MouseMove" Tag="C:\temp\sample.png" />

•    Implement the MouseMove event callback as follows into the Window1 class to make the WPF element as the drag & drop source,  the Revit window as the drag & drop target, and our custom drag & drop handler as the action:
        private void radioButton1_MouseMove(object sender, MouseEventArgs e)
        {
            NoteFromImageDropHandler dropHandler = new NoteFromImageDropHandler();
            Autodesk.Revit.UI.UIApplication.DoDragDrop((sender as FrameworkElement).Tag, dropHandler);
        }
•    Implement the custom IDropHandler interface as follows:
    public class NoteFromImageDropHandler : Autodesk.Revit.UI.IDropHandler
    {
        public void Execute(Autodesk.Revit.UI.UIDocument document, object data)
        {
            string path = (string)data;
            try
            {
                using (Transaction trans = new Transaction(document.Document, "RevitNoteFromImage"))
                {
                    trans.Start();
                    System.Drawing.Bitmap img = new System.Drawing.Bitmap(path);
                    TextNote text = document.Document.Create.NewTextNote(
                        document.Document.ActiveView,
                        document.Document.ActiveView.Origin,
                        new XYZ(1, 0, 0),
                        new XYZ(0, 0, 1),
                        2,
                        TextAlignFlags.TEF_ALIGN_CENTER,
                        path + string.Format(" has resolution of ({0}, {1}).", img.Width, img.Height));
                    text.Width = 400;
                    trans.Commit();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, path);
            }
        }
    }

•    Make sure the following code is still in the Execute of the external command class:
                Window1 win = new Window1();
                win.Show();

That’s about it. After Revit starts up, the command is launched and the WPF window shows up, the radio button which represents an image file can be drag and drop into the Revit drawing area. In case the active view is good to host a TextNote and the image is valid, some note will be created into the current view at its center.
  UIApplication.DoDragDrop_NoteFromImage

Revit Addin Wizard (RevitAddinWizard) provides various wizards, coders and widgets to help program Revit addins. It can be downloaded from the Download link at the bottom of the blog index page.

Revit .NET: Try to Merge Two Revit Projects (.RVT Files)

$
0
0

It may not be uncommon at all to merge two Revit projects (.RVT files) but we haven’t seen any code addressing it. In this post, let’s try to merge two Revit projects programmatically with the Revit API and C#.

Here we go:

using (Autodesk.Revit.DB.Document doc = CachedApp.OpenDocumentFile(@"c:\temp\test.rvt"))
{
    using (Autodesk.Revit.DB.Transaction trans = new Autodesk.Revit.DB.Transaction(CachedDoc, "MergeProjects"))
    {
        trans.Start();

        FilteredElementCollector finalCollector = new FilteredElementCollector(doc);
        ElementIsElementTypeFilter filter1 = new ElementIsElementTypeFilter(false);
        finalCollector.WherePasses(filter1);
        ElementIsElementTypeFilter filter2 = new ElementIsElementTypeFilter(true);
        finalCollector.UnionWith((new FilteredElementCollector(doc)).WherePasses(filter2));
        ICollection<ElementId> ids = finalCollector.ToElementIds();

        CopyPasteOptions cpOpts = new CopyPasteOptions();
        ElementTransformUtils.CopyElements(doc, ids, CachedDoc, Autodesk.Revit.DB.Transform.Identity, cpOpts);

        trans.Commit();
    }

    doc.Close(false);
}

Nothing should be wrong with the above code, but when it was run from an external command, the following exception came up:

“Autodesk.Revit.Exceptions.ArgumentException: Some of the elements cannot be copied, because they are view-specific.
Parameter name: elementsToCopy
   at Autodesk.Revit.DB.ElementTransformUtils.CopyElements(Document sourceDocument, ICollection`1 elementsToCopy, Document destinationDocument, Transform transform, CopyPasteOptions options)
   at …”

So, the Autodesk.Revit.DB.ElementTransformUtils.CopyElements() method simply rejected to copy some so called ‘view-specific’ elements and aborted the whole operation. Since a useful Revit project definitely contains view-specific elements, the simple task of merging Revit projects cannot be done due to this severe limitation. It is frustrating!

Revit Addin Wizard (RevitAddinWizard) provides various wizards, coders and widgets to help program Revit addins. It can be downloaded from the Download link at the bottom of the blog index page.


Revit .NET: Try to Copy Elements from an Opened Project to Another

$
0
0

It may not be uncommon at all to merge two Revit projects (.RVT files) but we haven’t seen any code addressing it. In the previous post, we tried to merge a side Revit document opened into memory through the Application.OpenDocumentFile call into the current opened Revit document but got an exception saying “Some of the elements cannot be copied, because they are view-specific”.

In this post, let’s try on two opened projects in Revit then in case the problem was with the in-memory document only. Here we go:

if( CachedApp.Documents.Size >= 2 )
{
    List<Document> docs = (from Document doc in CachedApp.Documents select doc).ToList();
    using (Autodesk.Revit.DB.Transaction trans = new Autodesk.Revit.DB.Transaction(docs[0], "MergeProjects2"))
    {
        trans.Start();

        FilteredElementCollector finalCollector = new FilteredElementCollector(docs[1]);
        ElementIsElementTypeFilter filter1 = new ElementIsElementTypeFilter(false);
        finalCollector.WherePasses(filter1);
        ElementIsElementTypeFilter filter2 = new ElementIsElementTypeFilter(true);
        finalCollector.UnionWith((new FilteredElementCollector(docs[1])).WherePasses(filter2));
        ICollection<ElementId> ids = finalCollector.ToElementIds();

        CopyPasteOptions cpOpts = new CopyPasteOptions();
        ElementTransformUtils.CopyElements(docs[1], ids, docs[0], Autodesk.Revit.DB.Transform.Identity, cpOpts);

        trans.Commit();
    }
}

However, the same exception came up:
“Autodesk.Revit.Exceptions.ArgumentException: Some of the elements cannot be copied, because they are view-specific.
Parameter name: elementsToCopy
   at Autodesk.Revit.DB.ElementTransformUtils.CopyElements(Document sourceDocument, ICollection`1 elementsToCopy, Document destinationDocument, Transform transform, CopyPasteOptions options)
   at …”

So, the Autodesk.Revit.DB.ElementTransformUtils.CopyElements() method simply rejected to copy some so called ‘view-specific’ elements no matter whether in an opened and visible project or in a loaded in-memory document and aborted the whole operation. Since a useful Revit project definitely contains view-specific elements, the simple task of merging Revit projects cannot be done due to this severe limitation. It is frustrating!

Revit Addin Wizard (RevitAddinWizard) provides various wizards, coders and widgets to help program Revit addins. It can be downloaded from the Download link at the bottom of the blog index page.

Revit .NET: Copy Some Visible Elements from an Opened Project to Another

$
0
0

It may not be uncommon at all to merge two Revit projects (.RVT files) but we haven’t seen any code addressing it. Before, we tried to merge a side Revit document opened into memory through the Application.OpenDocumentFile call into the current opened Revit document but got an exception saying “Some of the elements cannot be copied, because they are view-specific”.

Previously, we tried the same on two opened projects in Revit but found the result was the same bad. In this post, let’s try to copy a few visible and very common elements (Walls) from an opened Revit project to another in the same Revit session.

if (CachedApp.Documents.Size >= 2)
{
    List<Document> docs = (from Document doc in CachedApp.Documents select doc).ToList();
    using (Autodesk.Revit.DB.Transaction trans = new Autodesk.Revit.DB.Transaction(docs[0], "MergeProjects2"))
    {
        trans.Start();

        FilteredElementCollector finalCollector = new FilteredElementCollector(docs[1]);
        ElementClassFilter filter1 = new ElementClassFilter(typeof(Wall));
        finalCollector.WherePasses(filter1);
        ICollection<ElementId> ids = finalCollector.ToElementIds();

        CopyPasteOptions cpOpts = new CopyPasteOptions();
        ElementTransformUtils.CopyElements(docs[1], ids, docs[0], Autodesk.Revit.DB.Transform.Identity, cpOpts);

        trans.Commit();
    }
}

This time, it succeeded! The walls from one opened Revit project was successfully copied over to another project also open in the same Revit session.
  CopyFromOneProjectToAnother
Revit Addin Wizard (RevitAddinWizard) provides various wizards, coders and widgets to help program Revit addins. It can be downloaded from the Download link at the bottom of the blog index page.

Revit .NET: Copy Some Visible Elements from a Loaded Project to Current Opened

$
0
0

It may not be uncommon at all to merge two Revit projects (.RVT files) but we haven’t seen any code addressing it. Before, we tried to merge a side Revit document opened into memory through the Application.OpenDocumentFile call into the current opened Revit document but got an exception saying “Some of the elements cannot be copied, because they are view-specific”. We also tried the same on two opened projects in Revit but found the result was the same bad.

Then we educationally guessed that the problem might be with only a certain number (type) of elements or types in the Revit project of concern, so tried to copy over only a few visible and common elements (Walls) from an opened Revit project to another in the same Revit session. It succeeded!

Now, let’s try the same between one loaded (not visible, in-memory only) project and an opened project and see.

using (Autodesk.Revit.DB.Document doc = CachedApp.OpenDocumentFile(@"c:\temp\test.rvt"))
{
    using (Autodesk.Revit.DB.Transaction trans = new Autodesk.Revit.DB.Transaction(CachedDoc, "MergeProjects4"))
    {
        trans.Start();

        FilteredElementCollector finalCollector = new FilteredElementCollector(doc);
        ElementClassFilter filter1 = new ElementClassFilter(typeof(Wall));
        finalCollector.WherePasses(filter1);
        ICollection<ElementId> ids = finalCollector.ToElementIds();

        CopyPasteOptions cpOpts = new CopyPasteOptions();
        ElementTransformUtils.CopyElements(doc, ids, CachedDoc, Autodesk.Revit.DB.Transform.Identity, cpOpts);

        trans.Commit();
    }
}

This time, it succeeded as well! The walls from one loaded (in-memory no visible) Revit project was successfully copied over to the current opened project. The results looked the same good as previous.
  CopyFromOneProjectToAnother
Revit Addin Wizard (RevitAddinWizard) provides various wizards, coders and widgets to help program Revit addins. It can be downloaded from the Download link at the bottom of the blog index page.

Revit .NET: What Might Prevent From Merging One Project with Another

$
0
0

It may not be uncommon at all to merge two Revit projects (.RVT files) but we haven’t seen any code addressing it. Before, we tried to merge a side Revit document opened into memory through the Application.OpenDocumentFile call into the current opened Revit document but got an exception saying “Some of the elements cannot be copied, because they are view-specific”. We also tried the same on two opened projects in Revit but found the result was the same bad.

Then we educationally guessed that the problem might be with only a certain number (type) of elements or types in the Revit project of concern, so tried to copy over only a few visible and common elements (Walls) from an opened Revit project to another in the same Revit session. It succeeded! We tried the same between one loaded (not visible, in-memory only) project and an opened project and got the same good result.

In this post, let’s figure what might be those problematic elements or types which present from merging one project with another.

using (StreamWriter sw = new StreamWriter(@"c:\temp\MergeProjects.txt"))
{
    using (Autodesk.Revit.DB.Document doc = CachedApp.OpenDocumentFile(@"c:\temp\test.rvt"))
    {
        using (Autodesk.Revit.DB.Transaction trans = new Autodesk.Revit.DB.Transaction(CachedDoc, "MergeProjects5"))
        {
            trans.Start();

            foreach (BuiltInCategory biCat in Enum.GetValues(typeof(BuiltInCategory)))
            {
                FilteredElementCollector finalCollector = new FilteredElementCollector(doc);
                try
                {
                    ElementCategoryFilter filter1 = new ElementCategoryFilter(biCat);
                    finalCollector.WherePasses(filter1);
                }
                catch
                {
                    sw.WriteLine(string.Format("The category {0} cannot be filtered.", biCat));
                    continue;
                };
                ICollection<ElementId> ids = finalCollector.ToElementIds();

                CopyPasteOptions cpOpts = new CopyPasteOptions();
                try
                {
                    if (ids.Count > 0)
                    {
                        ElementTransformUtils.CopyElements(doc, ids, CachedDoc, Autodesk.Revit.DB.Transform.Identity, cpOpts);
                        sw.WriteLine(string.Format("Elements/Types of the category {0} were successfully copied over.", biCat));
                    }
                    else
                        sw.WriteLine(string.Format("NO Elements/Types of the category {0}.", biCat));
                }
                catch
                {
                    sw.WriteLine(string.Format("Error when copying elements/types of the category {0}.", biCat));
                }
            }

            trans.Commit();
        }
    }

    sw.Close();
}

As can be seen, we wrap the element/type filtering call into the try/catch block to avoid the following exception aborting the entire process:
“Autodesk.Revit.Exceptions.ArgumentException: The category was not valid for filtering.
Parameter name: categoryId
   at ?A0xa0631107.ElementCategoryFilter_constructor_handwritten(BuiltInCategory category, Boolean inverted)
   at Autodesk.Revit.DB.ElementCategoryFilter..ctor(BuiltInCategory category)
   at …”

Here is the output:

NO Elements/Types of the category OST_StackedWalls_Obsolete_IdInWrongRange.
NO Elements/Types of the category OST_MassTags_Obsolete_IdInWrongRange.
NO Elements/Types of the category OST_MassSurface_Obsolete_IdInWrongRange.
NO Elements/Types of the category OST_MassFloor_Obsolete_IdInWrongRange.
NO Elements/Types of the category OST_Mass_Obsolete_IdInWrongRange.
NO Elements/Types of the category OST_WallRefPlanes_Obsolete_IdInWrongRange.
NO Elements/Types of the category OST_StickSymbols_Obsolete_IdInWrongRange.
NO Elements/Types of the category OST_RemovedGridSeg_Obsolete_IdInWrongRange.
NO Elements/Types of the category OST_PointClouds.
NO Elements/Types of the category OST_AssemblyOrigin_Lines.
NO Elements/Types of the category OST_AssemblyOrigin_Planes.
NO Elements/Types of the category OST_AssemblyOrigin_Points.
NO Elements/Types of the category OST_AssemblyOrigin.
Elements/Types of the category OST_LinksAnalytical were successfully copied over.
NO Elements/Types of the category OST_FoundationSlabAnalyticalTags.
NO Elements/Types of the category OST_WallFoundationAnalyticalTags.
NO Elements/Types of the category OST_IsolatedFoundationAnalyticalTags.
NO Elements/Types of the category OST_WallAnalyticalTags.
NO Elements/Types of the category OST_FloorAnalyticalTags.
NO Elements/Types of the category OST_ColumnAnalyticalTags.
NO Elements/Types of the category OST_BraceAnalyticalTags.
NO Elements/Types of the category OST_BeamAnalyticalTags.
NO Elements/Types of the category OST_AnalyticalNodes_Lines.
NO Elements/Types of the category OST_AnalyticalNodes_Planes.
NO Elements/Types of the category OST_AnalyticalNodes_Points.
NO Elements/Types of the category OST_AnalyticalNodes.
NO Elements/Types of the category OST_RigidLinksAnalytical.
NO Elements/Types of the category OST_FoundationSlabAnalytical.
NO Elements/Types of the category OST_WallFoundationAnalytical.
NO Elements/Types of the category OST_IsolatedFoundationAnalytical.
NO Elements/Types of the category OST_WallAnalytical.
NO Elements/Types of the category OST_FloorAnalytical.
NO Elements/Types of the category OST_ColumnEndSegment.
NO Elements/Types of the category OST_ColumnStartSegment.
NO Elements/Types of the category OST_ColumnAnalytical.
NO Elements/Types of the category OST_BraceEndSegment.
NO Elements/Types of the category OST_BraceStartSegment.
NO Elements/Types of the category OST_BraceAnalytical.
NO Elements/Types of the category OST_BeamEndSegment.
NO Elements/Types of the category OST_BeamStartSegment.
NO Elements/Types of the category OST_BeamAnalytical.
NO Elements/Types of the category OST_CompassSecondaryMonth.
NO Elements/Types of the category OST_CompassPrimaryMonth.
NO Elements/Types of the category OST_CompassSectionFilled.
NO Elements/Types of the category OST_LightLine.
NO Elements/Types of the category OST_MultiSurface.
NO Elements/Types of the category OST_SunSurface.
NO Elements/Types of the category OST_Analemma.
NO Elements/Types of the category OST_SunsetText.
NO Elements/Types of the category OST_CompassSection.
NO Elements/Types of the category OST_CompassOuter.
NO Elements/Types of the category OST_SunriseText.
NO Elements/Types of the category OST_CompassInner.
NO Elements/Types of the category OST_SunPath2.
NO Elements/Types of the category OST_SunPath1.
NO Elements/Types of the category OST_Sun.
Error when copying elements/types of the category OST_SunStudy.
NO Elements/Types of the category OST_StructuralTrussStickSymbols.
NO Elements/Types of the category OST_StructuralTrussHiddenLines.
NO Elements/Types of the category OST_TrussChord.
NO Elements/Types of the category OST_TrussWeb.
NO Elements/Types of the category OST_TrussBottomChordCurve.
NO Elements/Types of the category OST_TrussTopChordCurve.
NO Elements/Types of the category OST_TrussVertWebCurve.
NO Elements/Types of the category OST_TrussDiagWebCurve.
NO Elements/Types of the category OST_Truss.
NO Elements/Types of the category OST_RailingSystemTransitionHiddenLines_Deprecated.
NO Elements/Types of the category OST_RailingSystemTerminationHiddenLines_Deprecated.
NO Elements/Types of the category OST_RailingSystemRailHiddenLines_Deprecated.
NO Elements/Types of the category OST_RailingSystemTopRailHiddenLines_Deprecated.
NO Elements/Types of the category OST_RailingSystemHandRailBracketHiddenLines_Deprecated.
NO Elements/Types of the category OST_RailingSystemHandRailHiddenLines_Deprecated.
NO Elements/Types of the category OST_RailingSystemPanelBracketHiddenLines_Deprecated.
NO Elements/Types of the category OST_RailingSystemPanelHiddenLines_Deprecated.
NO Elements/Types of the category OST_RailingSystemBalusterHiddenLines_Deprecated.
NO Elements/Types of the category OST_RailingSystemPostHiddenLines_Deprecated.
NO Elements/Types of the category OST_RailingSystemSegmentHiddenLines_Deprecated.
NO Elements/Types of the category OST_RailingSystemHiddenLines_Deprecated.
NO Elements/Types of the category OST_StairStringer2012HiddenLines_Deprecated.
NO Elements/Types of the category OST_StairTread2012HiddenLines_Deprecated.
NO Elements/Types of the category OST_StairLanding2012HiddenLines_Deprecated.
NO Elements/Types of the category OST_StairRun2012HiddenLines_Deprecated.
NO Elements/Types of the category OST_Stairs2012HiddenLines_Deprecated.
NO Elements/Types of the category OST_MassHiddenLines.
NO Elements/Types of the category OST_CurtaSystemHiddenLines.
NO Elements/Types of the category OST_OBSOLETE_ElemArrayHiddenLines.
NO Elements/Types of the category OST_EntourageHiddenLines.
NO Elements/Types of the category OST_PlantingHiddenLines.
NO Elements/Types of the category OST_SpecialityEquipmentHiddenLines.
NO Elements/Types of the category OST_TopographyHiddenLines.
NO Elements/Types of the category OST_StructuralFramingSystemHiddenLines_Obsolete.
NO Elements/Types of the category OST_SiteHiddenLines.
NO Elements/Types of the category OST_RoadsHiddenLines.
NO Elements/Types of the category OST_ParkingHiddenLines.
NO Elements/Types of the category OST_PlumbingFixturesHiddenLines.
NO Elements/Types of the category OST_MechanicalEquipmentHiddenLines.
NO Elements/Types of the category OST_LightingFixturesHiddenLines.
NO Elements/Types of the category OST_FurnitureSystemsHiddenLines.
NO Elements/Types of the category OST_ElectricalFixturesHiddenLines.
NO Elements/Types of the category OST_ElectricalEquipmentHiddenLines.
NO Elements/Types of the category OST_CaseworkHiddenLines.
NO Elements/Types of the category OST_DetailComponentsHiddenLines.
NO Elements/Types of the category OST_ShaftOpeningHiddenLines.
NO Elements/Types of the category OST_GenericModelHiddenLines.
NO Elements/Types of the category OST_CurtainWallMullionsHiddenLines.
NO Elements/Types of the category OST_CurtainWallPanelsHiddenLines.
NO Elements/Types of the category OST_RampsHiddenLines.
NO Elements/Types of the category OST_StairsRailingHiddenLines.
NO Elements/Types of the category OST_StairsHiddenLines.
NO Elements/Types of the category OST_ColumnsHiddenLines.
NO Elements/Types of the category OST_FurnitureHiddenLines.
NO Elements/Types of the category OST_LinesHiddenLines.
NO Elements/Types of the category OST_CeilingsHiddenLines.
NO Elements/Types of the category OST_RoofsHiddenLines.
NO Elements/Types of the category OST_DoorsHiddenLines.
NO Elements/Types of the category OST_WindowsHiddenLines.
NO Elements/Types of the category OST_StructConnectionTags.
NO Elements/Types of the category OST_StructWeldLines.
NO Elements/Types of the category OST_StructConnections.
NO Elements/Types of the category OST_FabricAreaBoundary.
NO Elements/Types of the category OST_FabricReinSpanSymbol.
NO Elements/Types of the category OST_FabricReinforcementWire.
NO Elements/Types of the category OST_FabricReinforcementBoundary.
NO Elements/Types of the category OST_RebarSetToggle.
NO Elements/Types of the category OST_FabricAreaTags.
NO Elements/Types of the category OST_FabricReinforcementTags.
NO Elements/Types of the category OST_AreaReinTags.
NO Elements/Types of the category OST_RebarTags.
NO Elements/Types of the category OST_FabricAreaSketchSheetsLines.
NO Elements/Types of the category OST_FabricAreaSketchEnvelopeLines.
NO Elements/Types of the category OST_FabricAreas.
NO Elements/Types of the category OST_FabricReinforcement.
NO Elements/Types of the category OST_RebarCover.
Elements/Types of the category OST_CoverType were successfully copied over.
NO Elements/Types of the category OST_RebarShape.
NO Elements/Types of the category OST_PathReinBoundary.
NO Elements/Types of the category OST_PathReinTags.
NO Elements/Types of the category OST_PathReinSpanSymbol.
NO Elements/Types of the category OST_PathRein.
NO Elements/Types of the category OST_Cage.
NO Elements/Types of the category OST_AreaReinXVisibility.
NO Elements/Types of the category OST_AreaReinBoundary.
NO Elements/Types of the category OST_AreaReinSpanSymbol.
NO Elements/Types of the category OST_AreaReinSketchOverride.
NO Elements/Types of the category OST_AreaRein.
NO Elements/Types of the category OST_RebarLines.
NO Elements/Types of the category OST_RebarSketchLines.
NO Elements/Types of the category OST_Rebar.
NO Elements/Types of the category OST_NumberingSchemas.
NO Elements/Types of the category OST_DivisionRules.
NO Elements/Types of the category OST_gbXML_Shade.
NO Elements/Types of the category OST_AnalyticSurfaces.
NO Elements/Types of the category OST_AnalyticSpaces.
NO Elements/Types of the category OST_gbXML_OpeningAir.
NO Elements/Types of the category OST_gbXML_NonSlidingDoor.
NO Elements/Types of the category OST_gbXML_SlidingDoor.
NO Elements/Types of the category OST_gbXML_OperableSkylight.
NO Elements/Types of the category OST_gbXML_FixedSkylight.
NO Elements/Types of the category OST_gbXML_OperableWindow.
NO Elements/Types of the category OST_gbXML_FixedWindow.
NO Elements/Types of the category OST_gbXML_UndergroundCeiling.
NO Elements/Types of the category OST_gbXML_UndergroundSlab.
NO Elements/Types of the category OST_gbXML_UndergroundWall.
NO Elements/Types of the category OST_gbXML_SurfaceAir.
NO Elements/Types of the category OST_gbXML_Ceiling.
NO Elements/Types of the category OST_gbXML_InteriorFloor.
NO Elements/Types of the category OST_gbXML_InteriorWall.
NO Elements/Types of the category OST_gbXML_SlabOnGrade.
NO Elements/Types of the category OST_gbXML_RaisedFloor.
NO Elements/Types of the category OST_gbXML_Roof.
NO Elements/Types of the category OST_gbXML_ExteriorWall.
NO Elements/Types of the category OST_DivisionProfile.
NO Elements/Types of the category OST_SplitterProfile.
Elements/Types of the category OST_PipeSegments were successfully copied over.
NO Elements/Types of the category OST_GraphicalWarning_OpenConnector.
NO Elements/Types of the category OST_PlaceHolderPipes.
NO Elements/Types of the category OST_PlaceHolderDucts.
NO Elements/Types of the category OST_PipingSystem_Reference_Visibility.
NO Elements/Types of the category OST_PipingSystem_Reference.
NO Elements/Types of the category OST_DuctSystem_Reference_Visibility.
NO Elements/Types of the category OST_DuctSystem_Reference.
NO Elements/Types of the category OST_PipeInsulationsTags.
NO Elements/Types of the category OST_DuctLiningsTags.
NO Elements/Types of the category OST_DuctInsulationsTags.
NO Elements/Types of the category OST_ElectricalInternalCircuits.
NO Elements/Types of the category OST_PanelScheduleGraphics.
NO Elements/Types of the category OST_CableTrayRun.
NO Elements/Types of the category OST_ConduitRun.
Elements/Types of the category OST_ParamElemElectricalLoadClassification were successfully copied over.
Elements/Types of the category OST_DataPanelScheduleTemplates were successfully copied over.
Elements/Types of the category OST_SwitchboardScheduleTemplates were successfully copied over.
Elements/Types of the category OST_BranchPanelScheduleTemplates were successfully copied over.
Elements/Types of the category OST_ConduitStandards were successfully copied over.
Elements/Types of the category OST_ElectricalLoadClassifications were successfully copied over.
Elements/Types of the category OST_ElectricalDemandFactorDefinitions were successfully copied over.
NO Elements/Types of the category OST_ConduitFittingCenterLine.
NO Elements/Types of the category OST_CableTrayFittingCenterLine.
NO Elements/Types of the category OST_ConduitCenterLine.
NO Elements/Types of the category OST_ConduitDrop.
NO Elements/Types of the category OST_ConduitRiseDrop.
NO Elements/Types of the category OST_CableTrayCenterLine.
NO Elements/Types of the category OST_CableTrayDrop.
NO Elements/Types of the category OST_CableTrayRiseDrop.
NO Elements/Types of the category OST_ConduitTags.
Elements/Types of the category OST_Conduit were successfully copied over.
NO Elements/Types of the category OST_CableTrayTags.
Elements/Types of the category OST_CableTray were successfully copied over.
NO Elements/Types of the category OST_ConduitFittingTags.
NO Elements/Types of the category OST_ConduitFitting.
NO Elements/Types of the category OST_CableTrayFittingTags.
NO Elements/Types of the category OST_CableTrayFitting.
NO Elements/Types of the category OST_RoutingPreferences.
NO Elements/Types of the category OST_DuctLinings.
NO Elements/Types of the category OST_DuctInsulations.
NO Elements/Types of the category OST_PipeInsulations.
Elements/Types of the category OST_HVAC_Load_Schedules were successfully copied over.
Elements/Types of the category OST_HVAC_Load_Building_Types were successfully copied over.
Elements/Types of the category OST_HVAC_Load_Space_Types were successfully copied over.
NO Elements/Types of the category OST_HVAC_Zones_Reference_Visibility.
NO Elements/Types of the category OST_HVAC_Zones_InteriorFill_Visibility.
NO Elements/Types of the category OST_HVAC_Zones_ColorFill.
NO Elements/Types of the category OST_ZoneTags.
NO Elements/Types of the category OST_LayoutPath_Bases.
Elements/Types of the category OST_WireTemperatureRatings were successfully copied over.
Elements/Types of the category OST_WireInsulations were successfully copied over.
Elements/Types of the category OST_WireMaterials were successfully copied over.
NO Elements/Types of the category OST_HVAC_Zones_Reference.
NO Elements/Types of the category OST_HVAC_Zones_InteriorFill.
NO Elements/Types of the category OST_HVAC_Zones_Boundary.
Error when copying elements/types of the category OST_HVAC_Zones.
Elements/Types of the category OST_Fluids were successfully copied over.
Elements/Types of the category OST_PipeSchedules were successfully copied over.
Elements/Types of the category OST_PipeMaterials were successfully copied over.
Elements/Types of the category OST_PipeConnections were successfully copied over.
Elements/Types of the category OST_EAConstructions were successfully copied over.
NO Elements/Types of the category OST_SwitchSystem.
NO Elements/Types of the category OST_SprinklerTags.
NO Elements/Types of the category OST_Sprinklers.
NO Elements/Types of the category OST_RouteCurveBranch.
NO Elements/Types of the category OST_RouteCurveMain.
NO Elements/Types of the category OST_RouteCurve.
NO Elements/Types of the category OST_GbXML_Opening.
NO Elements/Types of the category OST_GbXML_SType_Underground.
NO Elements/Types of the category OST_GbXML_SType_Shade.
NO Elements/Types of the category OST_GbXML_SType_Exterior.
NO Elements/Types of the category OST_GbXML_SType_Interior.
NO Elements/Types of the category OST_GbXMLFaces.
NO Elements/Types of the category OST_WireHomeRunArrows.
NO Elements/Types of the category OST_LightingDeviceTags.
NO Elements/Types of the category OST_LightingDevices.
NO Elements/Types of the category OST_FireAlarmDeviceTags.
NO Elements/Types of the category OST_FireAlarmDevices.
NO Elements/Types of the category OST_DataDeviceTags.
NO Elements/Types of the category OST_DataDevices.
NO Elements/Types of the category OST_CommunicationDeviceTags.
NO Elements/Types of the category OST_CommunicationDevices.
NO Elements/Types of the category OST_SecurityDeviceTags.
NO Elements/Types of the category OST_SecurityDevices.
NO Elements/Types of the category OST_NurseCallDeviceTags.
NO Elements/Types of the category OST_NurseCallDevices.
NO Elements/Types of the category OST_TelephoneDeviceTags.
NO Elements/Types of the category OST_TelephoneDevices.
NO Elements/Types of the category OST_WireTickMarks.
NO Elements/Types of the category OST_PipeFittingInsulation.
NO Elements/Types of the category OST_PipeFittingCenterLine.
NO Elements/Types of the category OST_FlexPipeCurvesInsulation.
NO Elements/Types of the category OST_PipeCurvesInsulation.
NO Elements/Types of the category OST_PipeCurvesDrop.
NO Elements/Types of the category OST_DuctFittingLining.
NO Elements/Types of the category OST_DuctFittingInsulation.
NO Elements/Types of the category OST_DuctFittingCenterLine.
NO Elements/Types of the category OST_FlexDuctCurvesInsulation.
NO Elements/Types of the category OST_DuctCurvesLining.
NO Elements/Types of the category OST_DuctCurvesInsulation.
NO Elements/Types of the category OST_DuctCurvesDrop.
NO Elements/Types of the category OST_DuctFittingTags.
NO Elements/Types of the category OST_PipeFittingTags.
NO Elements/Types of the category OST_PipeColorFills.
NO Elements/Types of the category OST_PipeColorFillLegends.
NO Elements/Types of the category OST_WireTags.
NO Elements/Types of the category OST_PipeAccessoryTags.
NO Elements/Types of the category OST_PipeAccessory.
NO Elements/Types of the category OST_PipeCurvesRiseDrop.
NO Elements/Types of the category OST_FlexPipeCurvesPattern.
NO Elements/Types of the category OST_FlexPipeCurvesContour.
NO Elements/Types of the category OST_FlexPipeCurvesCenterLine.
Elements/Types of the category OST_FlexPipeCurves were successfully copied over.
NO Elements/Types of the category OST_PipeFitting.
NO Elements/Types of the category OST_FlexPipeTags.
NO Elements/Types of the category OST_PipeTags.
NO Elements/Types of the category OST_PipeCurvesContour.
NO Elements/Types of the category OST_PipeCurvesCenterLine.
Elements/Types of the category OST_PipeCurves were successfully copied over.
Elements/Types of the category OST_PipingSystem were successfully copied over.
NO Elements/Types of the category OST_ElectricalDemandFactor.
Elements/Types of the category OST_ElecDistributionSys were successfully copied over.
Elements/Types of the category OST_ElectricalVoltage were successfully copied over.
Elements/Types of the category OST_Wire were successfully copied over.
NO Elements/Types of the category OST_ElectricalCircuitTags.
NO Elements/Types of the category OST_ElectricalCircuit.
NO Elements/Types of the category OST_DuctCurvesRiseDrop.
NO Elements/Types of the category OST_FlexDuctCurvesPattern.
NO Elements/Types of the category OST_FlexDuctCurvesContour.
NO Elements/Types of the category OST_FlexDuctCurvesCenterLine.
Elements/Types of the category OST_FlexDuctCurves were successfully copied over.
NO Elements/Types of the category OST_DuctAccessoryTags.
NO Elements/Types of the category OST_DuctAccessory.
Elements/Types of the category OST_DuctSystem were successfully copied over.
NO Elements/Types of the category OST_DuctTerminalTags.
NO Elements/Types of the category OST_DuctTerminal.
NO Elements/Types of the category OST_DuctFitting.
NO Elements/Types of the category OST_DuctColorFills.
NO Elements/Types of the category OST_FlexDuctTags.
NO Elements/Types of the category OST_DuctTags.
NO Elements/Types of the category OST_DuctCurvesContour.
NO Elements/Types of the category OST_DuctCurvesCenterLine.
Elements/Types of the category OST_DuctCurves were successfully copied over.
NO Elements/Types of the category OST_DuctColorFillLegends.
NO Elements/Types of the category OST_ConnectorElemZAxis.
NO Elements/Types of the category OST_ConnectorElemYAxis.
NO Elements/Types of the category OST_ConnectorElemXAxis.
NO Elements/Types of the category OST_ConnectorElem.
NO Elements/Types of the category OST_DesignOptions.
NO Elements/Types of the category OST_DesignOptionSets.
NO Elements/Types of the category OST_StructuralBracePlanReps.
NO Elements/Types of the category OST_StructConnectionSymbols.
NO Elements/Types of the category OST_StructuralAnnotations.
NO Elements/Types of the category OST_RevisionCloudTags.
Elements/Types of the category OST_Revisions were successfully copied over.
Elements/Types of the category OST_RevisionClouds were successfully copied over.
NO Elements/Types of the category OST_EditCutProfile.
NO Elements/Types of the category OST_ElevationMarks.
NO Elements/Types of the category OST_GridHeads.
NO Elements/Types of the category OST_LevelHeads.
NO Elements/Types of the category OST_DecalType.
NO Elements/Types of the category OST_DecalElement.
NO Elements/Types of the category OST_VolumeOfInterest.
NO Elements/Types of the category OST_BoundaryConditions.
NO Elements/Types of the category OST_InternalAreaLoadTags.
NO Elements/Types of the category OST_InternalLineLoadTags.
NO Elements/Types of the category OST_InternalPointLoadTags.
NO Elements/Types of the category OST_AreaLoadTags.
NO Elements/Types of the category OST_LineLoadTags.
NO Elements/Types of the category OST_PointLoadTags.
NO Elements/Types of the category OST_LoadCasesSeismic.
NO Elements/Types of the category OST_LoadCasesTemperature.
NO Elements/Types of the category OST_LoadCasesAccidental.
NO Elements/Types of the category OST_LoadCasesRoofLive.
NO Elements/Types of the category OST_LoadCasesSnow.
NO Elements/Types of the category OST_LoadCasesWind.
NO Elements/Types of the category OST_LoadCasesLive.
NO Elements/Types of the category OST_LoadCasesDead.
NO Elements/Types of the category OST_LoadCases.
NO Elements/Types of the category OST_InternalAreaLoads.
NO Elements/Types of the category OST_InternalLineLoads.
NO Elements/Types of the category OST_InternalPointLoads.
NO Elements/Types of the category OST_InternalLoads.
NO Elements/Types of the category OST_AreaLoads.
NO Elements/Types of the category OST_LineLoads.
NO Elements/Types of the category OST_PointLoads.
NO Elements/Types of the category OST_Loads.
NO Elements/Types of the category OST_BeamSystemTags.
NO Elements/Types of the category OST_FootingSpanDirectionSymbol.
NO Elements/Types of the category OST_SpanDirectionSymbol.
NO Elements/Types of the category OST_SpotSlopesSymbols.
NO Elements/Types of the category OST_SpotCoordinateSymbols.
NO Elements/Types of the category OST_SpotElevSymbols.
NO Elements/Types of the category OST_TrussTags.
NO Elements/Types of the category OST_KeynoteTags.
NO Elements/Types of the category OST_DetailComponentTags.
NO Elements/Types of the category OST_MaterialTags.
NO Elements/Types of the category OST_FloorTags.
NO Elements/Types of the category OST_CurtaSystemTags.
NO Elements/Types of the category OST_HostFinTags.
NO Elements/Types of the category OST_StairsTags.
NO Elements/Types of the category OST_MultiCategoryTags.
NO Elements/Types of the category OST_PlantingTags.
NO Elements/Types of the category OST_AreaTags.
NO Elements/Types of the category OST_StructuralFoundationTags.
NO Elements/Types of the category OST_StructuralColumnTags.
NO Elements/Types of the category OST_ParkingTags.
NO Elements/Types of the category OST_SiteTags.
NO Elements/Types of the category OST_StructuralFramingTags.
NO Elements/Types of the category OST_SpecialityEquipmentTags.
NO Elements/Types of the category OST_GenericModelTags.
NO Elements/Types of the category OST_CurtainWallPanelTags.
NO Elements/Types of the category OST_WallTags.
NO Elements/Types of the category OST_PlumbingFixtureTags.
NO Elements/Types of the category OST_MechanicalEquipmentTags.
NO Elements/Types of the category OST_LightingFixtureTags.
NO Elements/Types of the category OST_FurnitureSystemTags.
NO Elements/Types of the category OST_FurnitureTags.
NO Elements/Types of the category OST_ElectricalFixtureTags.
NO Elements/Types of the category OST_ElectricalEquipmentTags.
NO Elements/Types of the category OST_CeilingTags.
NO Elements/Types of the category OST_CaseworkTags.
NO Elements/Types of the category OST_Tags.
NO Elements/Types of the category OST_MEPSpaceColorFill.
NO Elements/Types of the category OST_MEPSpaceReference.
NO Elements/Types of the category OST_MEPSpaceInteriorFill.
NO Elements/Types of the category OST_MEPSpaceReferenceVisibility.
NO Elements/Types of the category OST_MEPSpaceInteriorFillVisibility.
NO Elements/Types of the category OST_MEPSpaces.
Error when copying elements/types of the category OST_StackedWalls.
Elements/Types of the category OST_MassGlazingAll were successfully copied over.
Elements/Types of the category OST_MassFloorsAll were successfully copied over.
Elements/Types of the category OST_MassWallsAll were successfully copied over.
NO Elements/Types of the category OST_MassExteriorWallUnderground.
NO Elements/Types of the category OST_MassSlab.
Elements/Types of the category OST_MassShade were successfully copied over.
Elements/Types of the category OST_MassOpening were successfully copied over.
NO Elements/Types of the category OST_MassSkylights.
NO Elements/Types of the category OST_MassWindow.
Elements/Types of the category OST_MassRoof were successfully copied over.
NO Elements/Types of the category OST_MassExteriorWall.
NO Elements/Types of the category OST_MassInteriorWall.
NO Elements/Types of the category OST_MassZone.
NO Elements/Types of the category OST_MassAreaFaceTags.
NO Elements/Types of the category OST_HostTemplate.
NO Elements/Types of the category OST_MassFaceSplitter.
NO Elements/Types of the category OST_MassCutter.
NO Elements/Types of the category OST_ZoningEnvelope.
NO Elements/Types of the category OST_MassTags.
NO Elements/Types of the category OST_MassForm.
NO Elements/Types of the category OST_MassFloor.
NO Elements/Types of the category OST_Mass.
NO Elements/Types of the category OST_DividedSurface_DiscardedDivisionLines.
NO Elements/Types of the category OST_DividedSurfaceBelt.
NO Elements/Types of the category OST_TilePatterns.
NO Elements/Types of the category OST_AlwaysExcludedInAllViews.
NO Elements/Types of the category OST_DividedSurface_TransparentFace.
NO Elements/Types of the category OST_DividedSurface_PreDividedSurface.
NO Elements/Types of the category OST_DividedSurface_PatternFill.
NO Elements/Types of the category OST_DividedSurface_PatternLines.
NO Elements/Types of the category OST_DividedSurface_Gridlines.
NO Elements/Types of the category OST_DividedSurface_Nodes.
NO Elements/Types of the category OST_DividedSurface.
NO Elements/Types of the category OST_RepeatingDetailLines.
NO Elements/Types of the category OST_RampsDownArrow.
NO Elements/Types of the category OST_RampsUpArrow.
NO Elements/Types of the category OST_RampsDownText.
NO Elements/Types of the category OST_RampsUpText.
NO Elements/Types of the category OST_RampsStringerAboveCut.
NO Elements/Types of the category OST_RampsStringer.
NO Elements/Types of the category OST_RampsAboveCut.
NO Elements/Types of the category OST_RampsIncomplete.
NO Elements/Types of the category OST_TrussDummy.
NO Elements/Types of the category OST_ZoneSchemes.
Elements/Types of the category OST_AreaSchemes were successfully copied over.
NO Elements/Types of the category OST_Areas.
Elements/Types of the category OST_ProjectInformation were successfully copied over.
NO Elements/Types of the category OST_Sheets.
NO Elements/Types of the category OST_ProfileFamilies.
Elements/Types of the category OST_DetailComponents were successfully copied over.
Elements/Types of the category OST_RoofSoffit were successfully copied over.
Elements/Types of the category OST_EdgeSlab were successfully copied over.
Elements/Types of the category OST_Gutter were successfully copied over.
Elements/Types of the category OST_Fascia were successfully copied over.
NO Elements/Types of the category OST_Entourage.
NO Elements/Types of the category OST_Planting.
NO Elements/Types of the category OST_StructuralStiffenerTags.
NO Elements/Types of the category OST_StructuralStiffener.
NO Elements/Types of the category OST_FootingAnalyticalGeometry.
NO Elements/Types of the category OST_RvtLinks.
NO Elements/Types of the category OST_Automatic.
NO Elements/Types of the category OST_SpecialityEquipment.
NO Elements/Types of the category OST_ColumnAnalyticalRigidLinks.
NO Elements/Types of the category OST_SecondaryTopographyContours.
Elements/Types of the category OST_TopographyContours were successfully copied over.
NO Elements/Types of the category OST_TopographySurface.
NO Elements/Types of the category OST_Topography.
NO Elements/Types of the category OST_StructuralTruss.
NO Elements/Types of the category OST_StructuralColumnStickSymbols.
NO Elements/Types of the category OST_HiddenStructuralColumnLines.
NO Elements/Types of the category OST_AnalyticalRigidLinks.
NO Elements/Types of the category OST_ColumnAnalyticalGeometry.
NO Elements/Types of the category OST_FramingAnalyticalGeometry.
NO Elements/Types of the category OST_StructuralColumns.
NO Elements/Types of the category OST_HiddenStructuralFramingLines.
NO Elements/Types of the category OST_KickerBracing.
Elements/Types of the category OST_StructuralFramingSystem were successfully copied over.
NO Elements/Types of the category OST_VerticalBracing.
NO Elements/Types of the category OST_HorizontalBracing.
NO Elements/Types of the category OST_Purlin.
NO Elements/Types of the category OST_Joist.
NO Elements/Types of the category OST_Girder.
NO Elements/Types of the category OST_StructuralFramingOther.
NO Elements/Types of the category OST_StructuralFraming.
NO Elements/Types of the category OST_HiddenStructuralFoundationLines.
Elements/Types of the category OST_StructuralFoundation were successfully copied over.
NO Elements/Types of the category OST_BasePointAxisZ.
NO Elements/Types of the category OST_BasePointAxisY.
NO Elements/Types of the category OST_BasePointAxisX.
Error when copying elements/types of the category OST_SharedBasePoint.
Error when copying elements/types of the category OST_ProjectBasePoint.
NO Elements/Types of the category OST_SiteRegion.
NO Elements/Types of the category OST_SitePropertyLineSegmentTags.
NO Elements/Types of the category OST_SitePropertyLineSegment.
NO Elements/Types of the category OST_SitePropertyTags.
NO Elements/Types of the category OST_SitePointBoundary.
Elements/Types of the category OST_SiteProperty were successfully copied over.
Elements/Types of the category OST_BuildingPad were successfully copied over.
NO Elements/Types of the category OST_SitePoint.
NO Elements/Types of the category OST_SiteSurface.
NO Elements/Types of the category OST_Site.
NO Elements/Types of the category OST_HiddenBuildingUnitLines.
NO Elements/Types of the category OST_BuildingUnits.
NO Elements/Types of the category OST_Sewer.
NO Elements/Types of the category OST_Roads.
NO Elements/Types of the category OST_Property.
NO Elements/Types of the category OST_Parking.
NO Elements/Types of the category OST_PlumbingFixtures.
NO Elements/Types of the category OST_MechanicalEquipment.
NO Elements/Types of the category OST_LightingFixtureSource.
NO Elements/Types of the category OST_LightingFixtures.
NO Elements/Types of the category OST_FurnitureSystems.
NO Elements/Types of the category OST_ElectricalFixtures.
NO Elements/Types of the category OST_ElectricalEquipment.
NO Elements/Types of the category OST_Casework.
NO Elements/Types of the category OST_ArcWallRectOpening.
NO Elements/Types of the category OST_DormerOpeningIncomplete.
NO Elements/Types of the category OST_SWallRectOpening.
NO Elements/Types of the category OST_ShaftOpening.
NO Elements/Types of the category OST_StructuralFramingOpening.
NO Elements/Types of the category OST_ColumnOpening.
Elements/Types of the category OST_MultiReferenceAnnotations were successfully copied over.
NO Elements/Types of the category OST_DSR_LeaderTickMarkStyleId.
NO Elements/Types of the category OST_DSR_InteriorTickMarkStyleId.
NO Elements/Types of the category OST_DSR_ArrowHeadStyleId.
NO Elements/Types of the category OST_DSR_CenterlineTickMarkStyleId.
NO Elements/Types of the category OST_DSR_CenterlinePatternCatId.
NO Elements/Types of the category OST_DSR_DimStyleHeavyEndCategoryId.
NO Elements/Types of the category OST_DSR_DimStyleHeavyEndCatId.
NO Elements/Types of the category OST_DSR_DimStyleTickCategoryId.
NO Elements/Types of the category OST_DSR_LineAndTextAttrFontId.
NO Elements/Types of the category OST_DSR_LineAndTextAttrCategoryId.
NO Elements/Types of the category OST_NodeAnalyticalTags.
NO Elements/Types of the category OST_LinkAnalyticalTags.
NO Elements/Types of the category OST_RailingRailPathExtensionLines.
NO Elements/Types of the category OST_RailingRailPathLines.
NO Elements/Types of the category OST_StairsSupports.
NO Elements/Types of the category OST_RailingHandRailAboveCut.
NO Elements/Types of the category OST_RailingTopRailAboveCut.
NO Elements/Types of the category OST_RailingTermination.
NO Elements/Types of the category OST_RailingSupport.
Elements/Types of the category OST_RailingHandRail were successfully copied over.
Elements/Types of the category OST_RailingTopRail were successfully copied over.
NO Elements/Types of the category OST_StairsSketchPathLines.
NO Elements/Types of the category OST_StairsTriserNumbers.
NO Elements/Types of the category OST_StairsTriserTags.
NO Elements/Types of the category OST_StairsSupportTags.
NO Elements/Types of the category OST_StairsLandingTags.
NO Elements/Types of the category OST_StairsRunTags.
NO Elements/Types of the category OST_StairsPathsAboveCut.
Elements/Types of the category OST_StairsPaths were successfully copied over.
NO Elements/Types of the category OST_StairsRiserLinesAboveCut.
NO Elements/Types of the category OST_StairsRiserLines.
NO Elements/Types of the category OST_StairsOutlinesAboveCut.
NO Elements/Types of the category OST_StairsOutlines.
NO Elements/Types of the category OST_StairsNosingLinesAboveCut.
NO Elements/Types of the category OST_StairsNosingLines.
NO Elements/Types of the category OST_StairsCutMarksAboveCut.
Elements/Types of the category OST_StairsCutMarks were successfully copied over.
NO Elements/Types of the category OST_ComponentRepeaterSlot.
NO Elements/Types of the category OST_ComponentRepeater.
NO Elements/Types of the category OST_DividedPath.
NO Elements/Types of the category OST_IOSRoomCalculationPoint.
NO Elements/Types of the category OST_PropertySet.
NO Elements/Types of the category OST_AppearanceAsset.
NO Elements/Types of the category OST_StairStringer2012_Deprecated.
NO Elements/Types of the category OST_StairsTrisers.
Elements/Types of the category OST_StairsLandings were successfully copied over.
Elements/Types of the category OST_StairsRuns were successfully copied over.
NO Elements/Types of the category OST_Stair2012_Deprecated.
NO Elements/Types of the category OST_RailingSystemTags.
NO Elements/Types of the category OST_RailingSystemTransition.
NO Elements/Types of the category OST_RailingSystemTermination.
NO Elements/Types of the category OST_RailingSystemRail.
NO Elements/Types of the category OST_RailingSystemTopRail.
NO Elements/Types of the category OST_RailingSystemHandRailBracket.
NO Elements/Types of the category OST_RailingSystemHandRail.
NO Elements/Types of the category OST_RailingSystemHardware.
NO Elements/Types of the category OST_RailingSystemPanel.
NO Elements/Types of the category OST_RailingSystemBaluster.
NO Elements/Types of the category OST_RailingSystemPost.
NO Elements/Types of the category OST_RailingSystemSegment.
NO Elements/Types of the category OST_RailingSystem.
NO Elements/Types of the category OST_AdaptivePoints_HiddenLines.
NO Elements/Types of the category OST_AdaptivePoints_Lines.
NO Elements/Types of the category OST_AdaptivePoints_Planes.
NO Elements/Types of the category OST_AdaptivePoints_Points.
NO Elements/Types of the category OST_AdaptivePoints.
NO Elements/Types of the category OST_CeilingOpening.
NO Elements/Types of the category OST_FloorOpening.
NO Elements/Types of the category OST_RoofOpening.
NO Elements/Types of the category OST_WallRefPlanes.
NO Elements/Types of the category OST_StructLocationLineControl.
NO Elements/Types of the category OST_DimLockControlLeader.
NO Elements/Types of the category OST_MEPSpaceSeparationLines.
NO Elements/Types of the category OST_AreaPolylines.
NO Elements/Types of the category OST_RoomPolylines.
NO Elements/Types of the category OST_InstanceDrivenLineStyle.
NO Elements/Types of the category OST_RemovedGridSeg.
NO Elements/Types of the category OST_IOSOpening.
NO Elements/Types of the category OST_IOSTilePatternGrid.
NO Elements/Types of the category OST_ControlLocal.
NO Elements/Types of the category OST_ControlAxisZ.
NO Elements/Types of the category OST_ControlAxisY.
NO Elements/Types of the category OST_ControlAxisX.
NO Elements/Types of the category OST_XRayConstrainedProfileEdge.
NO Elements/Types of the category OST_XRayImplicitPathCurve.
NO Elements/Types of the category OST_XRayPathPoint.
NO Elements/Types of the category OST_XRayPathCurve.
NO Elements/Types of the category OST_XRaySideEdge.
NO Elements/Types of the category OST_XRayProfileEdge.
NO Elements/Types of the category OST_ReferencePoints_HiddenLines.
NO Elements/Types of the category OST_ReferencePoints_Lines.
NO Elements/Types of the category OST_ReferencePoints_Planes.
NO Elements/Types of the category OST_ReferencePoints_Points.
NO Elements/Types of the category OST_ReferencePoints.
Elements/Types of the category OST_Materials were successfully copied over.
NO Elements/Types of the category OST_CeilingsCutPattern.
NO Elements/Types of the category OST_CeilingsDefault.
NO Elements/Types of the category OST_CeilingsFinish2.
NO Elements/Types of the category OST_CeilingsFinish1.
NO Elements/Types of the category OST_CeilingsSubstrate.
NO Elements/Types of the category OST_CeilingsInsulation.
NO Elements/Types of the category OST_CeilingsStructure.
NO Elements/Types of the category OST_CeilingsMembrane.
NO Elements/Types of the category OST_FloorsInteriorEdges.
NO Elements/Types of the category OST_FloorsCutPattern.
NO Elements/Types of the category OST_HiddenFloorLines.
NO Elements/Types of the category OST_FloorsDefault.
NO Elements/Types of the category OST_FloorsFinish2.
NO Elements/Types of the category OST_FloorsFinish1.
NO Elements/Types of the category OST_FloorsSubstrate.
NO Elements/Types of the category OST_FloorsInsulation.
NO Elements/Types of the category OST_FloorsStructure.
NO Elements/Types of the category OST_FloorsMembrane.
NO Elements/Types of the category OST_RoofsInteriorEdges.
NO Elements/Types of the category OST_RoofsCutPattern.
NO Elements/Types of the category OST_RoofsDefault.
NO Elements/Types of the category OST_RoofsFinish2.
NO Elements/Types of the category OST_RoofsFinish1.
NO Elements/Types of the category OST_RoofsSubstrate.
NO Elements/Types of the category OST_RoofsInsulation.
NO Elements/Types of the category OST_RoofsStructure.
NO Elements/Types of the category OST_RoofsMembrane.
NO Elements/Types of the category OST_WallsCutPattern.
NO Elements/Types of the category OST_HiddenWallLines.
NO Elements/Types of the category OST_WallsDefault.
NO Elements/Types of the category OST_WallsFinish2.
NO Elements/Types of the category OST_WallsFinish1.
NO Elements/Types of the category OST_WallsSubstrate.
NO Elements/Types of the category OST_WallsInsulation.
NO Elements/Types of the category OST_WallsStructure.
NO Elements/Types of the category OST_WallsMembrane.
Elements/Types of the category OST_PreviewLegendComponents were successfully copied over.
NO Elements/Types of the category OST_LegendComponents.
NO Elements/Types of the category OST_ScheduleGraphics.
NO Elements/Types of the category OST_RasterImages.
Elements/Types of the category OST_ColorFillSchema were successfully copied over.
NO Elements/Types of the category OST_RoomColorFill.
Elements/Types of the category OST_ColorFillLegends were successfully copied over.
NO Elements/Types of the category OST_AnnotationCropSpecial.
NO Elements/Types of the category OST_CropBoundarySpecial.
NO Elements/Types of the category OST_AnnotationCrop.
NO Elements/Types of the category OST_FloorsAnalyticalGeometry.
NO Elements/Types of the category OST_WallsAnalyticalGeometry.
NO Elements/Types of the category OST_CalloutLeaderLine.
NO Elements/Types of the category OST_CeilingsSurfacePattern.
NO Elements/Types of the category OST_RoofsSurfacePattern.
NO Elements/Types of the category OST_FloorsSurfacePattern.
NO Elements/Types of the category OST_WallsSurfacePattern.
NO Elements/Types of the category OST_CalloutBoundary.
NO Elements/Types of the category OST_CalloutHeads.
NO Elements/Types of the category OST_Callouts.
NO Elements/Types of the category OST_CropBoundary.
NO Elements/Types of the category OST_Elev.
NO Elements/Types of the category OST_AxisZ.
NO Elements/Types of the category OST_AxisY.
NO Elements/Types of the category OST_AxisX.
NO Elements/Types of the category OST_CLines.
NO Elements/Types of the category OST_Lights.
NO Elements/Types of the category OST_ViewportLabel.
NO Elements/Types of the category OST_Viewports.
NO Elements/Types of the category OST_Camera_Lines.
NO Elements/Types of the category OST_Cameras.
NO Elements/Types of the category OST_MEPSpaceTags.
NO Elements/Types of the category OST_RoomTags.
NO Elements/Types of the category OST_DoorTags.
NO Elements/Types of the category OST_WindowTags.
NO Elements/Types of the category OST_SectionHeadWideLines.
NO Elements/Types of the category OST_SectionHeadMediumLines.
NO Elements/Types of the category OST_SectionHeadThinLines.
NO Elements/Types of the category OST_SectionHeads.
NO Elements/Types of the category OST_ContourLabels.
NO Elements/Types of the category OST_CurtaSystemFaceManager.
Elements/Types of the category OST_CurtaSystem were successfully copied over.
NO Elements/Types of the category OST_AreaReport_Arc_Minus.
NO Elements/Types of the category OST_AreaReport_Arc_Plus.
NO Elements/Types of the category OST_AreaReport_Boundary.
NO Elements/Types of the category OST_AreaReport_Triangle.
NO Elements/Types of the category OST_CurtainGridsCurtaSystem.
NO Elements/Types of the category OST_CurtainGridsSystem.
NO Elements/Types of the category OST_CurtainGridsWall.
NO Elements/Types of the category OST_CurtainGridsRoof.
NO Elements/Types of the category OST_DetailArray.
NO Elements/Types of the category OST_ModelArray.
NO Elements/Types of the category OST_HostFinHF.
NO Elements/Types of the category OST_HostFinWall.
NO Elements/Types of the category OST_HostFinCeiling.
NO Elements/Types of the category OST_HostFinRoof.
NO Elements/Types of the category OST_HostFinFloor.
NO Elements/Types of the category OST_HostFin.
NO Elements/Types of the category OST_AnalysisDisplayStyle.
NO Elements/Types of the category OST_AnalysisResults.
NO Elements/Types of the category OST_RenderRegions.
NO Elements/Types of the category OST_SectionBox.
NO Elements/Types of the category OST_TextNotes.
NO Elements/Types of the category OST_Divisions.
NO Elements/Types of the category OST_Catalogs.
NO Elements/Types of the category OST_DirectionEdgeLines.
NO Elements/Types of the category OST_CenterLines.
NO Elements/Types of the category OST_LinesBeyond.
NO Elements/Types of the category OST_HiddenLines.
NO Elements/Types of the category OST_DemolishedLines.
NO Elements/Types of the category OST_OverheadLines.
NO Elements/Types of the category OST_TitleBlockWideLines.
NO Elements/Types of the category OST_TitleBlockMediumLines.
NO Elements/Types of the category OST_TitleBlockThinLines.
NO Elements/Types of the category OST_TitleBlocks.
Elements/Types of the category OST_Views were successfully copied over.
NO Elements/Types of the category OST_Viewers.
NO Elements/Types of the category OST_PartHiddenLines.
NO Elements/Types of the category OST_PartTags.
NO Elements/Types of the category OST_Parts.
NO Elements/Types of the category OST_AssemblyTags.
NO Elements/Types of the category OST_Assemblies.
NO Elements/Types of the category OST_RoofTags.
NO Elements/Types of the category OST_SpotSlopes.
NO Elements/Types of the category OST_SpotCoordinates.
NO Elements/Types of the category OST_SpotElevations.
NO Elements/Types of the category OST_Constraints.
NO Elements/Types of the category OST_WeakDims.
NO Elements/Types of the category OST_Dimensions.
NO Elements/Types of the category OST_DatumLevels.
Elements/Types of the category OST_Levels were successfully copied over.
NO Elements/Types of the category OST_DisplacementPath.
NO Elements/Types of the category OST_DisplacementElements.
NO Elements/Types of the category OST_GridChains.
Elements/Types of the category OST_Grids were successfully copied over.
NO Elements/Types of the category OST_BrokenSectionLine.
NO Elements/Types of the category OST_SectionLine.
NO Elements/Types of the category OST_Sections.
NO Elements/Types of the category OST_ReferenceViewer.
NO Elements/Types of the category OST_ReferenceViewerSymbol.
NO Elements/Types of the category OST_ImportObjectStyles.
NO Elements/Types of the category OST_ModelText.
NO Elements/Types of the category OST_MaskingRegion.
NO Elements/Types of the category OST_Matchline.
NO Elements/Types of the category OST_FaceSplitter.
NO Elements/Types of the category OST_PlanRegion.
NO Elements/Types of the category OST_FilledRegion.
NO Elements/Types of the category OST_MassingProjectionOutlines.
NO Elements/Types of the category OST_MassingCutOutlines.
NO Elements/Types of the category OST_Massing.
Elements/Types of the category OST_Reveals were successfully copied over.
Elements/Types of the category OST_Cornices were successfully copied over.
Elements/Types of the category OST_Ramps were successfully copied over.
NO Elements/Types of the category OST_RailingBalusterRailCut.
NO Elements/Types of the category OST_RailingBalusterRail.
NO Elements/Types of the category OST_Railings.
NO Elements/Types of the category OST_CurtainGrids.
NO Elements/Types of the category OST_CurtainWallMullionsCut.
Elements/Types of the category OST_CurtainWallMullions were successfully copied over.
Elements/Types of the category OST_CurtainWallPanels were successfully copied over.
NO Elements/Types of the category OST_AreaReference.
NO Elements/Types of the category OST_AreaInteriorFill.
NO Elements/Types of the category OST_RoomReference.
NO Elements/Types of the category OST_RoomInteriorFill.
NO Elements/Types of the category OST_AreaColorFill.
NO Elements/Types of the category OST_AreaReferenceVisibility.
NO Elements/Types of the category OST_AreaInteriorFillVisibility.
NO Elements/Types of the category OST_RoomReferenceVisibility.
NO Elements/Types of the category OST_RoomInteriorFillVisibility.
NO Elements/Types of the category OST_Rooms.
Elements/Types of the category OST_GenericModel were successfully copied over.
NO Elements/Types of the category OST_GenericAnnotation.
NO Elements/Types of the category OST_Fixtures.
NO Elements/Types of the category OST_StairsRailingTags.
NO Elements/Types of the category OST_StairsRailingAboveCut.
NO Elements/Types of the category OST_StairsDownArrows.
NO Elements/Types of the category OST_StairsUpArrows.
NO Elements/Types of the category OST_StairsDownText.
NO Elements/Types of the category OST_StairsRailingRail.
NO Elements/Types of the category OST_StairsRailingBaluster.
Elements/Types of the category OST_StairsRailing were successfully copied over.
NO Elements/Types of the category OST_StairsUpText.
NO Elements/Types of the category OST_StairsSupportsAboveCut.
Elements/Types of the category OST_StairsStringerCarriage were successfully copied over.
NO Elements/Types of the category OST_StairsAboveCut_ToBeDeprecated.
NO Elements/Types of the category OST_StairsIncomplete_Deprecated.
Elements/Types of the category OST_Stairs were successfully copied over.
NO Elements/Types of the category OST_IOSNavWheelPivotBall.
NO Elements/Types of the category OST_IOSRoomComputationHeight.
NO Elements/Types of the category OST_IOSRoomUpperLowerLines.
NO Elements/Types of the category OST_IOSDragBoxInverted.
NO Elements/Types of the category OST_IOSDragBox.
Error when copying elements/types of the category OST_Phases.
Elements/Types of the category OST_IOS_GeoSite were successfully copied over.
Elements/Types of the category OST_IOS_GeoLocations were successfully copied over.
NO Elements/Types of the category OST_IOSFabricReinSpanSymbolCtrl.
NO Elements/Types of the category OST_GuideGrid.
NO Elements/Types of the category OST_EPS_Future.
NO Elements/Types of the category OST_EPS_Temporary.
NO Elements/Types of the category OST_EPS_New.
NO Elements/Types of the category OST_EPS_Demolished.
NO Elements/Types of the category OST_EPS_Existing.
NO Elements/Types of the category OST_IOSMeasureLineScreenSize.
NO Elements/Types of the category OST_Columns.
NO Elements/Types of the category OST_IOSRebarSystemSpanSymbolCtrl.
NO Elements/Types of the category OST_IOSRoomTagToRoomLines.
NO Elements/Types of the category OST_IOSAttachedDetailGroups.
NO Elements/Types of the category OST_IOSDetailGroups.
NO Elements/Types of the category OST_IOSModelGroups.
NO Elements/Types of the category OST_IOSSuspendedSketch.
NO Elements/Types of the category OST_IOSWallCoreBoundary.
NO Elements/Types of the category OST_IOSMeasureLine.
NO Elements/Types of the category OST_IOSArrays.
NO Elements/Types of the category OST_Curtain_Systems.
NO Elements/Types of the category OST_IOSBBoxScreenSize.
NO Elements/Types of the category OST_IOSSlabShapeEditorPointInterior.
NO Elements/Types of the category OST_IOSSlabShapeEditorPointBoundary.
NO Elements/Types of the category OST_IOSSlabShapeEditorBoundary.
NO Elements/Types of the category OST_IOSSlabShapeEditorAutoCrease.
NO Elements/Types of the category OST_IOSSlabShapeEditorExplitCrease.
NO Elements/Types of the category OST_ReferenceLines.
NO Elements/Types of the category OST_IOSNotSilhouette.
NO Elements/Types of the category OST_FillPatterns.
NO Elements/Types of the category OST_Furniture.
NO Elements/Types of the category OST_AreaSchemeLines.
NO Elements/Types of the category OST_GenericLines.
NO Elements/Types of the category OST_InsulationLines.
NO Elements/Types of the category OST_CloudLines.
NO Elements/Types of the category OST_IOSRoomPerimeterLines.
NO Elements/Types of the category OST_IOSCuttingGeometry.
NO Elements/Types of the category OST_IOSCrashGraphics.
NO Elements/Types of the category OST_IOSGroups.
NO Elements/Types of the category OST_IOSGhost.
NO Elements/Types of the category OST_StairsSketchLandingCenterLines.
NO Elements/Types of the category OST_StairsSketchRunLines.
NO Elements/Types of the category OST_StairsSketchRiserLines.
NO Elements/Types of the category OST_StairsSketchBoundaryLines.
NO Elements/Types of the category OST_RoomSeparationLines.
NO Elements/Types of the category OST_AxisOfRotation.
NO Elements/Types of the category OST_InvisibleLines.
NO Elements/Types of the category OST_IOSThinPixel_DashDot.
NO Elements/Types of the category OST_IOSThinPixel_Dash.
NO Elements/Types of the category OST_IOSThinPixel_Dot.
NO Elements/Types of the category OST_Extrusions.
NO Elements/Types of the category OST_IOS.
NO Elements/Types of the category OST_CutOutlines.
NO Elements/Types of the category OST_IOSThinPixel.
NO Elements/Types of the category OST_IOSFlipControl.
Error when copying elements/types of the category OST_IOSSketchGrid.
NO Elements/Types of the category OST_IOSSuspendedSketch_obsolete.
NO Elements/Types of the category OST_IOSFreeSnapLine.
NO Elements/Types of the category OST_IOSDatumPlane.
NO Elements/Types of the category OST_Lines.
NO Elements/Types of the category OST_IOSConstructionLine.
NO Elements/Types of the category OST_IOSAlignmentGraphics.
NO Elements/Types of the category OST_IOSAligningLine.
NO Elements/Types of the category OST_IOSBackedUpElements.
NO Elements/Types of the category OST_IOSRegeneratedElements.
NO Elements/Types of the category OST_SketchLines.
NO Elements/Types of the category OST_CurvesWideLines.
NO Elements/Types of the category OST_CurvesMediumLines.
NO Elements/Types of the category OST_CurvesThinLines.
NO Elements/Types of the category OST_Curves.
NO Elements/Types of the category OST_CeilingsProjection.
NO Elements/Types of the category OST_CeilingsCut.
Elements/Types of the category OST_Ceilings were successfully copied over.
NO Elements/Types of the category OST_RoofsProjection.
NO Elements/Types of the category OST_RoofsCut.
Elements/Types of the category OST_Roofs were successfully copied over.
NO Elements/Types of the category OST_FloorsProjection.
NO Elements/Types of the category OST_FloorsCut.
Elements/Types of the category OST_Floors were successfully copied over.
NO Elements/Types of the category OST_DoorsGlassProjection.
NO Elements/Types of the category OST_DoorsGlassCut.
NO Elements/Types of the category OST_DoorsFrameMullionProjection.
NO Elements/Types of the category OST_DoorsFrameMullionCut.
NO Elements/Types of the category OST_DoorsOpeningProjection.
NO Elements/Types of the category OST_DoorsOpeningCut.
NO Elements/Types of the category OST_DoorsPanelProjection.
NO Elements/Types of the category OST_DoorsPanelCut.
NO Elements/Types of the category OST_Doors.
NO Elements/Types of the category OST_WindowsOpeningProjection.
NO Elements/Types of the category OST_WindowsOpeningCut.
NO Elements/Types of the category OST_WindowsSillHeadProjection.
NO Elements/Types of the category OST_WindowsSillHeadCut.
NO Elements/Types of the category OST_WindowsFrameMullionProjection.
NO Elements/Types of the category OST_WindowsFrameMullionCut.
NO Elements/Types of the category OST_WindowsGlassProjection.
NO Elements/Types of the category OST_WindowsGlassCut.
NO Elements/Types of the category OST_Windows.
NO Elements/Types of the category OST_WallsProjectionOutlines.
NO Elements/Types of the category OST_WallsCutOutlines.
Elements/Types of the category OST_Walls were successfully copied over.
NO Elements/Types of the category OST_IOSRegenerationFailure.
NO Elements/Types of the category OST_ScheduleViewParamGroup.
The category OST_MatchSiteComponent cannot be filtered.
The category OST_MatchProfile cannot be filtered.
The category OST_MatchDetail cannot be filtered.
The category OST_MatchAnnotation cannot be filtered.
The category OST_MatchModel cannot be filtered.
The category OST_MatchAll cannot be filtered.
Error when copying elements/types of the category INVALID.

We can safely conclude from the above messages that at least these elements/types prevent projects from properly merging.
OST_SunStudy
OST_HVAC_Zones
OST_StackedWalls
OST_SharedBasePoint
OST_ProjectBasePoint
OST_Phases
OST_IOSSketchGrid

As a side note, the ElementTransformUtils.CopyElements() is found not efficient. During copying and pasting the Revit UI flashes a lot. It seems a lot of notifications are being sent from here and there as well, thus the performance of the merging operation is not good enough. For only a couple of walls in the source project, it would take a few minutes to get the merge done.  

Revit Addin Wizard (RevitAddinWizard) provides various wizards, coders and widgets to help program Revit addins. It can be downloaded from the Download link at the bottom of the blog index page.

Revit .NET: A Better Version of the Project Merge Command

$
0
0

Previously, we finally worked out a working version of the command merging two Revit projects. However, during its running, the Duplicate Types dialogs as follows would come up repeatedly to interrupt the merging process.
 
In addition to the UI flashing, it makes the project merging more inefficient. Is there a way to suppress the Duplicate Types dialog from showing up in the merging/copying process?

Yes, there is. We can derive a class from the IDuplicateTypeNamesHandler interface, create an instance of it, assign the instance to the CopyPasteOptions object and pass the object as the last argument to the ElementTransformUtils.CopyElements() call. Here we go.

    public class IgoreDuplicateTypeNames : IDuplicateTypeNamesHandler
    {
        public DuplicateTypeAction OnDuplicateTypeNamesFound(DuplicateTypeNamesHandlerArgs args)
        {
            return DuplicateTypeAction.UseDestinationTypes;
        }
    }


using (StreamWriter sw = new StreamWriter(@"c:\temp\MergeProjects.txt"))
{
    using (Autodesk.Revit.DB.Document doc = CachedApp.OpenDocumentFile(@"c:\temp\test.rvt"))
    {
        using (Autodesk.Revit.DB.Transaction trans = new Autodesk.Revit.DB.Transaction(CachedDoc, "MergeProjects6"))
        {
            trans.Start();

            foreach (BuiltInCategory biCat in Enum.GetValues(typeof(BuiltInCategory)))
            {
                FilteredElementCollector finalCollector = new FilteredElementCollector(doc);
                try
                {
                    ElementCategoryFilter filter1 = new ElementCategoryFilter(biCat);
                    finalCollector.WherePasses(filter1);
                }
                catch
                {
                    sw.WriteLine(string.Format("The category {0} cannot be filtered.", biCat));
                    continue;
                };
                ICollection<ElementId> ids = finalCollector.ToElementIds();

                CopyPasteOptions cpOpts = new CopyPasteOptions();
                cpOpts.SetDuplicateTypeNamesHandler(new IgoreDuplicateTypeNames());
                try
                {
                    if (ids.Count > 0)
                    {
                        ElementTransformUtils.CopyElements(doc, ids, CachedDoc, Autodesk.Revit.DB.Transform.Identity, cpOpts);
                        sw.WriteLine(string.Format("Elements/Types of the category {0} were successfully copied over.", biCat));
                    }
                    else
                        sw.WriteLine(string.Format("NO Elements/Types of the category {0}.", biCat));
                }
                catch
                {
                    sw.WriteLine(string.Format("Error when copying elements/types of the category {0}.", biCat));
                }
            }

            trans.Commit();
        }
    }

    sw.Close();
}

Enjoy!

Revit Addin Wizard (RevitAddinWizard) provides various wizards, coders and widgets to help program Revit addins. It can be downloaded from the Download link at the bottom of the blog index page.

Revit .NET: A Better Version of the Project Merge Command

$
0
0

Previously, we finally worked out a working version of the command which can merge two Revit projects. However, during its running the Duplicate Types dialogs would come up repeatedly to interrupt the merging process.

  DuplicateTypesDuringCopying

It's more annoying than the UI flashing. It also makes the project merging far less efficient and man dependent. Is there a way to suppress the Duplicate Types dialog from showing up in the merging/copying process?

Yes, there is. We can derive a class from the IDuplicateTypeNamesHandler interface, create an instance of it, assign the instance to the CopyPasteOptions object and pass the object as the last argument to the ElementTransformUtils.CopyElements() call. Here we go.

    public class IgoreDuplicateTypeNames : IDuplicateTypeNamesHandler
    {
        public DuplicateTypeAction OnDuplicateTypeNamesFound(DuplicateTypeNamesHandlerArgs args)
        {
            return DuplicateTypeAction.UseDestinationTypes;
        }
    }


using (StreamWriter sw = new StreamWriter(@"c:\temp\MergeProjects.txt"))
{
    using (Autodesk.Revit.DB.Document doc = CachedApp.OpenDocumentFile(@"c:\temp\test.rvt"))
    {
        using (Autodesk.Revit.DB.Transaction trans = new Autodesk.Revit.DB.Transaction(CachedDoc, "MergeProjects6"))
        {
            trans.Start();

            foreach (BuiltInCategory biCat in Enum.GetValues(typeof(BuiltInCategory)))
            {
                FilteredElementCollector finalCollector = new FilteredElementCollector(doc);
                try
                {
                    ElementCategoryFilter filter1 = new ElementCategoryFilter(biCat);
                    finalCollector.WherePasses(filter1);
                }
                catch
                {
                    sw.WriteLine(string.Format("The category {0} cannot be filtered.", biCat));
                    continue;
                };
                ICollection<ElementId> ids = finalCollector.ToElementIds();

                CopyPasteOptions cpOpts = new CopyPasteOptions();
                cpOpts.SetDuplicateTypeNamesHandler(new IgoreDuplicateTypeNames());
                try
                {
                    if (ids.Count > 0)
                    {
                        ElementTransformUtils.CopyElements(doc, ids, CachedDoc, Autodesk.Revit.DB.Transform.Identity, cpOpts);
                        sw.WriteLine(string.Format("Elements/Types of the category {0} were successfully copied over.", biCat));
                    }
                    else
                        sw.WriteLine(string.Format("NO Elements/Types of the category {0}.", biCat));
                }
                catch
                {
                    sw.WriteLine(string.Format("Error when copying elements/types of the category {0}.", biCat));
                }
            }

            trans.Commit();
        }
    }

    sw.Close();
}

Enjoy!

Revit Addin Wizard (RevitAddinWizard) provides various wizards, coders and widgets to help program Revit addins. It can be downloaded from the Download link at the bottom of the blog index page.

Revit .NET: Non-Filterable Revit Categories

$
0
0

We found out some Categories of Revit are not filterable as a side product when working on something else recently. It pretty surprised us. What about you?

It’s easy to sort out what Revit categories are not filterable. Here we go.

    using (StreamWriter sw = new StreamWriter(@"c:\temp\CategoriesCannotBeFiltered.txt"))
    {
        foreach (BuiltInCategory biCat in Enum.GetValues(typeof(BuiltInCategory)))
        {
            if (biCat != BuiltInCategory.INVALID)
            {
                FilteredElementCollector finalCollector = new FilteredElementCollector(CachedDoc);
                try
                {
                    ElementCategoryFilter filter1 = new ElementCategoryFilter(biCat);
                    finalCollector.WherePasses(filter1);
                }
                catch (Exception ex)
                {
                    sw.WriteLine(biCat + ": " + ex.Message);
                    continue;
                }
            }
        }
        sw.Close();
    }

Here is the output.

OST_MatchSiteComponent: The category was not valid for filtering.
Parameter name: categoryId
OST_MatchProfile: The category was not valid for filtering.
Parameter name: categoryId
OST_MatchDetail: The category was not valid for filtering.
Parameter name: categoryId
OST_MatchAnnotation: The category was not valid for filtering.
Parameter name: categoryId
OST_MatchModel: The category was not valid for filtering.
Parameter name: categoryId
OST_MatchAll: The category was not valid for filtering.
Parameter name: categoryId

So, the categories with the built-in category ids as OST_MatchSiteComponent, OST_MatchProfile, OST_MatchDetail, OST_MatchAnnotation, OST_MatchModel, and OST_MatchAll are not filterable (i.e. not valid for filtering). Not sure why only these few are not filterable, but it sounds good for us to keep them in mind when doing something like filtering or categorizing Revit elements.

Revit Addin Wizard (RevitAddinWizard) provides various wizards, coders and widgets to help program Revit addins. It can be downloaded from the Download link at the bottom of the blog index page.


Revit .NET API: Custom Drag & Drop - UIApplication.DoDragDrop & IDropHandler (pt. 11 Merge Projects)

$
0
0

Revit .NET has provided the Drag & Drop API (UIApplication.DoDragDrop) since version 2013. In this series of posts, we are going to explore the Revit Drag & Drop .NET API (UIApplication.DoDragDrop) case by case.

In this case, let’s merge the Revit project (.rvt file) as dragged & dropped with the current project rather than open the project as the standard drag & drop behaves.
The Revit .NET Drag & Drop API provides another mechanism to support custom drag & drop behavior. More specifically, another signature of the Autodesk.Revit.UI.UIApplication.DoDragDrop() method and the IDropHandler interface come to rescue.

•    Add a TextBox to the WPF Window and make it the dragging source.
        <TextBox Height="23" Text="C:\TEMP\ToMerge.rvt" HorizontalAlignment="Left" Margin="12,226,0,0" Name="textBox1" VerticalAlignment="Top" Width="254" MouseMove="textBox1_MouseMove" />

•    Implement the MouseMove event callback as follows into the Window1 class to make the WPF element as the drag & drop source,  the Revit window as the drag & drop target, and our custom drag & drop handler as the action:
        private void textBox1_MouseMove(object sender, MouseEventArgs e)
        {
            if (e.LeftButton == MouseButtonState.Pressed)
            {
                MergeProjectDropHandler dropHandler = new MergeProjectDropHandler();
                Autodesk.Revit.UI.UIApplication.DoDragDrop((sender as System.Windows.Controls.TextBox).Text, dropHandler);
            }
        }
•    Implement the custom IDropHandler interface as follows:
    public class MergeProjectDropHandler : Autodesk.Revit.UI.IDropHandler
    {
        public class IgoreDuplicateTypeNames : IDuplicateTypeNamesHandler
        {
            public DuplicateTypeAction OnDuplicateTypeNamesFound(DuplicateTypeNamesHandlerArgs args)
            {
                return DuplicateTypeAction.UseDestinationTypes;
            }
        }

        public void Execute(Autodesk.Revit.UI.UIDocument document, object data)
        {
            using (Autodesk.Revit.DB.Document doc = document.Application.Application.OpenDocumentFile((string)data))
            {
                using (Autodesk.Revit.DB.Transaction trans = new Autodesk.Revit.DB.Transaction(document.Document, "MergeProjectsByDragNDrop"))
                {
                    trans.Start();

                    CopyPasteOptions cpOpts = new CopyPasteOptions();
                    cpOpts.SetDuplicateTypeNamesHandler(new IgoreDuplicateTypeNames());
                    foreach (BuiltInCategory biCat in Enum.GetValues(typeof(BuiltInCategory)))
                    {
                        FilteredElementCollector finalCollector = new FilteredElementCollector(doc);
                        try
                        {
                            ICollection<ElementId> ids = finalCollector.WherePasses(new ElementCategoryFilter(biCat)).ToElementIds();
                            if (ids.Count > 0)
                                ElementTransformUtils.CopyElements(doc, ids, document.Document, Autodesk.Revit.DB.Transform.Identity, cpOpts);
                        }
                        catch { }
                    }

                    trans.Commit();
                }
            }
        }
    }

•    Make sure the following code is still in the Execute of the external command class:
                Window1 win = new Window1();
                win.Show();

In case wondering about the category filtering code and element copying code are wrapped into a try/catch block, please refer to earlier posts for details. The basic idea is that they may fail for some categories and elements without good a reason.

In our case, the current Revit project has some columns only and the external model has some walls. After the projects being merged through the drag & drop from the newly added TextBox into the WPF sample window, the current model may look something as follows.
MergedProjects
 
Revit Addin Wizard (RevitAddinWizard) provides various wizards, coders and widgets to help program Revit addins. It can be downloaded from the Download link at the bottom of the blog index page.

Revit .NET: (External)Definition IsReadOnly vs. UserModifiable

$
0
0

When we were migrating Revit .NET Addin Wizard (RevitNetAddinWizard) to support more Revit API versions such as 2015 and Visual Studio ones such as (2012 and 2013), we noticed an interesting stuff. The IsReadOnly property was removed from both the Definition class and the ExternalDefinition in both version 2014 and 2015, but the new UserModifiable property was added to the ExternalDefinition class only in version 2015 only.

The following code and comments would make it clear if being tried in all the three popular versions of Revit, 2013/2014/2015.

        public void DefinitionReadOnlyAndUserModifiable(RvtDocument doc)
        {
            BindingMap map = doc.ParameterBindings;
            DefinitionBindingMapIterator it = map.ForwardIterator();
            ElementBinding eleBinding = it.Current as ElementBinding;
            InstanceBinding insBinding = eleBinding as InstanceBinding;
            Definition def = it.Key;
            if (def != null)
            {
                ExternalDefinition extDef = def as ExternalDefinition;
                
                bool shared = extDef != null;
                bool readOnly1 = def.IsReadOnly;                //NOT working in either 2015 or 2014 but working in 2013

                if (shared)
                {
                    bool readOnly2 = extDef.IsReadOnly;         //NOT working in either 2015 or 2014 but working in 2013
                    bool modifiable = extDef.UserModifiable;    //working in 2015 ONLY
                }
            }
        }

So, it seems no way to determine whether a parameter definition is read only or modifiable in Revit 2014 without the parameter (external) definition being instanced, i.e. such a parameter has already been created into the model and used by some elements either manually or programmatically. It is not good because many times we need to check whether the parameter definition is readable only or also writable so as to determine to use it or not, or create a new one.

That might explain why the UserModifiable was finally added to the ExternalDefinition. But still we are wondering why NOT to the Definition class this time. Does it indicate that non-shared parameters will be always modifiable?   

Even if for the new property UserModifiable, its meaning is not exactly the opposite of the IsReadOnly, which fact is clearly stated in the API documentation:

“Note that for shared parameters IsReadOnly can return false for shared parameters whose UserModifiable property is also false, because the value of those parameters can be modified by the API. If a parameter is governed by a formula, IsReadOnly would return true, even if the flag for UserModifiable was set to true when the shared parameter was created.”

It is still a bit weird though that a read-only parameter can be user modifiable. Does it indicate that users have more privilege over parameters than the Revit addin itself (or the Revit API with which it’s created) that creates and maintains the parameters?

It seems the UserModifiable and IsReadOnly mean different things anyway, then doesn't it make sense to add the UnserModifiable to the Definition class as well and add the IsReadOnly back to both?

Revit Addin Wizard (RevitAddinWizard) provides various wizards, coders and widgets to help program Revit addins. It can be downloaded from the Download link at the bottom of the blog index page.

An Inconsistency In the Major Version Number of Revit 2015

$
0
0

We recently spotted an inconsistency in the major version number of Revit 2015. Revit 2015 has a major version number 15 that is 2 more greater than the one of 2014 (13) instead of the common and normal increment 1 as before (12 for 2013, 11 for 2012, …).

Here are the major version numbers along with minor version numbers, build numbers, and Revit display versions.

Revit Architecture 2012:
    2012 (11.03.09231)
Revit Architecture 2014:
    2013 (12.02.21203)
Revit Architecture 2014:
    2014 (13.03.08151)
Revit Architecture 2015:
    2015 (15.0.207.0)

The inconsistency should not affect Revit users since they don’t care about the internal major or minor version numbers, but for Revit developers, it means a lot. The existing mapping algorithm from internal major version (which is registry or file related) to display version (which is commonly used) does not work anymore. Not a big deal though. Since the inconsistency being sorted out, a patch has been made to the algorithm.

Wondered why the big jump for the major version number of Revit 2015 from the previous version. Any ideas from anybody?

Ribbon Creator of Revit .NET Addin Wizard (Standard or Pro)

$
0
0

The Revit Ribbon Creator of Revit .NET Addin Wizard (Standard or Pro) has been there for long time, but it may not be widely used or even known yet. The coder can help Revit programmers define and create various Revit ribbon elements and all possible combinations quickly and reliably. Since many people may be looking for something like it, here we put together some posts that introduced various features of the Revit Ribbon Creator before.

Ribbon Creator – 1: PushButton and Separator
Ribbon Creator – 2: TextBox
Ribbon Creator – 3: ComboBox and ComboBoxMember
Ribbon Creator – 4: RadioButtonGroup and ToggleButton
Ribbon Creator – 5: PulldownButton and PushButton
Ribbon Creator – 6: SplitButton and PushButton
Ribbon Creator – 7: SlideOut and Various Buttons
Ribbon Creator – 8: Stacked Group and PushButton
Ribbon Creator – 9: Stacked Group and TextBox
Ribbon Creator – 10: Stacked Group and PulldownButton
Ribbon Creator – 11: Stacked Group and ComboBox Items
Ribbon Creator – 12: Stacked Group and Various Items
Ribbon Creator – 13: A Comprehensive RibbonPanel
Ribbon Creator – 14: Access Ribbons From a Different AddIn
Ribbon Creator – 15: Update Ribbons From a Different AddIn

Revit .NET API Ribbon Creator: Schema of Revit Ribbon Definition
Ribbon Creator for Revit API: Manipulate Revit Ribbon Definition (RRD) Files
Ribbon Creator for Revit API: Edit Revit Ribbon Definition Rows
Ribbon Creator for Revit API: Revit Ribbon Definition – Context Menu
Ribbon Creator for Revit API: Revit Ribbon Definition – Undo and Redo
Ribbon Creator for Revit API: Revit Ribbon Definition – Tools and Options
Ribbon Creator for Revit .NET API Supports VB.NET


Each post may have links pointing to some insights behind the Revit Ribbon Creator.

Revit .NET Addin Wizard Pro (RevitNetAddinWizardPro) can be downloaded from the blog index page.

RevitNetAddinWizardPro

$
0
0

RevitNetAddinWizardPro (Revit .NET Addin Wizard Professional) has been worked out with months of effort.

The latest build of RevitNetAddinWizardPro (Revit .NET Addin Wizard Professional) can be downloaded from the following left image/link. If you find it useful (e.g. saving huge efforts, avoiding error-prone operations, sorting tricky issues quick and easy, debugging straightforwardly, coding more efficiently, etc.), please make a kind donation by clicking the following right image/link so that our resources could be expended a bit and you will get better and timelier products, services and contents. We appreciate it very much!

Download the latest RevitNetAddinWizardPro

                

Besides bug fixes, it has been enhanced dramatically and tested diligently to support all mainstream Visual Studio editions (such as Standard, Professional, Universe and Community) and versions (2013/2012/2010/2008). As always, it supports a variety of Revit flavors (such as Revit Architecture, Revit Structure, Revit MEP, and Revit Bundle) and many popular versions (2015/2014/2013/2012/2011/2010).

Please feel free to post comments or contact us should you have any concerns about RevitNetAddinWizardPro.

Viewing all 872 articles
Browse latest View live