Skip to content
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

How to reset the orientation? #21

Closed
ceremcem opened this issue Jul 30, 2018 · 4 comments
Closed

How to reset the orientation? #21

ceremcem opened this issue Jul 30, 2018 · 4 comments

Comments

@ceremcem
Copy link
Collaborator

ceremcem commented Jul 30, 2018

When we change the orientation of an object, the top/left/right/... view tool can not show that object in original orientation. How can we reset it so we could see the original right view when we click the "right" side of orientation cube (top right control)?

orientation-reset-problem

@realthunder
Copy link
Owner

If you you want some kind of fixed orientation of an assembly, you should decide a base part before creating the assembly. Let's say you want the PCB to be base part. After you add the PCB to the assembly, select any face of the PCB, and click the Lock constraint (The middle one with a lock in your constraints toolbar) to fix it. You can then proceed to add other components. And when you move other components, they will always snap back to PCB after solver recompute.

You should not attempt to change the placement of the PCB, or use any of the mover tool to move the PCB, otherwise, all other components will be moved together and settle with the new PCB orientation. If you accidently move the base part, you can either click undo to undone mover change, or reset the placement by simply typing in python console

App.ActiveDocument.PCB.Placement = App.Placement()

Or, click the Lock Mover button, the middle one with a lock on the mover icon on your left toolbar. This will prevent activating mover on locked parts.

BTW, you may want to try Axial Mover, the icon below the Mover. Many user feel that it is easier to use.

@ceremcem
Copy link
Collaborator Author

ceremcem commented Aug 7, 2018

Locking a part at the very beginning solves the orientation issue before it takes place. That's the way I'll stick from now on.

But anyway, I would like to be able to reset the orientation anytime. Currently, above Python code doesn't help much:

image

@realthunder
Copy link
Owner

Is this 'Assembly001' inside another assembly?

If you want to reset part's orientation, then you should set the part object's placement

App.ActiveDocument.pcb.Placement = App.Placement()

@ceremcem
Copy link
Collaborator Author

ceremcem commented Aug 8, 2018

The file I'm working on is: https://github.com/ceremcem/fc-asm3-test/tree/rpi-from-scratch this commit

Here is what I did so far:

pcb = App.ActiveDocument.getObjectsByLabel('pcb')[0]
rpi3 = App.ActiveDocument.getObjectsByLabel('rpi3')[0]
eth = App.ActiveDocument.getObjectsByLabel('ethernet')[0]
fp = App.ActiveDocument.getObjectsByLabel('front-panel')[0]

pcb.Placement = App.Placement()  # Not enough on its own
rpi3.Placement = App.Placement()
eth.Placement = App.Placement()
fp.Placement = App.Placement()

Result is:

reset-orientation2

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

No branches or pull requests

2 participants