Revit Structure Forum
Welcome to Autodesk’s Revit Structure Forums. Share your knowledge, ask questions, and explore popular Revit Structure topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Nested family with shared components not showing in assembly

40 REPLIES 40
SOLVED
Reply
Message 1 of 41
haydenwse
5360 Views, 40 Replies

Nested family with shared components not showing in assembly

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?

40 REPLIES 40
Message 2 of 41
bjur
in reply to: haydenwse

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.

Message 3 of 41
haydenwse
in reply to: haydenwse

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.

Message 4 of 41
fernanda.firman
in reply to: haydenwse

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



Fernanda Lima Firman
Technical Support Specialist
Customer Service & Support
Autodesk, Inc.

Revit Clinic


If this helped solve your issue - remember to 'accept as solution' to help others find answers.
Message 5 of 41

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,

Message 6 of 41
YarUnderoaker
in reply to: romeuneiva

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;
        }
    }

 

Message 7 of 41
haydenwse
in reply to: haydenwse

What did you use to create this macro.  I am a masters of family editing but have not gotten into the programming side yet. 

Message 8 of 41
YarUnderoaker
in reply to: haydenwse

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.

Message 9 of 41
romeuneiva
in reply to: haydenwse

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

Message 10 of 41
haydenwse
in reply to: YarUnderoaker

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?

Message 11 of 41
YarUnderoaker
in reply to: romeuneiva

Hi Romeu.
I developed a couple of addons with open source. But they will be useful except that in my country (I'm from Ukraine).
Now I'm busy with another project - a game engine that is written in the Delphi language. While I'm not ready to participate elsewhere.
Message 12 of 41
YarUnderoaker
in reply to: haydenwse

2haydenwse

Select a family instances which contain subcomponents, than open Manage tab and click Macros manager. Next open document tab, select macros "SelectSubComponents" and click Run button.
PS: I can not vouch for the correct name of the controls, I have them in Russian.
Message 13 of 41
romeuneiva
in reply to: YarUnderoaker

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,

Message 14 of 41
YarUnderoaker
in reply to: romeuneiva

Please attach some file for example.
Message 15 of 41
romeuneiva
in reply to: YarUnderoaker

Here is my sample family. Try instanciating it in a strctural column face.
Then look in a cutting view its face. It contains some circles and like
that appear only in plan views. This elements should be incorporated in the
selection for the assembly.
Message 16 of 41
Alfredo_Medina
in reply to: haydenwse

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".


Alfredo Medina _________________________________________________________________ ______
Licensed Architect (Florida) | Freelance Instructor | Autodesk Expert Elite (on Revit) | Profile on Linkedin
Message 17 of 41
romeuneiva
in reply to: YarUnderoaker

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? 

Message 18 of 41
YarUnderoaker
in reply to: romeuneiva

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.

 

Message 19 of 41
Wuil
in reply to: haydenwse

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.

 

 

Message 20 of 41
YarUnderoaker
in reply to: Wuil

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); } } }

 

 

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Rail Community


Autodesk Design & Make Report