Does anyone have an example of setting pickups via the ZOS api in NSC mode?
for i in obj_list: obj = NCE.GetObjectAt(i) obj.Xposition.SetPickupfromObject(1) ??? something like this
I have over 100 lines in the editor I’d like to set to pickup a position off of an existing object, and manually clicking all of them is tedious.
Thank you,
Jason
Best answer by David.Nguyen
Hi Jason,
To complement @yuan.chen‘s answer, here is a more specific code:
# This is your non-sequential object
obj = TheSystem.NCE.GetObjectAt(2)
# Create a pick-up solve type from this object
pickup_solve = obj.XPositionCell.CreateSolveType(ZOSAPI.Editors.SolveType.ObjectPickup)
# Adjust the solve settings
pickup_solve.Object = 1# This is the object to pick-up from
pickup_solve.ScaleFactor = 2.0
pickup_solve.Offset = 3.0
pickup_solve.Column = ZOSAPI.Editors.NCE.ObjectColumn.XPosition
# Apply the solve
obj.XPositionCell.SetSolveData(pickup_solve)
You can pick-up from other columns, and you’ll find the available ones in the Syntax Help File:
To complement @yuan.chen‘s answer, here is a more specific code:
# This is your non-sequential object
obj = TheSystem.NCE.GetObjectAt(2)
# Create a pick-up solve type from this object
pickup_solve = obj.XPositionCell.CreateSolveType(ZOSAPI.Editors.SolveType.ObjectPickup)
# Adjust the solve settings
pickup_solve.Object = 1# This is the object to pick-up from
pickup_solve.ScaleFactor = 2.0
pickup_solve.Offset = 3.0
pickup_solve.Column = ZOSAPI.Editors.NCE.ObjectColumn.XPosition
# Apply the solve
obj.XPositionCell.SetSolveData(pickup_solve)
You can pick-up from other columns, and you’ll find the available ones in the Syntax Help File:
To complement @yuan.chen‘s answer, here is a more specific code:
# This is your non-sequential object
obj = TheSystem.NCE.GetObjectAt(2)
# Create a pick-up solve type from this object
pickup_solve = obj.XPositionCell.CreateSolveType(ZOSAPI.Editors.SolveType.ObjectPickup)
# Adjust the solve settings
pickup_solve.Object = 1# This is the object to pick-up from
pickup_solve.ScaleFactor = 2.0
pickup_solve.Offset = 3.0
pickup_solve.Column = ZOSAPI.Editors.NCE.ObjectColumn.XPosition
# Apply the solve
obj.XPositionCell.SetSolveData(pickup_solve)
You can pick-up from other columns, and you’ll find the available ones in the Syntax Help File:
We use 3 different kinds of cookies. You can choose which cookies you want to accept. We need basic cookies to make this site work, therefore these are the minimum you can select. Learn more about our cookies.