Extrude from curved surface of cylinder

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
mario52
Posts: 3232
Joined: Wed May 16, 2012 2:13 pm

Re: Extrude from curved surface of cylinder

Postby mario52 » Sun Nov 23, 2014 3:27 pm

hi alls
corrected
thank you for the report

Code: Select all

texte = unicode(self.textEdit.toPlainText())
App.Console.PrintMessage(u"texte         " + unicode(texte)+"\n")
the macro Macro_FCCircularText.FCMacro

EDIT 15/05/2015 20h34 Paris
replace link to github
mario
Last edited by mario52 on Fri May 15, 2015 6:45 pm, edited 1 time in total.
Maybe you need a special feature, go into Macros_recipes and Code_snippets, Topological_data_scripting, Dialog creation. My macros on Gist.github.
User avatar
NormandC
Posts: 18534
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: Extrude from curved surface of cylinder

Postby NormandC » Sun May 03, 2015 5:39 pm

Hello Mario,

I'm still getting an error with your macro on Ubuntu 14.04.

Code: Select all

New Font /usr/share/fonts/truetype/ubuntu-font-family/Ubuntu-M.ttf
Traceback (most recent call last):
  File "/home/normand2/Dessins/Macros_FreeCAD/Macro_FCCircularText.FCMacro", line 1277, in on_PU_Execute
    ss=Draft.makeShapeString(String=texte[ii2],FontFile=PolicePath,Size=SizeCaractere,Tracking=0)
  File "/usr/lib/freecad/Mod/Draft/Draft.py", line 2413, in makeShapeString
    obj.FontFile = FontFile
TypeError: Property 'FontFile': type must be str or unicode, not QString
mario52
Posts: 3232
Joined: Wed May 16, 2012 2:13 pm

Re: Extrude from curved surface of cylinder

Postby mario52 » Mon May 04, 2015 9:51 am

hi
tanks for reply
home no error (Ubuntu usb key)

OS: Ubuntu 14.10
Word size: 32-bit
Version: 0.14.3702 (Git)
Branch: releases/FreeCAD-0-14
Hash: b3368125c63289ec8ce9faec2b2ae4c78d436406
Python version: 2.7.8
Qt version: 4.8.6
Coin version: 4.0.0a
SoQt version: 1.6.0a
OCC version: 6.7.0
TypeError: Property 'FontFile': type must be str or unicode, not QString
the error give one str or unicode i replace texte[ii2] to unicode(texte[ii2])
try to replace the line 1277 with this line for testing
voulez vous remplacer la ligne 1277 par cette ligne pour essayer

Code: Select all

                    ss=Draft.makeShapeString(String=unicode(texte[ii2]),FontFile=PolicePath,Size=SizeCaractere,Tracking=0)
mario
Maybe you need a special feature, go into Macros_recipes and Code_snippets, Topological_data_scripting, Dialog creation. My macros on Gist.github.
mario52
Posts: 3232
Joined: Wed May 16, 2012 2:13 pm

Re: Extrude from curved surface of cylinder

Postby mario52 » Wed May 06, 2015 3:41 pm

hi
I tried with this version and no problem with or not modify but FreeCAD 0.14.2935 (Git) (with
this is your version of Linux ?

OS: Ubuntu 14.04.1 LTS
Platform: 32-bit
Version: 0.14.2935 (Git) ???
Branch: master
Hash: eab159b6ee675012bf79de838c206a311e911d85
Python version: 2.7.6
Qt version: 4.8.6
Coin version: 4.0.0a
SoQt version: 1.6.0a
OCC version: 6.7.0

have you tried with the modification ?
mario
Maybe you need a special feature, go into Macros_recipes and Code_snippets, Topological_data_scripting, Dialog creation. My macros on Gist.github.
mario52
Posts: 3232
Joined: Wed May 16, 2012 2:13 pm

Re: Extrude from curved surface of cylinder

Postby mario52 » Sun May 10, 2015 3:05 pm

hi
FCCircularText.FCMacro
ver 0.13 09/08/2016

wiki Macro_Circular_Text

download the macro to gist Macro_FCCircularText.FCMacro

Image

EDIT 21/08/2016 17h08 Paris

mario
Last edited by mario52 on Sun Aug 21, 2016 3:14 pm, edited 2 times in total.
Maybe you need a special feature, go into Macros_recipes and Code_snippets, Topological_data_scripting, Dialog creation. My macros on Gist.github.
User avatar
NormandC
Posts: 18534
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: Extrude from curved surface of cylinder

Postby NormandC » Sun May 10, 2015 5:11 pm

mario52 wrote:I tried with this version and no problem with or not modify but FreeCAD 0.14.2935 (Git) (with
this is your version of Linux ?
Mario,

I'm maintaining the Daily Builds and Stable Releases PPA, and I wrote the "Please read first" topic (and its French counterpart). Why would you think I would use that utterly obsolete, badly packaged and buggy development version from the Ubuntu repository? I spend much of my time here telling newcomers to stop using that POS version which should have never been added to the Ubuntu repo in the first place...

But I should have posted my FreeCAD info nonetheless, so I guess I'm the one to blame. ;)

I had this error both with the latest 0.15.4671 release and the 0.16 development snapshot.

OS: Ubuntu 14.04.2 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.15.4671 (Git)
Branch: releases/FreeCAD-0-15
Hash: 244b3aef360841646cbfe80a1b225c8b39c8380c
Python version: 2.7.6
Qt version: 4.8.6
Coin version: 4.0.0a
OCC version: 6.8.0.oce-0.17

OS: Ubuntu 14.04.2 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.16.4928 (Git)
Branch: master
Hash: d8f63bcfd10301f3d1e141cced4370f0782238d0
Python version: 2.7.6
Qt version: 4.8.6
Coin version: 4.0.0a
OCC version: 6.8.0.oce-0.17

With your latest change, the macro won't even load its window.

Code: Select all

<unknown exception traceback><type 'exceptions.SyntaxError'>: ("(unicode error) 'utf8' codec can't decode byte 0xb0 in position 0: invalid start byte", ('/home/normand2/Dessins/Macros_FreeCAD/Macro_FCCircularText.FCMacro', 621, None, 'self.DS_InclinaisonX.setSuffix(" X\xb0")\n'))
If I change my macro path to ~/.FreeCAD/Macros, same error:

Code: Select all

<unknown exception traceback><type 'exceptions.SyntaxError'>: ("(unicode error) 'utf8' codec can't decode byte 0xb0 in position 0: invalid start byte", ('/home/normand2/.FreeCAD/Macros/Macro_FCCircularText.FCMacro', 621, None, 'self.DS_InclinaisonX.setSuffix(" X\xb0")\n'))
When I open your macro with a text editor, I'm getting a warning:
Attachments
FC_Macro_FCCircularText_error.png
FC_Macro_FCCircularText_error.png (90.95 KiB) Viewed 2345 times
mario52
Posts: 3232
Joined: Wed May 16, 2012 2:13 pm

Re: Extrude from curved surface of cylinder

Postby mario52 » Sun May 10, 2015 8:39 pm

hi
hi
I work with Ubuntu http://www.linuxliveusb.com/ USB key if I use the live mode, I do not know how to update so I do with the backup versions that work with permanently fixed otherwise it is nothing sorry !!

For your new mistake you can replace lines 621,622,623 by those below

Code: Select all

         self.DS_InclinaisonX.setSuffix (unicode ("X°"))
         self.DS_InclinaisonY.setSuffix (unicode ("Y°"))
         self.DS_InclinaisonZ.setSuffix (unicode ("Z°"))
if there is still a mistake you can comment on these only serve to show the degree sign "°" and I do not understand because it has nothing to do with my last modification

Please tell me what I calquerai my macro on the changes it is for me the only method thank you
mario
_________________________________________________________

pour Ubuntu je travaille avec http://www.linuxliveusb.com/ sur clef USB si j'utilise le mode live , je ne sais pas faire de mise à jour donc je fais avec les versions avec sauvegarde permanantes qui fonctionnent sinon c'est rien du tout désolé !!

Pour votre nouvelle erreur vous pouvez remplacer les lignes 621, 622, 623 par celles ci

Code: Select all

        self.DS_InclinaisonX.setSuffix(unicode(" X°"))
        self.DS_InclinaisonY.setSuffix(unicode(" Y°"))
        self.DS_InclinaisonZ.setSuffix(unicode(" Z°"))
        
s'il y a encore une erreur vous pouvez les commenter elles ne servent qu'a afficher le signe degré "°" et je ne comprends pas car ça n'a rien à voir avec ma dernière modification

SVP dites moi quoi et je calquerai ma macro sur vos modifications c'est pour moi la seule méthode merci[/i]

EDIT: PS pour l'éditeur de texte sélectionnez un autre codage que utf8
mario
User avatar
NormandC
Posts: 18534
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: Extrude from curved surface of cylinder

Postby NormandC » Mon May 11, 2015 3:40 am

mario52 wrote:For your new mistake you can replace lines 621,622,623 by those below
Thanks Mario, to paraphrase your macro's default text: you're the best! :D

But I also needed to change lines 603 and 605:

Code: Select all

            MainWindow.setWindowFlags(PyQt4.QtCore.Qt.WindowStaysOnTopHint)        # PyQt4 cette fonction met la fen\EAtre en avant
        except Exception:
            MainWindow.setWindowFlags(PySide.QtCore.Qt.WindowStaysOnTopHint)       # PySide cette fonction met la fen\EAtre en avant
And replace "\EA" with "ê". In Gedit (Ubuntu's text editor), those codes were highlighted in red like those for the degree symbol.

This fixed the macro for me, and Gedit now opens the macro without errors.
mario52 wrote:I work with Ubuntu http://www.linuxliveusb.com/ USB key if I use the live mode, I do not know how to update
If you created your LibeUSB key in persistent mode, you should be able to do software updates just like a regular install. Then it's just a matter of adding either of the FreeCAD PPA (Stable or Daily) to your software sources. After that you can open the Update Manager (Gestionnaire de mises à jour) to update your software packages. But I haven't used a LiveUSB in a long time.
mario52
Posts: 3232
Joined: Wed May 16, 2012 2:13 pm

Re: Extrude from curved surface of cylinder

Postby mario52 » Mon May 11, 2015 4:16 pm

hi
NormandC wrote:If you created your LibeUSB key in persistent mode, you should be able to do software updates just like a regular install. Then it's just a matter of adding either of the FreeCAD PPA (Stable or Daily) to your software sources. After that you can open the Update Manager (Gestionnaire de mises à jour) to update your software packages. But I haven't used a LiveUSB in a long time.
that's exactly what I do et ça fonctionne très bien (an updated take much time)

I iron my macros and remove all accents
je vais repasser tutes mes macros et supprimer les accents
PS :
NormandC wrote:When I open your macro with a text editor, I'm getting a warning:
Theoretically this is a file to be opened in a Python environment for other publishers must follow the rules of the editor used (select the right encoding)
théoriquement c'est un fichier qui doit être ouvert dans un environnement Python , pour les autres éditeurs il faut suivre les règles de l'éditeur utilisé (sélectionner le bon encodage)

EDIT 15/05/2015 20h51 Paris
paste the link to github
the macro Macro_FCCircularText.FCMacro

merci pour vos tests
mario
Maybe you need a special feature, go into Macros_recipes and Code_snippets, Topological_data_scripting, Dialog creation. My macros on Gist.github.
orionstars
Posts: 7
Joined: Tue Oct 20, 2015 6:40 pm

Re: Extrude from curved surface of cylinder

Postby orionstars » Tue Oct 20, 2015 6:42 pm

Does this macro work if FreeCAD 0.15 is running on Mac 10.10.5?