Skip to content

Instantly share code, notes, and snippets.

@Schlechtwetterfront
Created October 9, 2013 05:49
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Schlechtwetterfront/6896767 to your computer and use it in GitHub Desktop.
Save Schlechtwetterfront/6896767 to your computer and use it in GitHub Desktop.
Moves all selected points to an absolute position. Default zeroes all selected points on the X-Axis. Usage: >Copy the code to the script editor and execute it. >OR Create a script button and paste this code into the script button's script window.
from win32com.client import constants as const
xsi = Application
# Possible Values: siX, siY, siZ, siXY, siXZ, siYZ, siXYZ.
axis = const.siX
# Set to desired absolute values.
x = 0
y = 0
z = 0
def move_points():
sel = xsi.Selection(0)
if not sel:
return
subc = sel.SubComponent
if not subc:
return
coll = subc.ComponentCollection
if coll and coll[0].Type == 'Vertex':
for vert in coll:
xsi.Translate(vert, 0, 0, 0, const.siAbsolute, None, None, axis)
move_points()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment