Skip to content

modeler move() method #746

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 20, 2022
Merged

modeler move() method #746

merged 3 commits into from
Jan 20, 2022

Conversation

hui-zhou-a
Copy link
Contributor

No description provided.

----------
objid : str, int, or Object3d
Name or ID of the object.
vector : float
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
vector : float
vector : list

``True`` when successful, ``False`` when failed.
"""
selections = self.convert_to_selections(objid)
Xvec, Yvec, Zvec = self.primitives._pos_with_arg(vector)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Xvec, Yvec, Zvec = self.primitives._pos_with_arg(vector)
x_vec, y_vec, z_vec = self.primitives._pos_with_arg(vector)

Comment on lines +1809 to +1811
vArg2.append("TranslateVectorX:="), vArg2.append(Xvec)
vArg2.append("TranslateVectorY:="), vArg2.append(Yvec)
vArg2.append("TranslateVectorZ:="), vArg2.append(Zvec)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
vArg2.append("TranslateVectorX:="), vArg2.append(Xvec)
vArg2.append("TranslateVectorY:="), vArg2.append(Yvec)
vArg2.append("TranslateVectorZ:="), vArg2.append(Zvec)
vArg2.append("TranslateVectorX:="), vArg2.append(x_vec)
vArg2.append("TranslateVectorY:="), vArg2.append(y_vec)
vArg2.append("TranslateVectorZ:="), vArg2.append(z_vec)

Comment on lines +1753 to 1754
position : int or float
List of the ``[x, y, z]`` coordinates or the
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
position : int or float
List of the ``[x, y, z]`` coordinates or the
position : list
List of int or float of the ``[x, y, z]`` coordinates or the

@@ -1784,6 +1784,34 @@ def mirror(self, objid, position, vector):

return True

@aedt_exception_handler
def move(self, objid, vector):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
def move(self, objid, vector):
def move(self, object_id, vector):


Parameters
----------
objid : str, int, or Object3d
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
objid : str, int, or Object3d
object_id : str, int, or Object3d

bool
``True`` when successful, ``False`` when failed.
"""
selections = self.convert_to_selections(objid)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
selections = self.convert_to_selections(objid)
selections = self.convert_to_selections(object_id)

@MaxJPRey
Copy link
Collaborator

@ring630 I just proposed some minor modifications about the variable's names to try to follow the 'snake_case' convention.
LGTM.
Thanks for adding the unit test too.

@hui-zhou-a
Copy link
Contributor Author

@MaxJPRey Thanks for the view. The method move was already there but it is called translate. I will copy the content from translate and add a deprecation warning in translate method.

@hui-zhou-a hui-zhou-a merged commit b2989f6 into main Jan 20, 2022
@hui-zhou-a hui-zhou-a deleted the modeler_move branch January 20, 2022 12:15
@MaxJPRey
Copy link
Collaborator

MaxJPRey commented Jan 20, 2022

@ring630,
It sounds good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants