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

conversion to a2plus part cannot be undone #197

Open
donovaly opened this issue Feb 14, 2019 · 6 comments
Open

conversion to a2plus part cannot be undone #197

donovaly opened this issue Feb 14, 2019 · 6 comments

Comments

@donovaly
Copy link
Collaborator

  • select an imported part and convert it to an a2plus part
  • now you see that you selected the wrong part and thus want to undo the conversion

result: this is not possible.
If this is technically impossible for a FC addon, please close this bug.

@kbwbe
Copy link
Owner

kbwbe commented Feb 15, 2019

Fixed on devel branch. 2019-02-15

@kbwbe kbwbe closed this as completed Feb 15, 2019
@donovaly
Copy link
Collaborator Author

This is not completely fixed:

  • convert a part to an a2plus part
  • undo
  • redo

result
Traceback (most recent call last): File "C:\Users\USti\AppData\Roaming\FreeCAD\Mod\A2plus\a2p_observers.py", line 33, in slotRedoDocument a2p_importpart.a2p_repairTreeView() File "C:\Users\USti\AppData\Roaming\FreeCAD\Mod\A2plus\a2p_importpart.py", line 1100, in a2p_repairTreeView parent.Label = parent.Label # trigger an update... <class 'AttributeError'>: 'NoneType' object has no attribute 'Label'

@donovaly donovaly reopened this Feb 16, 2019
kbwbe added a commit that referenced this issue Feb 16, 2019
@kbwbe
Copy link
Owner

kbwbe commented Feb 16, 2019

I only got this error when the converted part was already constrained. With the undo function these existing constraints loose their object reference.
I added a function to remove constraints related to non existing objects. For me it works now without error message.
Fixed within devel branch 2019-02-16

@kbwbe kbwbe closed this as completed Feb 16, 2019
@donovaly
Copy link
Collaborator Author

This is still not completely fixed or new issues have been introduced:

  • select the part "Pumpen-Kupplung_001"
  • convert to A2plus part
  • undo
  • redo

result: info dialog stating "b_Pumpen_Kupplung_001_"

I see there 3 issues:

  1. the first conversion to the a2plus part changes the name of the part (which makes sense) but the existing constraint is detached from the part and placed elsewhere to the model tree. Can't the constraint be kept?
  2. the redo tries to restore the part with the original name, but since the conversion renamed the part, this fails
  3. the info dialog outputs a part name that never existed.

@donovaly donovaly reopened this Feb 16, 2019
@kbwbe
Copy link
Owner

kbwbe commented Feb 16, 2019

The test file does only contain A2p parts. What should be converted ?

@donovaly
Copy link
Collaborator Author

The test file does only contain A2p parts.

Not here on my PC. Both parts are simple imported parts.

What should be converted ?

As I wrote the part "Pumpen-Kupplung_001".

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