Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

How to get a target's parent reference frame?

#1
How do I get a target's parent reference frame item? Meaning its direct parent frame, that is shown in the GUI by default under "Target position with respect to:"of the target properties window.

I tried
Code:
target.Parent()
at first, but that fails if a target is in a folder.

A way that seems to work is:
Code:
frame = robolinkutils.getAncestors(target,robolink.ITEM_TYPE_FRAME)[0]
which gets the first of all subsequent reference frames for a target.

Is there a cleaner way to get the frame item?

Kind regards,

Maarten


Messages In This Thread
How to get a target's parent reference frame? - byMaarten- 12-07-2022, 08:52 PM



Users browsing this thread:
1 Guest(s)