Translations:Macro BoundingBox Tracing/28/en

def adjustedGlobalPlacement(obj, locVector): find global placement to make locVector the local origin with the correct orientation try: objectPlacement = obj.Shape.Placement objectGlobalPlacement = obj.getGlobalPlacement locPlacement = App.Placement(locVector, App.Rotation(App.Vector(1,0,0),0)) print("ici ",objectGlobalPlacement.multiply(objectPlacement.inverse).multiply(locPlacement)) return objectGlobalPlacement.multiply(objectPlacement.inverse).multiply(locPlacement) except Exception: locPlacement = App.Placement(App.Vector(0,0,0), App.Rotation(0,0,0), App.Vector(0,0,0)) return locPlacement