Just to clarify. If you use
@Chris_G 's code on a vertex of a linked object, you'll get the global coordinates of the original, not the link. With
@openBrain 's code you'll get the global coordinates of the linked object's vertex that you selected. This is all moot if you don't use links. Try it on the enclosed file.
To get the global placement of a selected linked object, you can use
Code: Select all
for sel in Gui.Selection.getSelectionEx('',0):
for path in sel.SubElementNames if sel.SubElementNames else ['']:
placement = sel.Object.getSubObject(path, retType=3) # retType 3 returns the placement. Check the doc string for more info
print('%s.%s -- %s' % (sel.Object.Name, path, placement))