how to capture the design process ?

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
imanipourmeysam
Posts: 23
Joined: Thu Nov 18, 2021 2:41 pm

how to capture the design process ?

Post by imanipourmeysam »

import helpme
#include <helpme> :D
Process capturing by using macro!!!
Dear team of FreeCAD.
I am a student in mechanical engineering and I want to ask you for some ideas about a task I have to do with FreeCAD and python.
The task is to find the process of conception that someone did. For example if a designer doing a design I want to see step by step what he did (like sketch1, Pad1, modification1, sketch2, pocket 1 and so on)
for this approach, I started recording the macro while doing a simple design and working on the macro code(python).
What I have in my mind as a solution is to do "save as" with a command between each step of the design process and then finally I will have many files, each one represents a step/steps.like the below shape.

First save as → step 1
Second save as → step 1 + step 2
Third save as → step 1 + step 2 + step 3
...

But it's not so clear where to put the save as commands in the recorded macro file and generate a lot of saved as files of steps and for solution I have this for now : (IF YOU HAVE OTHER IDEAS FOR THIS PLEASE TELL ME)
my solution :
I was thinking if somehow I could print the time of a done step (calling a function) at the beginning of each line of the macro file, then we can say the lines with the same time should be for the same step and I can put my save as command before time changing.

The second solution :
Maybe it's better to do a text processing of the macro file (python code) and put the save as command after each comment, like below
(### End command Std_Workbench), but the thing is that we won't have this comment always after each step, for example if I create a rectangle in the sketch the python code will not end with "### End command Std_Workbench".

I don't want to make you bored by my post, but if you can guide me for anything helpful to do my task, it would be highly appreciated, and I thank you in advance for any suggestion you might have for me during this task.

IMANIPOUR Meysam
User avatar
Shalmeneser
Veteran
Posts: 9558
Joined: Wed Dec 23, 2020 12:04 am
Location: Fr

Re: how to capture the design process ?

Post by Shalmeneser »

If I understand :
* Before working, you run your macro to save regularly.
* Regularly means each STEP (not 10 min).

Would it not be possible to work from the final file ?
imanipourmeysam
Posts: 23
Joined: Thu Nov 18, 2021 2:41 pm

Re: how to capture the design process ?

Post by imanipourmeysam »

Yes exactly I run macro to save regularly each step (not each 10 min)
what do you mean by the final file ?(do you mean the code in the python console of the file?) if yes, well, I can do it.
In fact, I am not limited about what to use and the only thing that is matter is to be able to find the steps (design process)
and the idea of using macro was just my thinking.
Thank you.
User avatar
Shalmeneser
Veteran
Posts: 9558
Joined: Wed Dec 23, 2020 12:04 am
Location: Fr

Re: how to capture the design process ?

Post by Shalmeneser »

Final file : *.fcstd

It's a zip file. Open document.xml.
imanipourmeysam
Posts: 23
Joined: Thu Nov 18, 2021 2:41 pm

Re: how to capture the design process ?

Post by imanipourmeysam »

Ahhm, ok.
Yes, it would be possible to work from the final file (*.fcstd)
chrisb
Veteran
Posts: 54177
Joined: Tue Mar 17, 2015 9:14 am

Re: how to capture the design process ?

Post by chrisb »

Is this really what you want? Follow all the steps a user has made? There are many videos where exactly this is done - and it is annoying. I don't want to see all the failing attempts an incapable user makes, disguised as showing pitfalls.

It may be more sensible to follow the dependencies of the objects and construct them one by one following Document.xml in the zipped FreeCAD file.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
imanipourmeysam
Posts: 23
Joined: Thu Nov 18, 2021 2:41 pm

Re: how to capture the design process ?

Post by imanipourmeysam »

chrisb wrote: Fri Nov 19, 2021 7:43 am Is this really what you want? Follow all the steps a user has made? There are many videos where exactly this is done - and it is annoying. I don't want to see all the failing attempts an incapable user makes, disguised as showing pitfalls.

It may be more sensible to follow the dependencies of the objects and construct them one by one following Document.xml in the zipped FreeCAD file.
Can you tell me where can I find this document.xml file of FreeCAD .
I am using GUI free cad in Windows OS and the saved file has this extension (.FCStd)
In fact, I don't see any zipped file after my design to unzip it and have the document.xml.
chrisb
Veteran
Posts: 54177
Joined: Tue Mar 17, 2015 9:14 am

Re: how to capture the design process ?

Post by chrisb »

imanipourmeysam wrote: Fri Nov 19, 2021 8:11 am Can you tell me where can I find this document.xml file of FreeCAD .
A file xxx.FCStd is actually a zip file. You can unzip it with with the freely available unarchivers or you use Menu->Tools->Project utility.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Post Reply