Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
import lx
import lxu
# get the current active scene and a channel read object,
scene = lx.object.Scene(lxu.select.SceneSelection().current())
channel_read = lx.object.ChannelRead(scene.Channels(None, 0))
# using the channel read get the workplane position and rotation
workplane_position = scene.WorkPlanePosition(channel_read)
workplane_rotation = scene.WorkPlaneRotation(channel_read)
# create a matrix object and set it to the inverse of the workplane,
value_service = lx.service.Value()
matrix = lx.object.Matrix(value_service.CreateValue(lx.symbol.sTYPE_MATRIX4))
matrix.Set3(workplane_rotation)
matrix.SetOffset(workplane_position)
matrix.Invert()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment