Are you running python3?easyw-fc wrote: any "print" occurrence will trig the error, not only "print message" I've found
MACRO:Work Feature 2014_12
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
Re: MACRO:Work Feature 2014_12
Need help? Feel free to ask, but please read the guidelines first
Re: MACRO:Work Feature 2014_12
No,cox wrote: Are you running python3?
just using internal python of standard FC build for win 64 running on win10 64b
Re: MACRO:Work Feature 2014_12
Dear Rentlau_64,rentlau_64 wrote:Hello!
A new release 2017-02-05 is available:
https://github.com/Rentlau/WorkFeature.git
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) !
BR,
HoWil
-
- Posts: 181
- Joined: Tue Oct 21, 2014 9:47 am
- Location: Pau (France)
Re: MACRO:Work Feature 2014_12
HoWil,
Thank you for your feedback.
i will investigate, and will report to you.
Have a nice day.
Rentlau_64
Thank you for your feedback.
i will investigate, and will report to you.
Have a nice day.
Rentlau_64
Re: MACRO:Work Feature 2014_12
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.
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 80 times
Re: MACRO:Work Feature 2014_12
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
(see Measure Radius)
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
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
(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
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, Topological_data_scripting.
My macros on Gist.github here complete macros Wiki and forum.
My macros on Gist.github here complete macros Wiki and forum.
Re: MACRO:Work Feature 2014_12
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) !
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) !
Re: MACRO:Work Feature 2014_12
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
for adding this new options in the Macro WorkFeature you must wait rentlau
(if you have other idea ...)
mario
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
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, Topological_data_scripting.
My macros on Gist.github here complete macros Wiki and forum.
My macros on Gist.github here complete macros Wiki and forum.
Re: MACRO:Work Feature 2014_12
Excellent!!! Thanks mario; this will work just fine!
Re: MACRO:Work Feature 2014_12
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
Thanks, Lars