I have created some nested families that have shared parameters so I can tag and schedule them. Everything works great until I try making assemblies. When I add these families to an assembly, the only way it will show is if I tab until each individual shared components is selected and add them individually. Is there any way to get a nested family to appear in an assembly with all of its components?
Solved! Go to Solution.
Solved by YarUnderoaker. Go to Solution.
Solved by YarUnderoaker. Go to Solution.
Solved by bjur. Go to Solution.
I ran into the same thing a while back. The only way to get them to show is to add each individual sub component. Kinda sucks, but thats the only way to make it work.
That kind of defeats the purpose of nested families doesn't it? You would think that there would be a setting to allow that to pass through to the assembly like what the "shared" parameter does.
Thank you for visiting our forum.
This issue was brought to our development team's attention.
I understand that this may not be the preferred workflow, so I am including the following link. It is setup for you to submit feature requests, or feedback, directly to our development team:
http://usa.autodesk.com/adsk/servlet/index?siteID=123112&id=1109794
Hello Fernanda,
I`m a master student developing nested components for formwork elements for revit in Brazil.
I`d like to know if is there any feature that solves this issue with assemblies and nested families. This would be very usefull for my design research metodology.
Sincerely,
I made a macros to quikly select subcomponent of current selection set.
public class SelectSubcomponents : IExternalCommand { public Autodesk.Revit.UI.Result Execute(ExternalCommandData revit, ref string message, ElementSet elements) { UIApplication app = revit.Application; Document doc = app.ActiveUIDocument.Document; Autodesk.Revit.UI.Selection.SelElementSet elementSet = app.ActiveUIDocument.Selection.Elements; Autodesk.Revit.UI.Selection.SelElementSet subSet = Autodesk.Revit.UI.Selection.SelElementSet.Create(); foreach (Element e in elementSet) { FamilyInstance fi = e as FamilyInstance; if (fi != null) { ICollection<ElementId> ids = fi.GetSubComponentIds(); if (ids.Count > 0) { foreach (ElementId id in ids) { Element sube = doc.GetElement(id); subSet.Add(sube); } } else subSet.Add(e); } else { AssemblyInstance ai = e as AssemblyInstance; if (ai != null) { ICollection<ElementId> ids = ai.GetMemberIds(); foreach (ElementId id in ids) { Element sube = doc.GetElement(id); subSet.Add(sube); } } else { Group g = e as Group; if (g != null) { ICollection<ElementId> ids = g.GetMemberIds(); foreach (ElementId id in ids) { Element sube = doc.GetElement(id); subSet.Add(sube); } } } } } app.ActiveUIDocument.Selection.Elements = subSet; return Autodesk.Revit.UI.Result.Succeeded; } }
What did you use to create this macro. I am a masters of family editing but have not gotten into the programming side yet.
Revit has three ways to create additional commands:
1) Visual Studio where can be writen add-ons.
2) BuiltIn environment where can be writen application level macros.
2) BuiltIn environment where can be writen document level macros.
Specifically, this code from my add-on for Revit.
To use builtin environment you may open Manage tab then click Macros manager.
I attach revit project with that document level macros as example. You may recreate it on application level for using it in any project.
Hello YarUnderoaker!
Thaks a lot for the code sample! This helped me a lot with what I was stuck for a very long time. Do you work with Revit API very deply? Do you have any interest to join me develop some add in`s for some design process I`ve been running through?
Where are you from? May we get in touch by e-mail?
sincerely,
Romeu Neiva
romeuneiva@gmail.com
Thanks for the file. I downloaded and opened it and found the macro but have never used a macro in Revit. How does it work?
Hello,
Could you help me include "line" elements in this macro? I have some nested families witch have some line details. I noticed that if I use the macro, this itens are not selected. However, I can select them manually. Therefore, I imagine there is a way to select them within this macro.
sincerely,
What exactly is this issue? I cannot reproduce the problem. You said the nested families have shared parameters, but you don't say if the nested families themselves are set to "shared".
Hello YarUnderoaker,
Actually I`d like to include in the selection of elements, the parent nested family. Because, as I said, I have some line elements annotated in that family that I need to appear in the assembly. However, I can only do this, when a I select manualy the main family. For example, I have a family of formwork panel in the strctural column category. Within this family, there are 2 other 2 families of the connection category. However the lines that I created, are from the structural column lines category. This lines will only appear in assemblies if I select the whole panel family.
Can you help me?
Model or annotation lines is not a subcomponent of complex family. Thay can not selected in project by pushing Tab key.
You have to make a separate family within lines and nest it to wormfork family. Then they will appear in assembly.
Hello guys and thank you for the discussion to the very same problem i have.
I have detailed(structural steel) my 4 project in revit and am in great need to settle this nested family dispute.
when i open the Rvt file the macro module has a rex x across the icon.
unfortunately the macrr Code above seems to not work in Revit 2015, some of the code is no longer valid in this version?
has anyone updated this yet. can someone post the updated code or send me an e-mail with it. thank you in advance.
Application macro for Revit 2015-2016
/* * Created by SharpDevelop. * User: YarUnaderoaker * Date: 30.01.2014 * Time: 18:36 * * To change this template use Tools | Options | Coding | Edit Standard Headers. */ using System; using Autodesk.Revit.UI; using Autodesk.Revit.DB; using Autodesk.Revit.UI.Selection; using System.Collections; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; using System.Windows.Forms; namespace Tools { [Autodesk.Revit.Attributes.Transaction(Autodesk.Revit.Attributes.TransactionMode.Manual)] [Autodesk.Revit.DB.Macros.AddInId("F7FF972A-EBB6-4EAB-9D4C-0F457FFB5F81")] public partial class ThisApplication { private void Module_Startup(object sender, EventArgs e) { } private void Module_Shutdown(object sender, EventArgs e) { } #region Revit Macros generated code private void InternalStartup() { this.Startup += new System.EventHandler(Module_Startup); this.Shutdown += new System.EventHandler(Module_Shutdown); } #endregion public void SelectSubCompnents() { Document doc = this.ActiveUIDocument.Document;
ICollection<ElementId> elementSet = this.ActiveUIDocument.Selection.GetElementIds();
ICollection<ElementId> subSet = new Collection<ElementId>();
foreach(ElementId id in elementSet)
{
Element e = doc.GetElement(id);
FamilyInstance fi = e as FamilyInstance;
if (fi != null)
{
ICollection<ElementId> ids = fi.GetSubComponentIds();
if (ids.Count > 0)
{
foreach(ElementId subId in ids)
{
subSet.Add(subId);
}
}
else subSet.Add(id);
}
else
{
AssemblyInstance ai = e as AssemblyInstance;
if (ai != null)
{
ICollection<ElementId> ids = ai.GetMemberIds();
foreach(ElementId subId in ids)
{
subSet.Add(subId);
}
}
else
{
Group g = e as Group;
if (g != null)
{
ICollection<ElementId> ids = g.GetMemberIds();
foreach(ElementId subId in ids)
{
subSet.Add(subId);
}
}
}
}
}
this.ActiveUIDocument.Selection.SetElementIds(subSet); } } }