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: 

Retrieving Id's of locked elements

6 REPLIES 6
Reply
Message 1 of 7
Anonymous
458 Views, 6 Replies

Retrieving Id's of locked elements

Hi all, 

 

I was wondering if it is possible to retrieve the ElementId's of elements which are locked to other (known) elements. For example in my project I have a grid element and multiple wall elements locked to this grid with the align tool, lets say I know the ElementId of the grid element, is it possible to retrieve the ElementId's of the wall elements?

 

When I use the LookupTool on the grid element I can't seem to find any of the Wall elements ElmentId's, now I'm questioning if this is even possible? 

 

Thanks,

Rob

Tags (2)
6 REPLIES 6
Message 2 of 7
Laks-Autodesk
in reply to: Anonymous

The ID of a selected element can be found here: Manage tab > Inquiry panel > IDs of selection

Regards,
Lakshminarasimhan Seshadri
Autodesk
Message 3 of 7
Anonymous
in reply to: Laks-Autodesk

I'm aware of the "ID's of Selection" button, however this is not what I'm after. I want to retrieve the ID's through the API (I did not explicitly mention this since I've asked this question in the API forum). Also I'm not after the ID of the current selection but I want to know the ID's of elements which are locked (constraint) to the current selection. 

 

 

 

Message 4 of 7
Dale.Bartlett
in reply to: Anonymous

Any progress?




______________
Yes, I'm Satoshi.
Message 5 of 7
Revitalizer
in reply to: Anonymous

Hi,

 

to get an element's related elements, you could delete the element and look what has changed in the database.

After that, you can rollback your transaction.

Just search for "temporary transaction" on the TBC blog.

 

 

Revitalizer




Rudolf Honke
Software Developer
Mensch und Maschine





Message 6 of 7
Scott_Wilson
in reply to: Anonymous

I have no direct experience with this exact problem but I think the walls are attached to the grid using special Alignment Dimensions that have thier IsLocked property set to true. You can create them in the API with ItemFactoryBase.NewAlignment

 

 

 

To investigate your own solution I would suggest studying the API documentation fot the Dimension class to see what behaviour and data you can use to discover which dimensions are locking the walls to the grid. I'm not sure what the situation is when there is no visible dimension element but the alignment lock still remains (such as when you delete a locked dimension in the UI and it allows you to leave the lock in-place while the dimension itself is deleted.), maybe the dimension element remains in the document but is made invisible somehow (ViewSpecific property set to false maybe?).

 

good luck and Let us know how you get on.

Message 7 of 7

I am not aware of any new developments in this area. Does anyone have a means to collect all elements that are constrained (locked) to a selected element?




______________
Yes, I'm Satoshi.

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