Jump to content

Accessing "Related Elements" via Script Editor


---
 Share

Recommended Posts

Hi, Is there anyway to .get('Related_elements')? 
ie. lets say I have a Local Coordinate System with a few dependent elements.  Is there a way to access those related elements in the script editor?
I've searched through all the keywords and wasnt able to come up with much.
Some Pictures Below to help clarify:
LCS_Related_Element_List.thumb.png.4c3f4b47a3900f5ab586b5b02c17a547.png

LCS_Related_Elements.thumb.png.4c576bdadd48a6b4b0990c440d63ba41.png

Link to comment
Share on other sites

Hi,

you can get a list of the currently shown content with something like this:

for x in gom.ElementSelection({'category': ['key', 'related']}):
	print (x.name)

Maybe this helps?

Regards,
Jan

Link to comment
Share on other sites

That's exactly what I'm looking for !!  & seems to work perfect if I have the element selected in the explorer.
but in a normal script/program I'm not going to have that element 'selected'. 

can I pass a specific element into that gom.ElementSelection function? 

eg. I'm trying to find all nominal sections related to coordinate system 'LCS'

Related_Sections.thumb.png.e662781e69b9d74f7b3d743719f3ed1f.png

I tried to print( gom.ElementSelection.__doc__ ) but it returned None =(

Link to comment
Share on other sites

Unfortunately, that is currently not possible. The wish to do that is recorded in our internal ticket system, but I cannot tell you if and when it will be implemented.

However, you can use this command to explicitly select an element via scripting:

gom.script.explorer.apply_selection(selection=[gom.app.project.inspection['LCS']])

 

Regards,

Jan

Link to comment
Share on other sites

 Share

×
×
  • Create New...