[Feature Request] Surface finish symbols [SOLVED]

Discussions about the development of the TechDraw workbench
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
NewJoker
Veteran
Posts: 3014
Joined: Sun Oct 11, 2020 7:49 pm

Re: [Feature Request] Surface finish symbols

Post by NewJoker »

edi wrote: Tue Apr 19, 2022 1:44 pm Imo only the standardised RA values are allowed. If you issue an order how the surface has to be, somebody in the quality assurance has to check it. And how would you check RA 0,75 ? But maybe an expert on surfaces can help us.
Right, it seems that the whole range of possible RA values is covered by this macro. Then maybe just the RZ parameter could be added ?
edi
Posts: 481
Joined: Fri Jan 17, 2020 1:32 pm

Re: [Feature Request] Surface finish symbols

Post by edi »

NewJoker wrote: Tue Apr 19, 2022 1:59 pm Then maybe just the RZ parameter could be added ?
Attached version 3 of the macro. This version has added blank fields at the roughness showing boxes.
SurfaceSymbols03.FCMacro
(9.42 KiB) Downloaded 98 times
To create an ISO symbol using RZ values:
- start the macro
- select the ASME radiobutton
- leave the two roughness boxes blank
- enter suggested RZ value in the sampling length field
SurfaceSymbols03.png
SurfaceSymbols03.png (13.68 KiB) Viewed 2260 times
User avatar
NewJoker
Veteran
Posts: 3014
Joined: Sun Oct 11, 2020 7:49 pm

Re: [Feature Request] Surface finish symbols

Post by NewJoker »

edi wrote: Tue Apr 19, 2022 2:48 pm Attached version 3 of the macro. This version has added blank fields at the roughness showing boxes.
Great, thank you very much. Now it's perfect :D
chrtech1
Posts: 16
Joined: Fri Nov 09, 2018 3:22 am

Re: [Feature Request] Surface finish symbols

Post by chrtech1 »

I have tried to use the macro described in this thread (all 3 versions, but keep getting the error in the Report View...

12:42:41 Traceback (most recent call last):
File "C:/Users/KevinW10/AppData/Roaming/FreeCAD/Macro/SurfaceSymbols.FCMacro", line 177, in <module>
panel=DefinePanel()
File "C:/Users/KevinW10/AppData/Roaming/FreeCAD/Macro/SurfaceSymbols.FCMacro", line 85, in __init__
self.createButtonIcons()
File "C:/Users/KevinW10/AppData/Roaming/FreeCAD/Macro/SurfaceSymbols.FCMacro", line 97, in createButtonIcons
self.iconFiles.append(self.createFile('IconFile01',surfaceSymbols.baseSymbol(0)))
File "C:/Users/KevinW10/AppData/Roaming/FreeCAD/Macro/SurfaceSymbols.FCMacro", line 90, in createFile
f = open(fileName,'w')
<class 'PermissionError'>: [Errno 13] Permission denied: 'IconFile01'

This occurred in version 0.18, 0.19, and 0.20. I removed all copies of FreeCAD, reinstalled 0.20 only, and still getting the same thing. I'd really like to use this macro and would appreciate any feedback. Thanks in advance.

Kevin Snyder

The usual info...

Code: Select all

OS: Windows 10 Version 2009
Word size of FreeCAD: 64-bit
Version: 0.20.29177 (Git)
Build type: Release
Branch: releases/FreeCAD-0-20
Hash: 68e337670e227889217652ddac593c93b5e8dc94
Python 3.8.10, Qt 5.15.2, Coin 4.0.1, Vtk 8.2.0, OCC 7.6.2
Locale: English/United States (en_US)
Installed mods: 
  * A2plus 0.4.56a
  * fasteners 0.3.45
  * fcgear 1.0.0
  * sheetmetal 0.2.49
User avatar
wandererfan
Veteran
Posts: 6265
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: [Feature Request] Surface finish symbols

Post by wandererfan »

chrtech1 wrote: Mon Jun 20, 2022 4:53 pm <class 'PermissionError'>: [Errno 13] Permission denied: 'IconFile01'
The macro is trying to write to the current working directory. Not sure off hand what that is in a Win environment, but unless you've done a local build, you probably don't have write access to the CWD.

If you change the createFile method like this, it seems to work.

Code: Select all

    def createFile(self,fileName,symbol):
        '''create a svg file including the surface symbol'''
        filePath = os.path.join(App.getUserAppDataDir(), fileName)
        f = open(filePath,'w')
        f.write(symbol)
        f.close()
        return filePath

It might be that App.getTempPath() would be a better choice than App.getUserAppDataDir(). Maybe @edi can advise us.
chrtech1
Posts: 16
Joined: Fri Nov 09, 2018 3:22 am

Re: [Feature Request] Surface finish symbols

Post by chrtech1 »

That worked! (so far, the expected window came up and no error messages).

Today, I learned. Thank you.
rock.vice
Posts: 22
Joined: Sat Jan 02, 2021 6:12 pm

Re: [Feature Request] Surface finish symbols

Post by rock.vice »

Thank you for another very useful tool.
Do you plan to merge this into the workbench at any point in the future development?
edi
Posts: 481
Joined: Fri Jan 17, 2020 1:32 pm

Re: [Feature Request] Surface finish symbols

Post by edi »

@chrtech1: find attached version 4, not using any files.
SurfaceSymbols04.FCMacro
(10.46 KiB) Downloaded 80 times
rock.vice wrote: Tue Jun 21, 2022 8:51 am
Do you plan to merge this into the workbench at any point in the future development?
Yes. Sorry I am very slowly.
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: [Feature Request] Surface finish symbols

Post by Kunda1 »

Has there been any consensus on standards etc... ?
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
User avatar
NewJoker
Veteran
Posts: 3014
Joined: Sun Oct 11, 2020 7:49 pm

Re: [Feature Request] Surface finish symbols

Post by NewJoker »

Kunda1 wrote: Sun Jul 03, 2022 1:30 pm Has there been any consensus on standards etc... ?
The current version of the macro features symbols based on both ISO and ASME standards. So it’s really versatile.
Post Reply