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

Check for Attached Detail Group

9 REPLIES 9
Reply
Message 1 of 10
Aminius
841 Views, 9 Replies

Check for Attached Detail Group

Can someone tell me, please, how I can find out if a Group (Type) has an Attached Detail Group (Type) via the API?

 

Thanks.

 

9 REPLIES 9
Message 2 of 10
jeremytammik
in reply to: Aminius

Dear Aminius,

 

I am enquiring with the development team for you.

 

Best regards,

 

Jeremy



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

Message 3 of 10
Aminius
in reply to: jeremytammik

Cool, thanks. 🙂

Message 4 of 10
Aminius
in reply to: Aminius

Any news on this?

Message 5 of 10
Revitalizer
in reply to: Aminius

Hi,

 

a Group of Category OST_IOSAttachedDetailGroups has a BuiltInParameter.GROUP_ATTACHED_PARENT_NAME.

 

This way, you will find matching Model groups.

 

 

Best regards,

Revitalizer




Rudolf Honke
Software Developer
Mensch und Maschine





Message 6 of 10
Aminius
in reply to: Revitalizer

Thanks for the answer.

 

So this would mean that instead of just "asking" a Group Abc for its Attached Detail Groups, I'd have to go over all groups of the right category in the project and check if their parent is group Abc... right?

 

Well I guess I could  do that, just seems a bit complicated. I mean, how comes that an element knows its parent but not its children (or not even if it has children in the first place, which would suffice to know in my case)?

 

 

 

Message 7 of 10
Revitalizer
in reply to: Aminius

Hi Aminius,

 

I usually create Dictionaries to store relationships like these so I can access them quickly when needed.

 

Another point:

As you can see, this parameter is of type string; I wonder why they store names instead of IDs.

I don't know why...

 

 

Best regards,

Revitalizer

 




Rudolf Honke
Software Developer
Mensch und Maschine





Message 8 of 10
Aminius
in reply to: Revitalizer

Good question indeed...

 

Once again thanks for the answer! 🙂

Message 9 of 10
jeremytammik
in reply to: Aminius

Dear Aminius,

 

Sorry I did not reply earlier.

 

I never did receive a reply on this from the development team.

 

Many relationships and tips and tricks like this are actually not known by us, and the real experts are other peer developer colleagues of yours, like Revitalizer.

 

The approach described by him actually corresponds exactly to the standard way of storing relationships in Revit.

 

For instance, a door or window hosted by a wall maintains a pointer to the hosting wall via the Element.Host property.

 

The inverse relationship is not available directly from the API, which is why one of the very early discussions on The Building Coder discusses the issue of implementing a dictionary as suggested by Revitalizer to determine the inverse relationship from host to hosted elements:

 

http://thebuildingcoder.typepad.com/blog/2008/10/relationship-in.html

 

In fact, that is blog post number 16 from 2008 🙂

 

It makes sense for the Revit model to store the relationship one way only, not both ways, to minimise the model data, possibilities for errors and synchronisation issues.

 

I hope this helps explain.

 

Best regards,

 

Jeremy



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

Message 10 of 10
jeremytammik
in reply to: jeremytammik

Hi guys,

 

I summarised this discussion on The Building Coder:

 

http://thebuildingcoder.typepad.com/blog/2014/10/attached-detail-groups-and-inverse-relationships.ht...

 

Thank you!

 

Cheers,

 

Jeremy



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

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

Post to forums  

Autodesk DevCon in Munich May 28-29th


Rail Community