Escaping out of editing a component
-
Sorry if this has been asked before but I searched and can't find an answer... though admittedly I'm not sure what to search for so I'll explain it best as I can...
When editing a group or component we can use the escape key to exit 'edit mode'... is there a way to do this with ruby? I tried
@model.selection.clear
but that doesn't work. I included a picture to help explain what I mean.
-
Something like:
model.close_active
Which goes up one level...
To go all the way back to themodel.entities
context use:
model.close_active until model.active_entities==model.entities
-
UUgghhh never thought of searching for something with 'close' in it kept thinking 'escape'!
Thanks Tig! You da man... well tiger!
This is the code I'm using... anything more efficient?
while @model.active_entities!=@model.entities @model.close_active end
-
Note that if only close the currently open instance. If you are deeply nested you need to loop until you are back in the root - (if that's what you desire). And before SU2014 the method was bugged and could mess up geometry if the close was undone. (The method actually creates an undo item)
Advertisement