Access element in a loaded family

Access element in a loaded family

aclarke
Advocate Advocate
566 Views
6 Replies
Message 1 of 7

Access element in a loaded family

aclarke
Advocate
Advocate

EDIT:

I just realized this is posted in the wrong section "Trouble Shooting".  I am not sure how to move this to the correct forum section 'General' other than re-post.

 

Hi all,

 

How can enter a loaded family and access elements in this loaded family?  Specifically a filled region that is placed in a Title Block, I want to return this filled region's bounding box.

 

I have tried 'GetSubComponentIds()' and 'GetSubelements()' but both return '0'.

Any guidance would be greatly appreciated.

 

Thanks

 

 

 

AlanC.

0 Likes
567 Views
6 Replies
Replies (6)
Message 2 of 7

hmunsell
Mentor
Mentor

@aclarke wrote:

I have tried 'GetSubComponentIds()' and 'GetSubelements()' but both return '0'.


are you trying to use Dynamo? Dynamo has there own Forum.

https://forum.dynamobim.com/

Howard Munsell
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.



EESignature


0 Likes
Message 3 of 7

aclarke
Advocate
Advocate

no, I am using C#

the snip-it you show, I can see the confusion, my mistake.

what I am doing is returning a count of sub elements, just to see if I can access them, here is the code I used

 

TD() is shortcut function for TaskDialog.Show("task", e.GetSubelements().Count.ToString());

 

When I select my title border with the code below, the result is '0' but  this border is full of stuff.

 

Reading this, https://thebuildingcoder.typepad.com/blog/2010/02/nested-family-instance.html

Maybe I need to use 'GetSubComponentIds()' and 'SuperComponent' but I still got '0' when replacing 'GetSubelements' with 'GetSubComponentIds().  I am assuming that SuperComponent is the parent family, the definition is not clear.

 

ISelectionFilter filter = new myFunctions.mySelectionFilter();
            Reference reference = uidoc.Selection.PickObject(ObjectType.Element, filter);

            FamilyInstance e = (FamilyInstance)doc.GetElement(reference);
            TD(e.GetSubelements().Count.ToString());

 

0 Likes
Message 4 of 7

hmunsell
Mentor
Mentor

LOL... Oh, i'm not a Coder. but maybe someone else on here can make sense of it :-). i'm still trying to learn Dynamo.....

Howard Munsell
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.



EESignature


0 Likes
Message 5 of 7

aclarke
Advocate
Advocate

lol...

So I assume I posted in the Revit Trouble shooting forum...  I will repost, in the proper place.

 

Thanks

0 Likes
Message 6 of 7

PavelAnd
Advisor
Advisor

It would be better, if you ask your question here.

Best regards, Pavel Plotitsyn.

Message 7 of 7

aclarke
Advocate
Advocate
0 Likes