Need tutorial using C/C++ example to create a cube in FreeCAD

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
shawon58
Posts: 30
Joined: Thu Apr 02, 2020 4:38 am

Need tutorial using C/C++ example to create a cube in FreeCAD

Post by shawon58 »

hi, i am new here. so i want to know how to "Look for C/C++ example to create a cube in FreeCAD" . is there any video tutorial for the learning ? :(
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Need tutorial using C/C++ example to create a cube in FreeCAD

Post by Kunda1 »

shawon58 wrote: Sat Apr 04, 2020 1:58 pm hi, i am new here. so i want to know how to "Look for C/C++ example to create a cube in FreeCAD" . is there any video tutorial for the learning ? :(
Please don't create duplicate posts in separate subforums. Bump the post you originally posted to get attention if there hasn't been any response, instead.

I'm not familiar of c++ scripting examples in FC. We use the Python API (see FreeCAD Scripting Basics) to automate FC.
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
openBrain
Veteran
Posts: 9041
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: Need tutorial using C/C++ example to create a cube in FreeCAD

Post by openBrain »

Why do you want to use C/C++ ? FreeCAD has a nice Python API to do that. ;)
shawon58
Posts: 30
Joined: Thu Apr 02, 2020 4:38 am

Re: Need tutorial using C/C++ example to create a cube in FreeCAD

Post by shawon58 »

Hello OpenBrain, i am using pharo smalltalk , so my task is to connect pharo with freeCAD . So i am familier with C/C++ . thats why i am asking
User avatar
Zolko
Veteran
Posts: 2213
Joined: Mon Dec 17, 2018 10:02 am

Re: Need tutorial using C/C++ example to create a cube in FreeCAD

Post by Zolko »

shawon58 wrote: Sat Apr 04, 2020 1:58 pm hi, i am new here. so i want to know how to "Look for C/C++ example to create a cube in FreeCAD"
what makes you think that this is possible ?
try the Assembly4 workbench for FreCAD — tutorials here and here
shawon58
Posts: 30
Joined: Thu Apr 02, 2020 4:38 am

Re: Need tutorial using C/C++ example to create a cube in FreeCAD

Post by shawon58 »

hi zolko, my teacher ask me to find something using C/C++ example to create a cube in FreeCAD because my task is to connect pharo smalltalk with freeCAD , as pharo can use C/C++ by UFFI. if i can find something to use in freecad using c than i can able to try to connect pharo and FreeCAD
User avatar
Zolko
Veteran
Posts: 2213
Joined: Mon Dec 17, 2018 10:02 am

Re: Need tutorial using C/C++ example to create a cube in FreeCAD

Post by Zolko »

shawon58 wrote: Tue Apr 07, 2020 1:28 pm my task is to connect pharo smalltalk with freeCAD
OK, I reformulate: what makes your teacher believe that this task is achievable ?
try the Assembly4 workbench for FreCAD — tutorials here and here
User avatar
wandererfan
Veteran
Posts: 6317
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: Need tutorial using C/C++ example to create a cube in FreeCAD

Post by wandererfan »

shawon58 wrote: Tue Apr 07, 2020 1:28 pm my teacher ask me to find something using C/C++ example to create a cube in FreeCAD
See the Part module Python interface routines in ...Mod/Part/App/AppPartpy.cpp.
All the C++ code to create a Box and display it is in there. Just remove anything
that looks like Python interface code.

#996 Py::Object makeBox(const Py::Tuple& args)
//makes a box shape. This is just a shape. It needs to belong to a feature in order to
//be seen in the document.

#705 Py::Object show(const Py::Tuple& args)
//adds a feature to the current document. One of the parameters is the shape
//created above.

Can't help you with faro/smalltalk/UFFI. Also not sure how you use this code without the rest
of FreeCAD, but I guess that is part of your assignment
shawon58
Posts: 30
Joined: Thu Apr 02, 2020 4:38 am

Re: Need tutorial using C/C++ example to create a cube in FreeCAD

Post by shawon58 »

hi wandererfan, can u tell me where i can find the code ?
shawon58
Posts: 30
Joined: Thu Apr 02, 2020 4:38 am

Re: Need tutorial using C/C++ example to create a cube in FreeCAD

Post by shawon58 »

hi zolko, as we can communicate with c library using UFFI in pharosmalltalk , so we want to find something in c what can communicate with freeCAD, thats why we believe that this task maybe achievable. thanks
Post Reply