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

Helix is not putted to active body #47

Closed
tritol opened this issue Aug 3, 2022 · 3 comments
Closed

Helix is not putted to active body #47

tritol opened this issue Aug 3, 2022 · 3 comments

Comments

@tritol
Copy link

tritol commented Aug 3, 2022

Make helix button at active body fails with:

Running the Python command 'ThreadProfileMakeHelix' failed:
Traceback (most recent call last):
File "/home/tritol/.local/share/FreeCAD/Mod/ThreadProfile/./ThreadProfileCmd.py", line 399, in Activated
body.Group=body.Group+[getattr(doc,name)] #put helix in body to avoid out of scope warnings

Object can only be in a single GeoFeatureGroup

[code]
OS: Arch Linux
Word size of FreeCAD: 64-bit
Version: 0.20.29177 (Git) AppImage
Build type: Release
Branch: (HEAD detached at 0.20)
Hash: 68e337670e227889217652ddac593c93b5e8dc94
Python 3.9.13, Qt 5.12.9, Coin 4.0.0, Vtk 9.1.0, OCC 7.5.3
Locale: Czech/Czech Republic (cs_CZ)
Installed mods:

  • MeshRemodel 1.8919.0
  • Estimate 0.1.2
  • DynamicData 2.46.0
  • 3DfindIT 1.2.0
  • Pyramids-and-Polyhedrons
  • slic3r-tools
  • POV-Ray-Rendering
  • fcgear 1.0.0
  • CurvedShapes 1.0.4
  • fasteners 0.3.50
  • Manipulator 1.4.9
  • Silk 1.0.0
  • 3D_Printing_Tools
  • Render 2022.2.0
  • ThreadProfile 1.81.0
  • Defeaturing
    [/code]
@tritol
Copy link
Author

tritol commented Aug 3, 2022

This probably fixed it:

--- ThreadProfileCmd.py.orig    2022-08-04 00:10:48.974435796 +0200
+++ ThreadProfileCmd.py 2022-08-04 00:11:11.488046725 +0200
@@ -393,10 +393,10 @@
             helix.AttachmentOffset = profile.AttachmentOffset
         body=FreeCADGui.ActiveDocument.ActiveView.getActiveObject("pdbody")
         part=FreeCADGui.ActiveDocument.ActiveView.getActiveObject("part")
-        if part:
-            part.Group=part.Group+[getattr(doc,name)]
         if body:
             body.Group=body.Group+[getattr(doc,name)] #put helix in body to avoid out of scope warnings
+        elif part:
+            part.Group=part.Group+[getattr(doc,name)]
         doc.commitTransaction()
         doc.recompute()
         return

@mwganson
Copy link
Owner

mwganson commented Aug 4, 2022

I added your change to new version (1.82). Please test.

@tritol
Copy link
Author

tritol commented Aug 4, 2022

1.82 works for me, thanks.

@tritol tritol closed this as completed Aug 4, 2022
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