OpenDocument twice
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
-
- Posts: 75
- Joined: Mon Dec 14, 2009 9:49 am
OpenDocument twice
maybe this is very stupid.
I am not able to open the same file twice inside FreeCAD with App.OpenDocument().
The second one should behave like a separate file.
Creating a new document and import the "second" file from disk would also be ok.
Or do i have to make a workaround and have to copy of the file on disk.
Cheers
Jack - not really
I am not able to open the same file twice inside FreeCAD with App.OpenDocument().
The second one should behave like a separate file.
Creating a new document and import the "second" file from disk would also be ok.
Or do i have to make a workaround and have to copy of the file on disk.
Cheers
Jack - not really
Re: OpenDocument twice
An easy way is to create an empty document and then go to File > Merge projects.
-
- Posts: 75
- Joined: Mon Dec 14, 2009 9:49 am
Re: OpenDocument twice
More detailed:
Im using FreeCAD without GUI and having a drawing that consists on several FreeCAD documents.
Each FreeCAD document is imagined as an "assembly" inside my drawing.
So its is very easy to handle these "assemblies", because they are still separate FreeCAD documents.
The user is able to open a FreeCad file as a document (assembly) and to change some parts.
If he opens the document a second time (as an additional "assembly") this should be the latest file version,
not the one being loaded before and may be changed.
Cheers
Jack - not really
Im using FreeCAD without GUI and having a drawing that consists on several FreeCAD documents.
Each FreeCAD document is imagined as an "assembly" inside my drawing.
So its is very easy to handle these "assemblies", because they are still separate FreeCAD documents.
The user is able to open a FreeCad file as a document (assembly) and to change some parts.
If he opens the document a second time (as an additional "assembly") this should be the latest file version,
not the one being loaded before and may be changed.
Cheers
Jack - not really
Re: OpenDocument twice
OK, you can achieve this with a little trick. But be careful it's up to you to not override the file with another document.
Code: Select all
App.openDocument("C:/project.FCStd")
d=App.newDocument()
d.FileName="C:/project.FCStd"
d.restore()
-
- Posts: 75
- Joined: Mon Dec 14, 2009 9:49 am
Re: OpenDocument twice
Hi Werner,
nice trick!
Thanks
Jack - not really
nice trick!
Thanks
Jack - not really
Re: OpenDocument twice
What you probably want to do is planed for the Assembly workbench. Its a document link object.
You have one document with links to other (open or not) documents. There you can link the same document twice with different
positions. Thats the classical way Catia does it.
It makes no sense in the long run to have two documents in memory with the same data....
You have one document with links to other (open or not) documents. There you can link the same document twice with different
positions. Thats the classical way Catia does it.
It makes no sense in the long run to have two documents in memory with the same data....
Stop whining - start coding!
-
- Posts: 14
- Joined: Fri Nov 15, 2013 5:30 pm
Re: OpenDocument twice => FreeCAD 0.14
In FreeCAD 0.14 Doucment.FileName is read only.
Is there another way to open a Document twice?
Thanks
Jack-not-really
Is there another way to open a Document twice?
Thanks
Jack-not-really
wmayer wrote:OK, you can achieve this with a little trick. But be careful it's up to you to not override the file with another document.Code: Select all
App.openDocument("C:/project.FCStd") d=App.newDocument() d.FileName="C:/project.FCStd" d.restore()
Re: OpenDocument twice
No, not at the moment. Maybe in the restore() method we can allow an optional string parameter to make this working again.
However, it must not collide with the points listed here: viewtopic.php?f=8&t=4000&p=31509&sid=28 ... 7c8#p31509
However, it must not collide with the points listed here: viewtopic.php?f=8&t=4000&p=31509&sid=28 ... 7c8#p31509
Re: OpenDocument twice
Please notice that we have a new forum section dedicated to help with python scripting. Accordingly, I moved this topic here from the "Help about using FreeCAD" forum, which is about using FreeCAD's GUI.
Re: OpenDocument twice
There is now a method load() in the Python Document class where you can open a project in another document instance.