Created
October 9, 2013 05:49
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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