FreeCad forces me to save a file when a .step file is loaded.

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
User avatar
adrianinsaval
Veteran
Posts: 5541
Joined: Thu Apr 05, 2018 5:15 pm

Re: FreeCad forces me to save a file when a .step file is loaded.

Post by adrianinsaval »

easyw-fc wrote: Mon Oct 03, 2022 7:59 pm Come on,
you say: "You click Export" but the code is running automatically by a script, there is no user intervention apart a continuous integration.
Forcing the dialog to prompt at each call to export a STEP file, will require a human action, breaking the building.
that is not true, the export GUI command launches a file dialog to chose the name and location of the exported file, but in script you can directly specify the filename as an argument. The same can happen with export settings, the GUI command can launch a dialog asking for the settings but the equivalent macro would just specify those as an argument for the function or skip those arguments to use default values.
User avatar
easyw-fc
Veteran
Posts: 3630
Joined: Thu Jul 09, 2015 9:34 am

Re: FreeCad forces me to save a file when a .step file is loaded.

Post by easyw-fc »

adrianinsaval wrote: Tue Oct 04, 2022 11:31 am that is not true, the export GUI command launches a file dialog to chose the name and location of the exported file, but in script you can directly specify the filename as an argument. The same can happen with export settings, the GUI command can launch a dialog asking for the settings but the equivalent macro would just specify those as an argument for the function or skip those arguments to use default values.
I know it very well, because I use this in my code, but the issue is visible when you import a file with DXF import...

try this code when you have the 'Show this dialog when importing and exporting' checkbox checked

Code: Select all

import importDXF
importDXF.open(u"c:/myfile.dxf")
you will be prompted for the dialog even if you have detailed the filename...
that would be the similar behavior and issue if the code will add this show dialog option
User avatar
adrianinsaval
Veteran
Posts: 5541
Joined: Thu Apr 05, 2018 5:15 pm

Re: FreeCad forces me to save a file when a .step file is loaded.

Post by adrianinsaval »

It does not have to be, IMO that's a bad implementation in DXF import, it should at the very least have a flag in the python command to launch or not the dialog. I would even consider it a bug since it's breaking scripting depending on user settings.
User avatar
easyw-fc
Veteran
Posts: 3630
Joined: Thu Jul 09, 2015 9:34 am

Re: FreeCad forces me to save a file when a .step file is loaded.

Post by easyw-fc »

adrianinsaval wrote: Tue Oct 04, 2022 11:57 am It does not have to be, IMO that's a bad implementation in DXF import, it should at the very least have a flag in the python command to launch or not the dialog. I would even consider it a bug since it's breaking scripting depending on user settings.
ok, this is an option (at least an optional flag, avoiding to break previous implementations)... but we are discussing about a really needed feature? what pro? and coming from a user which suggests that reading the manual is a bad habit?
just to remember:
leoheck wrote: Tue Jul 26, 2022 11:51 pm This looks like a if-it-requires-a-manual-then-it-is-no-good kind of situation.
I would say like jriegel motto:
Stop whining - start coding!
if the guy is thinking seriously to modify something he should stop whining and prepare a PR, after a discussion...
You can see his attitude also on many other threads...

Just my 2 cents.
wmayer
Founder
Posts: 20246
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: FreeCad forces me to save a file when a .step file is loaded.

Post by wmayer »

that is not true, the export GUI command launches a file dialog to chose the name and location of the exported file
This function is part of the core system and depending on what the selected file type is the export() function of the module is called that supports the file type. Currently, at this point it's not possible to show another dialog with settings because that dialog must be part of the module and the core system doesn't know about this dialog.

A possibility to make this working would be that a module implements a function exportSettings() and the returned value will be passed to export() as an additional argument.

The other way how it's e.g. done with the DXF import/export is to show that dialog within the export() function but this is an ugly way because the author of a script must be aware of this behaviour and (tmp.) switch off the dialog.
leoheck
Veteran
Posts: 1223
Joined: Tue Mar 13, 2018 5:56 pm
Location: Coffee shop

Re: FreeCad forces me to save a file when a .step file is loaded.

Post by leoheck »

It looks like you don't want to discuss and learn, I don't even know why I am putting energy into this. That is fine, I cannot teach people how to be a better version of themselves. They have to want and do this by themselves.
wmayer
Founder
Posts: 20246
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: FreeCad forces me to save a file when a .step file is loaded.

Post by wmayer »

git commit 4d719d516e adds support to provide export options.

Every module is now free to support export options. If a module supports it then it must extend its export() function to handle three arguments. The third argument is optional.

git commit 5af6521377 implements the exportOptions() function for the ImportGui module.

git commit 5ee0f0a8cf implements a dialog for STEP export.
User avatar
easyw-fc
Veteran
Posts: 3630
Joined: Thu Jul 09, 2015 9:34 am

Re: FreeCad forces me to save a file when a .step file is loaded.

Post by easyw-fc »

Here comes the guru:
leoheck wrote: Tue Oct 04, 2022 1:39 pm It looks like you don't want to discuss and learn, I don't even know why I am putting energy into this. That is fine, I cannot teach people how to be a better version of themselves. They have to want and do this by themselves.
with his real face:
leoheck wrote: Tue Aug 30, 2022 12:14 am Sorry, where can I go to talk with real human beings?

It looks like this forum is just full of trolls.

Maybe I have to go back to Reddit or Facebook, or even Instagram. They talk more on Instagram these days than on this forum.

It looks like there is no one that can handle a conversation like a real human being in this stupid forum. Serioslly. WTF!
User avatar
adrianinsaval
Veteran
Posts: 5541
Joined: Thu Apr 05, 2018 5:15 pm

Re: FreeCad forces me to save a file when a .step file is loaded.

Post by adrianinsaval »

leoheck ans easyw-fc please both de-escalate and try to be more polite in the future, and when discussing a feature request I would appreciate if the focus was on the merit of the idea and of the objections rather than of the person behind or against it.
User avatar
easyw-fc
Veteran
Posts: 3630
Joined: Thu Jul 09, 2015 9:34 am

Re: FreeCad forces me to save a file when a .step file is loaded.

Post by easyw-fc »

adrianinsaval wrote: Wed Oct 05, 2022 12:29 pm leoheck ans easyw-fc please both de-escalate and try to be more polite in the future, and when discussing a feature request I would appreciate if the focus was on the merit of the idea and of the objections rather than of the person behind or against it.
I replied in a polite way ... I was moderating a user that already did a mess at the forum ...
Just to remember you, in case you missed (and I think you did because of the way you stand in your post):
chrisb wrote: Tue Aug 30, 2022 12:35 am This is not the only topic of leoheck which went out of whack. I have banned him for a week.
and about the merit of the idea it depends also on the way the idea is exposed...
Post Reply