I am new to FreeCAD and I know just a little bit about programming.
I want to create my own module and I read "https://www.freecadweb.org/wiki/Module_Creation"
I copied the code from GitHub from the directory: "trunk/src/Tools/fcbt.py" as stated in the above webpage to my newly created file "fcbt.py" on my desktop.
My question is, where should I put the above file so that I could execute the code "python fcbt.py"? I tried to put the file in the ".../FreeCAD 0.18/Mod" and ".../FreeCAD 0.18/bin" and run the above code in FreeCAD python console and it did not work.
I have spent couple of weeks regarding the above. Your help is highly appreciated. Thanks.
[New to FreeCAD] Request for a Detailed Procedure on How to Create Own Module
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
-
- Posts: 1
- Joined: Sat Sep 14, 2019 6:01 pm
Re: [New to FreeCAD] Request for a Detailed Procedure on How to Create Own Module
That page is part of the Developer hub. It is assumed that the person reading this will know about programming. It is not meant for absolute beginners.stkwong1988 wrote: ↑Sat Sep 14, 2019 6:16 pm I am new to FreeCAD and I know just a little bit about programming.
Why do you want to create your own module or workbench? If you have created a small script, you may just keep it as a macro in your user directory, and launch it from a button in a custom toolbar. See Macros.
The file is meant to be run from your operating system terminal, for example, in Linux, in the Bash terminal.I copied the code from GitHub from the directory: "trunk/src/Tools/fcbt.py" as stated in the above webpage to my newly created file "fcbt.py" on my desktop.
My question is, where should I put the above file so that I could execute the code "python fcbt.py"?...
You don't just need that file, it is assumed that you downloaded the entire FreeCAD source code, and you run the file where it is.
This sounds like you have spent way too much time. It sounds like you aren't very familiar with concepts such as Python files, running Python, the Linux terminal, etc.I have spent couple of weeks regarding the above. Your help is highly appreciated. Thanks.
In general, you don't need fcbt.py to create a new workbench. The only thing you need is two files, one Init.py, and one InitGui.py. These need to be placed inside a subdirectory of Mod/. For example, take a look at the Start Workbench. https://github.com/FreeCAD/FreeCAD/tree ... /Mod/Start
Code: Select all
src/Mod/
src/Mod/Init.py
src/Mod/InitGui.py
src/Mod/CMakeLists.txt
src/Mod/App/
src/Mod/Gui/
Take a look at the Draft Workbench; see the source https://github.com/FreeCAD/FreeCAD/tree ... /Mod/Draft.
It is made completely in Python, so it doesn't need to be compiled. The root directory has those Init.py and InitGui.py files, and then various files that define the tools, all programmed in Python.
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
Re: [New to FreeCAD] Request for a Detailed Procedure on How to Create Own Module
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
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
Re: [New to FreeCAD] Request for a Detailed Procedure on How to Create Own Module
https://github.com/FreeCAD/FreeCAD-addo ... -531862804Kunda1 wrote: ↑Mon Sep 16, 2019 1:30 pm Related: https://github.com/FreeCAD/FreeCAD-addons/issues/104
In general, I completely agree that more developer focused documentation is needed. However, on this topic I want to say that for me it is not as big a priority as user-level documentation is.Kunda1 wrote: @joelgraff
I resonate with everything you wrote and I'm very glad this discussion is progressing. Especially:I think I'll pin this issue so it's of priority.joelgraff wrote: Without a clear structure in place to mange the various workbench command / task use cases, we cannot write clear, useful developer documentation.
Since about a year ago I've added tons of user-level documentation that I think is missing in the wiki, particularly focusing on Python workbenches. However, I've stayed away from developer documentation. Why? I feel that developers are just more capable of "figuring things out". Occasionally they need help from other developers, but if they really consider themselves at the power user level, they have the capacity of going into the existing developer's documentation, to the forum, into the source code, and get things going by themselves (creating macros, workbenches, fixing bugs).
I think getting more "regular users" is more important, as it means that the pool of eyes that look at the project gets bigger. Some of them undoubtedly are more than regular users, and transition to the power user and developer ranks. At that point they contribute naturally by providing ideas and fixes. So, to me, it's more important to get high quality user-level documentation, than high-quality developer documentation.
With that said, I do think developer documentation is important, which is precisely why I try to help when I can, such as in this thread: Python codeformating Draft, Arch in the regard of pep8 etc.
To conclude, any effort in documentation is important; I personally wouldn't like to transition to a 1.0 version of FreeCAD without much better documentation in general.
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.