Hi everyone,
Today I finished my Honeycomb Solid Macro and I want to publish it into the default Macros repository, but according to the best practice, I'm sharing it here to be tested and reviewed by you.
Please test it, and let me know if work fine for you. The code is versioned in my GitHub repository https://github.com/christiangda/FreeCAD ... ycombSolid
[Macro] New Honeycomb Solid Macro (to be tested)
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
-
- Posts: 5
- Joined: Sat Jan 16, 2021 7:15 pm
[Macro] New Honeycomb Solid Macro (to be tested)
Last edited by christiangda on Sat Jan 30, 2021 8:04 pm, edited 1 time in total.
Re: [Macro] New Honeycomb Solid Macro (to be tested)
Hello and welcome to the forum.
I dont know how is this supposed to work but when the file with a honeycomb is saved and then loaded it still has all the properties but can not be modified - some errors are shown. I tried then creating a second honeycomb. While the file is not closed it is properly edited. But the first honeycomb still does not change - no errors thou.
I dont know how is this supposed to work but when the file with a honeycomb is saved and then loaded it still has all the properties but can not be modified - some errors are shown. I tried then creating a second honeycomb. While the file is not closed it is properly edited. But the first honeycomb still does not change - no errors thou.
Re: [Macro] New Honeycomb Solid Macro (to be tested)
hi
good macro thanks work very well
but the icon is not saved in file (as in my macro example !!)
(similar macro Macro_FCHoneycombMaker)
mario
good macro thanks work very well
but the icon is not saved in file (as in my macro example !!)
(similar macro Macro_FCHoneycombMaker)
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.
-
- Posts: 5
- Joined: Sat Jan 16, 2021 7:15 pm
Re: [Macro] New Honeycomb Solid Macro (to be tested)
Hi @kisolre, you are right, I'm working on it, I'm not sure why it happens, I'm reading about the error I have.kisolre wrote: ↑Sat Jan 16, 2021 8:12 pm Hello and welcome to the forum.
I dont know how is this supposed to work but when the file with a honeycomb is saved and then loaded it still has all the properties but can not be modified - some errors are shown. I tried then creating a second honeycomb. While the file is not closed it is properly edited. But the first honeycomb still does not change - no errors thou.
Code: Select all
11:02:42 <string>(1)<class 'AttributeError'>: Module __main__ has no class HoneycombSolid
11:02:43 <string>(1)<class 'AttributeError'>: Module __main__ has no class ViewProviderHoneycombSolid
https://wiki.freecadweb.org/Scripted_objects
https://github.com/FreeCAD/FreeCAD/blob ... ePython.py
I'm I don`t know why when you reopen the Freecad file, even if the macro is installed these errors appear
-
- Posts: 5
- Joined: Sat Jan 16, 2021 7:15 pm
Re: [Macro] New Honeycomb Solid Macro (to be tested)
mario52 wrote: ↑Sat Jan 16, 2021 8:57 pm hi
good macro thanks work very well
but the icon is not saved in file (as in my macro example !!)
(similar macro Macro_FCHoneycombMaker)
mario
Hi Mario, thanks!
Let me tell you that your macro was my inspiration, and I only am trying to use different honeycombs solids in the same documents, that the reason why I have created this.
My project using the firs version of my macro is: https://github.com/christiangda/3d-prin ... case.FCStd if you want to check it.
I'm just a Hobbyist of 3d printing trying to used FreeCAD as my favourite tool for 3d designs
I'll implement the new version of my macro as soon I fixed the problem of the icon and the problem of properties when the file is reopened.
I'm reading how to create a Custom Icon and how to save it to be persistent, thank you again for your comment.
As soon as I fixed these problems I'll comment here.
Re: [Macro] New Honeycomb Solid Macro (to be tested)
hi
mario
the Macro_FCHoneycombMaker is at TheMarkster (not mario52)
thanks
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.
-
- Posts: 437
- Joined: Wed Sep 15, 2010 9:38 am
Re: [Macro] New Honeycomb Solid Macro (to be tested)
Hello,
the page https://wiki.freecadweb.org/Scripted_ob ... attributes explains more about how to save attributes. I think that one of the things then need to be respected is that the class must be importable, i.e. a *.py file, not a *.FCMacro file. I don't have the time to double-check that but this would mean that the macro needs to be split into a FCMacro and a py file containing the needed classes. The GeodesicDome macro from the official repository is a working example of parametric object that works after FreeCAD restart.
Gaël
the page https://wiki.freecadweb.org/Scripted_ob ... attributes explains more about how to save attributes. I think that one of the things then need to be respected is that the class must be importable, i.e. a *.py file, not a *.FCMacro file. I don't have the time to double-check that but this would mean that the macro needs to be split into a FCMacro and a py file containing the needed classes. The GeodesicDome macro from the official repository is a working example of parametric object that works after FreeCAD restart.
Gaël
-
- Posts: 5
- Joined: Sat Jan 16, 2021 7:15 pm
Re: [Macro] New Honeycomb Solid Macro (to be tested)
Hi Gaëlgalou_breizh wrote: ↑Wed Jan 20, 2021 7:30 pm Hello,
the page https://wiki.freecadweb.org/Scripted_ob ... attributes explains more about how to save attributes. I think that one of the things then need to be respected is that the class must be importable, i.e. a *.py file, not a *.FCMacro file. I don't have the time to double-check that but this would mean that the macro needs to be split into a FCMacro and a py file containing the needed classes. The GeodesicDome macro from the official repository is a working example of parametric object that works after FreeCAD restart.
Gaël
Thank you very much for your comment, this help me to solve the problem
When you create a ParametricObject it is necessary to create a folder with the content of your code as ".py" and the ".FCMacro" needs to have python "import <your class into your .py file>"
Now it is working fine when you save and reload your files.
I'm creating the pull request to distribute my macro! https://github.com/FreeCAD/FreeCAD-macros/pull/89
Christian