Find Family "Source" Element of a given Element

Find Family "Source" Element of a given Element

Aminius
Enthusiast Enthusiast
2,498 Views
24 Replies
Message 1 of 25

Find Family "Source" Element of a given Element

Aminius
Enthusiast
Enthusiast

Hi all,

 

I've been looking for a solution to this particular problem for two days now, but I can't figure it out.

I'm afraid that the reason might be an incomplete understanding of how Objects in Revit are organized. Therefore, it might be that my description of the problem is clumsy and my nomenclature is wrong.

I'll describe the problem as good as I can.

 

It's about Parameters in nested families.

I have a family A. It contains 4 instances of another Family B. Each of these 4 instances, let's call them B1-B4, has different parameter settings.

One instance of A is in my Revit document.

 

I have the ElementId of an Element. It is of B type. I can read the Parameters off this element, but I cannot set them (as I need to), because they are Read-Only.

Apparently, these Parameter values get forwarded from one of the B1-B4 objects.

How can I find out from which one?

In other words, how do I get the Element which a given Element inherits its Parameters from (because it's an instance of it)?

 

Thanks,

Aminius

0 Likes
2,499 Views
24 Replies
Replies (24)
Message 21 of 25

matthew_taylor
Advisor
Advisor

@Aminius,

Is 'Mark' the actual parameter that is being associated with the 'Mark.Faucet' parameter (inside the parent family)? Changing the 'Mark.Faucet' parameter doesn't change the nested instance 'Mark' parameters! Well, it does in the familyDocument, but not the family in the project model.

If so, I think the only option would be to use the suggestion that @FAIR59 has suggested (along with other gymnastics). They would be:

  1. Open family doc.
  2. Find instances that are associated with the 'Mark.Faucet' parameter.
  3. For those instances, find their actual positions.
  4. Close the family doc.
  5. Do transformation gymnastics that work out the relative instances.
  6. Do your thing.

Personally, I think if you're going to do that, you may as well open the family, and give each of the nested families a static parameter that flags which one is which, then reload the modified family. No transformation gymnastics required.

 

Are my first two sentences correct? If so, then one of the options I suggested would be the way to go. They won't be fast!

If not, then please modify the faucet document to suit your actual situation. (BuiltInParameters and non-BuiltInParameters appear to work differently in this instance.)


Cheers,

-Matt
_______________________________________________________________________________
Marking a post as a 'solution' helps the community. Giving a post 'Kudos' is as good as saying thanks. Why not do both?
Message 22 of 25

Aminius
Enthusiast
Enthusiast

Sorry for the late reply, I wasn't in the office last week.

 

@FAIR59, thanks for the suggestion, I think I will do it this way.

 

@matthew_taylor:


@matthew_taylor wrote:

...

Personally, I think if you're going to do that, you may as well open the family, and give each of the nested families a static parameter that flags which one is which, then reload the modified family. No transformation gymnastics required.

 ...


One would think that flags like these already exist internally - else how would Revit itself know which objects have been created from which nested family instance?

When starting this topic, I actually assumed that there was an easy way to access this very mechanism without coming up with my own "hacks".

It astounds me that this doesn't seem to be the case.

 

0 Likes
Message 23 of 25

matthew_taylor
Advisor
Advisor

Hi @Aminius,

Perhaps there is a simpler way, and we just can't figure it out.

 

@jeremytammik, do you think you could weigh in on @Aminius's issue? We're coming up with silly workarounds! Smiley Wink Perhaps the development team have some insight?


Cheers,

-Matt
_______________________________________________________________________________
Marking a post as a 'solution' helps the community. Giving a post 'Kudos' is as good as saying thanks. Why not do both?
0 Likes
Message 24 of 25

jeremytammik
Autodesk
Autodesk

Dear Matt,

 

Sure thing. Sorry this nut is so hard to crack.

 

Kudos for all your efforts and creativity and struggles so far.

 

I passed it on to the development team and hope they can help.

 

Cheers,

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Message 25 of 25

matthew_taylor
Advisor
Advisor

Hi @jeremytammik,

Brilliant, thank you. We're hoping we missed something simple!

 

BTW, is there something wrong with the email alert system? I'm getting some message and kudos emails, but missing others (like this one, for instance). I haven't changed anything in my settings.


Cheers,

-Matt
_______________________________________________________________________________
Marking a post as a 'solution' helps the community. Giving a post 'Kudos' is as good as saying thanks. Why not do both?
0 Likes