diff --git a/GuiA2p/Resources/ui/a2p_prefs.ui b/GuiA2p/Resources/ui/a2p_prefs.ui index ada83b80..72cdce14 100644 --- a/GuiA2p/Resources/ui/a2p_prefs.ui +++ b/GuiA2p/Resources/ui/a2p_prefs.ui @@ -60,6 +60,19 @@ + + + + force FixedPosition to all Imports + + + forceFixedPosition + + + Mod/A2plus + + + diff --git a/a2p_importpart.py b/a2p_importpart.py index 47df7f8b..ed8e74a4 100644 --- a/a2p_importpart.py +++ b/a2p_importpart.py @@ -183,7 +183,10 @@ def importPartFromFile(_doc, filename, importToCache=False): newObj.setEditorMode("timeLastImport",1) newObj.timeLastImport = os.path.getmtime( filename ) newObj.addProperty("App::PropertyBool","fixedPosition","importPart") - newObj.fixedPosition = not any([i.fixedPosition for i in doc.Objects if hasattr(i, 'fixedPosition') ]) + if a2plib.getForceFixedPosition(): + newObj.fixedPosition = True + else: + newObj.fixedPosition = not any([i.fixedPosition for i in doc.Objects if hasattr(i, 'fixedPosition') ]) newObj.addProperty("App::PropertyBool","subassemblyImport","importPart").subassemblyImport = subAssemblyImport newObj.setEditorMode("subassemblyImport",1) newObj.addProperty("App::PropertyBool","updateColors","importPart").updateColors = True diff --git a/a2plib.py b/a2plib.py index 72fabc73..d4ab5318 100644 --- a/a2plib.py +++ b/a2plib.py @@ -36,6 +36,7 @@ PARTIAL_PROCESSING_ENABLED = preferences.GetBool('usePartialSolver', True) AUTOSOLVE_ENABLED = preferences.GetBool('autoSolve', True) RELATIVE_PATHES_ENABLED = preferences.GetBool('useRelativePathes',True) +FORCE_FIXED_POSITION = preferences.GetBool('forceFixedPosition',True) SAVED_TRANSPARENCY = [] @@ -64,6 +65,10 @@ PARTIAL_SOLVE_STAGE1 = 1 #solve all rigid fully constrained to tempfixed rigid, enable only involved dep, then set them as tempfixed +#------------------------------------------------------------------------------ +def getForceFixedPosition(): + preferences = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/A2plus") + return preferences.GetBool('forceFixedPosition',False) #------------------------------------------------------------------------------ def getUseTopoNaming(): preferences = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/A2plus")