[solved] Creating a new .FCStd from Document.xml
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
[solved] Creating a new .FCStd from Document.xml
Following this discussion, I'm interested to know if I can directly edit the Document.xml file and then generate a .FCStd file as explained here. I followed the instructions Tools → Project utility... Extract to unarchive the .FCStd file:
and then Tools → Project utility... Create project and selecting the Document.xml file to create back the .FCStd file:
However the generated .FCStd file has some hidden parts in which their visibility can't be toggled:
and then Tools → Project utility... Create project and selecting the Document.xml file to create back the .FCStd file:
However the generated .FCStd file has some hidden parts in which their visibility can't be toggled:
- Attachments
-
- Untitled.gif (190.56 KiB) Viewed 3163 times
Last edited by foadsf on Fri Oct 11, 2019 8:44 pm, edited 1 time in total.
Re: Creating a new .FCStd from Document.xml
Just "Mark to recompute" then F5 the document and everything's fine.
Maybe the BREP aren't created in the FCStd file when generated.
Maybe the BREP aren't created in the FCStd file when generated.
Re: Creating a new .FCStd from Document.xml
That was very quick! tanks a lot
Is this a bug or expected behavior? should I open a bug report or feature request?
Re: [solved] Creating a new .FCStd from Document.xml
It sure is not a bug. Fumbling in the Document.xml is of course at your own risk.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Re: [solved] Creating a new .FCStd from Document.xml
It doesn't seem like an expected behavior to me. I think it should take care of the recompute process upon opening automatically.
Well, actually it is a very nice thing to fumble [with] Next step I want to see if I can include/import/nest another XML file inside the Document.xml and see if I can have some general parameters. If these are possible then one can have full code based CAD (AKA programmatic to generative design) using these XMLs
Re: [solved] Creating a new .FCStd from Document.xml
Not everything that doesn't meet your expectations is a bug, see https://forum.freecadweb.org/viewtopic.php?f=3&t=5236.
I would go even one step further: It would be nice if a FreeCAD model could be stored without any BRep information, which would make the file smaller at the cost of longer loading time, just as some kind of ultra compression mode.
I think it should take care of the recompute process upon opening automatically.
That would make a nice feature request.
That having said, I still think your idea of generating a FreeCAD file is the only possibility to transfer a model from another CAD program including the modeling history.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
- adrianinsaval
- Veteran
- Posts: 5548
- Joined: Thu Apr 05, 2018 5:15 pm
Re: [solved] Creating a new .FCStd from Document.xml
Aren't most things achievable through macros? my understanding is that freecad macros are just python scripts so you can go wild with them, someone correct me if I'm wrong
Re: [solved] Creating a new .FCStd from Document.xml
hmmm, both have their own benefits. The current version is fast to load, especially if your design is really big and complicated. But the XML version is small. I wouldn't consider it as a form of compression or a huge advantage though. The main advantage IMO is the fact that one can use conventional version control such a git, mercurial, subversion ... which seems to be a huge feature lacking in the FC ecosystem at the moment. besides if there is any possibility to import/include/nest XMLs recursively into one another and if there are any possibilities to define parameters across the scop of an XML file, then theoretically one should be able to achieve full programmatic CAD using just XMLs.chrisb wrote: ↑Fri Oct 11, 2019 9:43 pm I would go even one step further: It would be nice if a FreeCAD model could be stored without any BRep information, which would make the file smaller at the cost of longer loading time, just as some kind of ultra compression mode.
That would make a nice feature request.
I would say there should be an option in the FreeCAD settings to save files as it is right now or pure XML format. Also, this should be added to the import-export instead of the peculiar Tools → Project utility.
The way I see it is that the Document.xml represents geometry and GuiDocument.xml their graphical representation within the FreeCAD GUI. Somewhat similar, but not entirely accurate, to how HTML and CSS work.
Not sure what you mean by this. Would you please elaborate?
Re: [solved] Creating a new .FCStd from Document.xml
Well despite my love for Python, designing in FreeCAD using just its Python API has its own limitations. See my workflow for designing a new concept is first pen and paper (I would love to have something like Blender's Grease Pencil, but we yet to have that). Then I will start designing in the GUI putting values intuitively. while the design matures I will create a spreadsheet and add all the values in the spreadsheet to make the design parametric as much as possible. Now I could save the entire procedure as a Python macro but due to the many trials and errors, you would end up with a crazy amount of spaghetti Python code which requires psychic powers to decrypt and organize. And there is no guarantee that it works all the time (e.g., here). Plus being a scripting interpreted language comes with its own limitations. especially if you want to solve systems of algebraic ordinary or partial differential equations.adrianinsaval wrote: ↑Fri Oct 11, 2019 9:55 pm Aren't most things achievable through macros? my understanding is that freecad macros are just python scripts so you can go wild with them, someone correct me if I'm wrong
This discussion with Matt Keeter, the creator of libfive which uses Guile, and this discussion with whitequark, the maintainer of SolveSpace who envisions a Lua integration, might also be interesting.
Re: [solved] Creating a new .FCStd from Document.xml
There is already a possibility to transfer models from Catia, SolidWorks, ... to FreeCAD and vice versa: STEP files. But these STEP models don't know anything about their modeling history, they have no sketches, no pads, no pockets. If you want to preserve this information you have to rebuild it in the target system.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.