MACRO:Work Feature 2014_12

Need help, or want to share a macro? Post here!
cox
Posts: 963
Joined: Wed Nov 26, 2014 11:37 pm

Re: MACRO:Work Feature 2014_12

Postby cox » Mon Feb 06, 2017 8:42 pm

easyw-fc wrote: any "print" occurrence will trig the error, not only "print message" I've found
Are you running python3?
Need help? Feel free to ask, but please read the guidelines first
User avatar
easyw-fc
Posts: 2690
Joined: Thu Jul 09, 2015 9:34 am

Re: MACRO:Work Feature 2014_12

Postby easyw-fc » Mon Feb 06, 2017 9:04 pm

cox wrote: Are you running python3?
No,
just using internal python of standard FC build for win 64 running on win10 64b
HoWil
Posts: 840
Joined: Sun Jun 14, 2015 7:31 pm
Location: Austria

Re: MACRO:Work Feature 2014_12

Postby HoWil » Fri Mar 10, 2017 7:08 pm

rentlau_64 wrote:Hello!

A new release 2017-02-05 is available:
https://github.com/Rentlau/WorkFeature.git
Dear Rentlau_64,
I tested your wb the first time and came across some issues:
* 'Camera Track' in the 'View' dialog gives 'ERROR : No Edge was selected !No Edge was selected !' even if I selected a edge.
* 'Distance' and Length in 'Check' give 'Distance : 4e+100' .... even if the begin and end points are reported correctly.
* 'are Coplanar' does report

Code: Select all

Unable to check coplanarity : 
Select 2 objects 
(either 2 Planes or 2 Edges) !
even if I select two edges on one face of cube.

BR,
HoWil
rentlau_64
Posts: 181
Joined: Tue Oct 21, 2014 9:47 am
Location: Pau (France)

Re: MACRO:Work Feature 2014_12

Postby rentlau_64 » Sat Mar 11, 2017 5:15 pm

HoWil,
Thank you for your feedback.
i will investigate, and will report to you.
Have a nice day.
Rentlau_64
cflin
Posts: 50
Joined: Sun May 14, 2017 10:21 pm

Re: MACRO:Work Feature 2014_12

Postby cflin » Thu May 25, 2017 5:33 am

Hi all,

Since I am new to the FreeCAD forums, I am not sure I am doing this correctly. I do not want to respond to any posting; I want to initiate a new one, but I see only one button, "Post Respond."

Anyway, my question is how to increase the decimal precision of the WorkFeature output. For example, when I measure a radius, WorkFeature gives me only two decimal digits of precision and if I set four digits in the general FC preferences, WorkFeature just pads the extra digits with zeroes.

See attached file. The object "Circle" is the circular opening of the head of the bolt, where the Allen wrench would be inserted. I measured its diameter with the diameter dimensioning tool of the Draft workbench (I should have probably pressed SHIFT to get the radius instead) and that measurement agrees with the radius measured in the sketcher (which contains its own circle). However, when I compare the two, WF gives me only two decimal digits, which I can verify through the Python console (copying and pasting from the Python console—observe the number-formatting string):

---------------SNIP---------------
>>> print('The radius read by WF is %1.5f mm, while Draft diameter gives %s' % (App.ActiveDocument.Circle.Radius, App.ActiveDocument.Dimension.Distance) )
The radius read by WF is 1.15000 mm, while Draft diameter gives 2.29136 mm
--------------END SNIP----------

As you can see, the diameter measured with the Draft dimensioning tool is a bit less than twice the radius measured with the WF tool.
Attachments
bolt.fcstd
(17.13 KiB) Downloaded 31 times
mario52
Posts: 2690
Joined: Wed May 16, 2012 2:13 pm

Re: MACRO:Work Feature 2014_12

Postby mario52 » Fri May 26, 2017 8:38 am

hi
the exact radius give by WF 2017-02-05 is (and other tools)

Radius :
Object : Part__Feature.Edge30
Radius is 1.14567944036
Radius :
Object : Part__Feature.Edge30
Radius is 1.14567944036
radius00.png
radius00.png (19.95 KiB) Viewed 1009 times
(see Measure Radius)

Code: Select all

import Part
s=Gui.Selection.getSelectionEx()[0]
e=s.SubObjects[0]

if issubclass(type(e),Part.Edge):
  if issubclass(type(e.Curve),Part.Circle):
    print e.Curve.Radius
#    print e.Curve.Center
  elif issubclass(type(e.Curve),Part.ArcOfCircle):
    print e.Curve.Radius
#    print e.Curve.Center
the difference with Draft dimensioning tool is maybe the snap

OS: Windows 10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.16.6706 (Git)
Build type: Release
Branch: releases/FreeCAD-0-16
Hash: f86a4e411ff7848dea98d7242f43b7774bee8fa0
Python version: 2.7.8
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 6.8.0.oce-0.17

mario
Maybe you need a special feature, go into Macros_recipes and Code_snippets, Dialog creation. My macros on Gist.github.
User avatar
bill
Posts: 376
Joined: Fri Jan 09, 2015 9:25 pm

Re: MACRO:Work Feature 2014_12

Postby bill » Sun Aug 06, 2017 2:58 pm

Bonjour rentlau!

I have a small request: If you are still maintaining WF, would you ADD a dimension(s) option (like: ☐ Vol.) to your bounding boxes? This will save a trip to WF:Check:Length!

See how handy it is in PATH workbench (lower picture) !

WF_BB_Dims(Option).png
WF_BB_Dims(Option).png (74.61 KiB) Viewed 870 times
PathDimmedBB.png
PathDimmedBB.png (47.53 KiB) Viewed 870 times
mario52
Posts: 2690
Joined: Wed May 16, 2012 2:13 pm

Re: MACRO:Work Feature 2014_12

Postby mario52 » Tue Aug 08, 2017 1:22 pm

hi bill

i have upgrade the macro Macro_BoundingBox_Tracing with option text (annotation) you can modify the option in the section configuration lines 31 to 49, i have add contener and name label for recognize and clarify the new object in comboView

Image

for adding this new options in the Macro WorkFeature you must wait rentlau

(if you have other idea ...)

mario
Maybe you need a special feature, go into Macros_recipes and Code_snippets, Dialog creation. My macros on Gist.github.
User avatar
bill
Posts: 376
Joined: Fri Jan 09, 2015 9:25 pm

Re: MACRO:Work Feature 2014_12

Postby bill » Wed Aug 09, 2017 3:44 am

Excellent!!! Thanks mario; this will work just fine!
lboc
Posts: 4
Joined: Wed Apr 17, 2019 8:53 pm

Re: MACRO:Work Feature 2014_12

Postby lboc » Tue Nov 12, 2019 11:25 am

Hi, I can't seem to make this plugin work properly. If you have multiple levels of parts with where each part is rotated , the align view does not really work well.
Thanks, Lars