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!
leoheck
Veteran
Posts: 1222
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 »

Alright I could track the issue. Thanks, easyw-fc

Anything in this "Import > Mode", that is not the "Single Document", asks me to save a new file when importing .step files.
Well, I have no idea what this "Import Mode" means, then.
Screenshot-20220721164037-361x286.png
Screenshot-20220721164037-361x286.png (26.96 KiB) Viewed 1198 times
I could also find another PEBCAK issue that is around for such a long time.
This item shows something that you should "click to enable", but the tooltip says you should "click to disable"
Screenshot-20220721164026-427x136.png
Screenshot-20220721164026-427x136.png (18.15 KiB) Viewed 1198 times
Last edited by leoheck on Sun Jul 24, 2022 7:18 pm, edited 1 time in total.
User avatar
easyw-fc
Veteran
Posts: 3629
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 »

leoheck wrote: Thu Jul 21, 2022 7:45 pm Anything in this Import > Mode, that is not "Single Document", asks me to save a new file.
Well, I have no idea what this "Import Mode means", then.
So it was a FC setting and not the auto-save macro... a different issue with similar behavior

Concerning kicadStepUp, the cheat-sheet pdf is suggesting which Import settings a user should adopt and it shows 'single document'.

I don't know when Import mode has been introduced (probably on FC0.19), but I suspect it was related to some assembly tool interoperability
I can't see where this option is documented...
leoheck wrote: Thu Jul 21, 2022 7:45 pm This item shows something that you should "click to enable", but the tooltip says you should "click to disable"
this should be reported to GH

Moreover this option is quite annoying because mislead many users
https://forum.freecadweb.org/viewtopic. ... 80#p610180
https://forum.freecadweb.org/viewtopic. ... 92#p610192

It should be a different default STEP import / export settings to avoid such a mistakes
wmayer
Founder
Posts: 20242
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 »

leoheck wrote: Thu Jul 21, 2022 7:45 pm This item shows something that you should "click to enable", but the tooltip says you should "click to disable"
The tooltip is totally wrong and its German translation is even worse. The option causes following behaviour:
  1. If this option is checked and the legacy STEP import is used (i.e. Use LinkGroup is un-checked) then all shapes are kept as stand-alone part features
  2. If this option is un-checked and the legacy STEP import is used (i.e. Use LinkGroup is un-checked) then the behaviour is almost the same as above. The difference is that free vertexes, edges or wires are ignored -- but not if invisible objects are imported.
  3. If this option is checked and the new STEP import is used (i.e. Use LinkGroup is checked) then all shapes will be collected in a compound and added to the document as a single part object
  4. If this option is un-checked and the new STEP import is used (i.e. Use LinkGroup is checked) then all shapes are kept as stand-alone part features
easyw-fc wrote: Thu Jul 21, 2022 9:59 pm I don't know when Import mode has been introduced (probably on FC0.19), but I suspect it was related to some assembly tool interoperability
I can't see where this option is documented...
As far as I can see asking the user to save the document is only needed if the LinkGroup option is set. For the legacy STEP import it's superfluous.
User avatar
easyw-fc
Veteran
Posts: 3629
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 »

wmayer wrote: Fri Jul 22, 2022 12:18 pm The option causes following behaviour:
  1. If this option is checked and the legacy STEP import is used (i.e. Use LinkGroup is un-checked) then all shapes are kept as stand-alone part features
  2. If this option is un-checked and the legacy STEP import is used (i.e. Use LinkGroup is un-checked) then the behaviour is almost the same as above. The difference is that free vertexes, edges or wires are ignored -- but not if invisible objects are imported.
  3. If this option is checked and the new STEP import is used (i.e. Use LinkGroup is checked) then all shapes will be collected in a compound and added to the document as a single part object
  4. If this option is un-checked and the new STEP import is used (i.e. Use LinkGroup is checked) then all shapes are kept as stand-alone part features
this is not the behavior I have noticed..
I tried with a clean profile install and unless I check the 'Use LinkGroup' once, Apply and then revert to unchecked,
the step model is always imported with all shapes collected in a compound and added to the document as a single part object.

It seems the cfg file is not fully populated with all the preference values and it is not handled correctly until the 'Use LinkGroup' is added to it.
cfg-comparison.png
cfg-comparison.png (104.42 KiB) Viewed 1070 times
import-compound-enabled.png
import-compound-enabled.png (613.32 KiB) Viewed 1070 times
two-objs.step
(23.71 KiB) Downloaded 17 times
two-objs.FCStd
(4.91 KiB) Downloaded 16 times
wmayer
Founder
Posts: 20242
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 »

easyw-fc wrote: Fri Jul 22, 2022 1:37 pm this is not the behavior I have noticed..
I tried with a clean profile install and unless I check the 'Use LinkGroup' once, Apply and then revert to unchecked,
the step model is always imported with all shapes collected in a compound and added to the document as a single part object.
According to your screenshot the Enable STEP Compound merge option is enabled (ReadShapeCompoundMode=1). What happens with the attached STEP file Assembly-Part.step when loading it for the four test cases:
  1. UseLinkGroup=0, ReadShapeCompoundMode=1
  2. UseLinkGroup=0, ReadShapeCompoundMode=0
  3. UseLinkGroup=1, ReadShapeCompoundMode=1
  4. UseLinkGroup=1, ReadShapeCompoundMode=0
?
Assembly.FCStd
As a reference you can compare it with the imported STEP
(16.49 KiB) Downloaded 19 times
Assembly-Part.step
For the STEP file all export options were un-checked
(31.03 KiB) Downloaded 19 times
For me the results are:
  1. The hierarchy is kept and all five part objects are there as stand-alone features
  2. The hierarchy is kept but the Spiral feature is missing. The other four part objects are stand-alone features
  3. The hierarchy is lost and there is a single compound object
  4. The result is similar to that in 1. The only difference is that instead of Part containers Link groups are used
It seems the cfg file is not fully populated with all the preference values and it is not handled correctly until the 'Use LinkGroup' is added to it.
But this looks like a bug then. It sounds like that for some parameters different default values are used.
User avatar
easyw-fc
Veteran
Posts: 3629
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 »

wmayer wrote: Fri Jul 22, 2022 2:29 pm According to your screenshot the Enable STEP Compound merge option is enabled (ReadShapeCompoundMode=1). What happens with the attached STEP file Assembly-Part.step when loading it for the four test cases:
  1. UseLinkGroup=0, ReadShapeCompoundMode=1
  2. UseLinkGroup=0, ReadShapeCompoundMode=0
  3. UseLinkGroup=1, ReadShapeCompoundMode=1
  4. UseLinkGroup=1, ReadShapeCompoundMode=0
?
I get the same results only after enabling and disabling once the 'UseLinkGroup=1' (at a clean cfg file)
wmayer wrote: Fri Jul 22, 2022 2:29 pm
It seems the cfg file is not fully populated with all the preference values and it is not handled correctly until the 'Use LinkGroup' is added to it.
But this looks like a bug then. It sounds like that for some parameters different default values are used.
I think this is a bug indeed...
I can replicate simply deleting cfg file and then launching FC and opening 'Assembly-Part.step' without touching the Preferences.
The loading (which has 'Enable Compound' set by default and 'UseLinkGroup' unchecked) will have hierarchy lost and a single compound object (your result n.3 instead of result n.1)
import-compound-enabled-clean-cfg.png
import-compound-enabled-clean-cfg.png (299.42 KiB) Viewed 1015 times
After unchecking 'Enable Compound' and re-checking it, FC behaves as per your results...

Moreover in the legacy exporter w/ UseLinkGroup=0, ReadShapeCompoundMode=0, as you noted, the hierarchy is kept but the Spiral feature is missing.
The Spiral (an edge) is written in STEP file, but it is not loaded correctly using the legacy STEP parser (which is using Part containers)
This is an other old bug I would hope could be fixed.

STEP Import/Export have some settings that should be written as default IMO when creating the cfg file (on a clean installation).
This is because of the intention to get the best interoperability with commercial sw...
I remember I did a long discussion here at the forum few years ago, but I can find it ATM... I'm going to search for the thread again...

FreeCAD is extremely powerful, but it has even a great value when allows people to work in open source CAD and deploy the work using STEP format to a commercial CAD environment.
wmayer
Founder
Posts: 20242
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 »

easyw-fc wrote: Fri Jul 22, 2022 3:56 pm STEP Import/Export have some settings that should be written as default IMO when creating the cfg file (on a clean installation).
This is because of the intention to get the best interoperability with commercial sw...
I remember I did a long discussion here at the forum few years ago, but I can find it ATM... I'm going to search for the thread again...
git commit 710e16b340 adds a class for consistent access of the parameters
git commit b00044c656 initializes the preferences page
git commit fed9f20f482 changes the algorithm to use the above class for consistent access

If the default value of a parameter should be changed then only ImportExportSettings must be adjusted.
leoheck
Veteran
Posts: 1222
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 »

easyw-fc wrote: Thu Jul 21, 2022 9:59 pm
leoheck wrote: Thu Jul 21, 2022 7:45 pm Anything in this Import > Mode, that is not "Single Document", asks me to save a new file.
Well, I have no idea what this "Import Mode means", then.
Concerning kicadStepUp, the cheat-sheet pdf is suggesting which Import settings a user should adopt and it shows 'single document'.
kicadSetpUp was never the issue on this post, I never told that.

I just used it to exemplify the behavior since it was potentializing it once it is being used to load multiple .step files.

Also, there is no mention of a "single document" mode inside of this pdf.

The link you shared is also horrible since Github does not allow us to select or search text inside the document.

If you download and search for "document" there are only 2 matches.
leoheck
Veteran
Posts: 1222
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 »

easyw-fc wrote: Thu Jul 21, 2022 9:59 pm Concerning kicadStepUp, the cheat-sheet pdf is suggesting which Import settings a user should adopt and it shows 'single document'.
kicadSetpUp was never the issue on this post, I never told that.

I just used it to exemplify the behavior since it was potentializing it once it is being used to load multiple .step files.

Also, there is no mention of a "single document" mode inside the given cheat-sheet pdf.

The link you shared is also horrible since Github does not allow us to select or search text inside the document.

But anyway, If you download and search for "document" there are only 2 matches that are not related to what you said.
User avatar
easyw-fc
Veteran
Posts: 3629
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 »

leoheck wrote: Sun Jul 24, 2022 7:30 pm kicadSetpUp was never the issue on this post, I never told that.
I just used it to exemplify the behavior since it was potentializing it once it is being used to load multiple .step files.
....
Also, there is no mention of a "single document" mode inside of this pdf.
there is a link to the kicadStepUp cheatsheet document in the README.md document at GH
Moreover kicadStepUp cheatsheet is bundled in kSU WB @ Demo sub Menu
kSU-cheatsheet-link.png
kSU-cheatsheet-link.png (115.09 KiB) Viewed 846 times
and in this document there is at page 11 the image of the suggested STEP import option:
Preferences Page for configuring STEP Import Export (FC0.19)
and there you can see that 'Single document' is suggested
kSU-pg11.png
kSU-pg11.png (236.27 KiB) Viewed 846 times
leoheck wrote: Sun Jul 24, 2022 7:30 pm The link you shared is also horrible since Github does not allow us to select or search text inside the document.

If you download and search for "document" there are only 2 matches.
the link doesn't allow you to show immediately the pdf just because the pdf is too big to be displayed in GH... may be I have added to many info for the user that I shouldn't?
As I already suggested at GH at a issue you opened, when you told me:
easyw-fc wrote:
leoheck wrote:Yeah, then I will keep using .step exported from Kicad since time is precious and we cannot buy it.
sometimes the time you invest in learning a new tool would save time later ;)
https://github.com/easyw/kicadStepUpMod ... 1172678431
It seems something like RTFM ;)
Post Reply