View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0003066 | PartDesign | Bug | public | 2017-06-02 14:54 | 2017-06-05 15:46 |
Reporter | sheinz | Assigned To | yorik | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Platform | x86_64 | OS | Arch Linux | OS Version | 4.10.10-1 |
Product Version | 0.17 | ||||
Fixed in Version | 0.17 | ||||
Summary | 0003066: Draft clone fails with "name 'Draft' is not defined" if used first time in Draft workbench | ||||
Description | It seems like variable Draft is dynamically created when a tool from Draft workbench is used. But if the first used tool from Draft workbench is Clone it fails with:
After using some other tool from Draft workbench (for example move) clone operation starts to work. | ||||
Steps To Reproduce | 1. New document 2. Create a solid cube in Part workbench. 3. Switch to Draft workbench. 4. Select the cube and clone it. - Error is generated and clone operation fails. 5. Move the cube. 6. Try to clone the cube one more time. This time it works. | ||||
Additional Information | OS: Linux Word size of OS: 64-bit Word size of FreeCAD: 64-bit Version: 0.17.11206 (Git) Build type: Debug Branch: master Hash: 749d666099ce5d201e67917d491c9dad2c0ccf32 Python version: 2.7.13 Qt version: 4.8.7 Coin version: 3.1.3 OCC version: 7.1.0 | ||||
Tags | Draft | ||||
FreeCAD Information | |||||
related to | 0003036 | closed | Draft | Draft -> Clone feature doesn't work when you open file directly |
|
I quickly had a look at the code and adding the following line in method DraftClone.proceed fixes the issue.
I'm not sure if it is the right approach or if it is the right place but might be a hint for the developers.I also included the patch. freecad_draft_clone.patch (650 bytes)
diff --git a/src/Mod/Draft/DraftTools.py b/src/Mod/Draft/DraftTools.py index 079b89928..4d4981da7 100644 --- a/src/Mod/Draft/DraftTools.py +++ b/src/Mod/Draft/DraftTools.py @@ -4836,6 +4836,7 @@ class Draft_Clone(Modifier): self.view.removeEventCallback("SoEvent",self.call) if FreeCADGui.Selection.getSelection(): l = len(FreeCADGui.Selection.getSelection()) + FreeCADGui.addModule("Draft") FreeCAD.ActiveDocument.openTransaction("Clone") for obj in FreeCADGui.Selection.getSelection(): FreeCADGui.doCommand("Draft.clone(FreeCAD.ActiveDocument."+obj.Name+")") |
|
Thanks sheinz. @yorik can you confirm the patch is 'kosher'? |
|
Good catch! Thanks for the patch @sheinz |
|
Fixed in master. Source integration doesn't work anymore... |
|
c:FreeCAD:83095ca574c48e146894df2a7757f6a94659ee0b: FYI @yorik shell access would be helpful to fix source integration |
|
I know, I know... |
Date Modified | Username | Field | Change |
---|---|---|---|
2017-06-02 14:54 | sheinz | New Issue | |
2017-06-02 14:54 | sheinz | Tag Attached: Draft | |
2017-06-02 15:36 | Kunda1 | Description Updated | |
2017-06-02 15:37 | Kunda1 | Relationship added | related to 0003036 |
2017-06-02 21:41 | sheinz | File Added: freecad_draft_clone.patch | |
2017-06-02 21:41 | sheinz | Note Added: 0009268 | |
2017-06-03 02:04 | Kunda1 | Note Added: 0009270 | |
2017-06-03 02:43 | yorik | Note Added: 0009272 | |
2017-06-03 02:45 | yorik | Note Added: 0009273 | |
2017-06-03 02:46 | yorik | Assigned To | => yorik |
2017-06-03 02:46 | yorik | Status | new => closed |
2017-06-03 02:46 | yorik | Resolution | open => fixed |
2017-06-03 02:46 | yorik | Fixed in Version | => 0.17 |
2017-06-03 15:13 | Kunda1 | Note Added: 0009275 | |
2017-06-05 15:46 | yorik | Note Added: 0009288 |