Valued Contributor
53 Posts
3 Kudos
Registered: ‎07-07-2004
Post 1 of 3

Temporary Document and Database

165 Views, 2 Replies
10-18-2012 05:51 AM

I have a preview control on a window that I want to disply temporary custom entities that the user can build before adding to the current working document. Is there a way to create a temporary document and database that I can show in my preview control? The PreviewControl was created with the guidance of the BlockView.net sample.


What I mean by temporary, is a document / database that cannot be displyed or edited in the editor window.


Any suggestions?


Mike B

Valued Contributor
53 Posts
3 Kudos
Registered: ‎07-07-2004
Post 2 of 3

Re: Temporary Document and Database

10-18-2012 01:46 PM in reply to: mbujak

Well, it appears I can use an "in-memory" database without a problem, but the strange thing is that the Model needs to be created using GraphicsManager from a Document in order for it to be hooked up to the graphics system for rendering.


Is there any other way of getting the Model object hooked up to the graphics system?





Valued Mentor
370 Posts
175 Kudos
Registered: ‎05-06-2012
Post 3 of 3

Re: Temporary Document and Database

10-21-2012 09:41 PM in reply to: mbujak

If the second argument to the Database() constructor is false, the database is associated with the Document that was active at the point when the constructor was called, and you should be able to use that Document's GraphicsManager. That same document must be active in order for graphics to correctly update. If you are using some modeless UI then you should probably use a different Database for each open document, and use the one associated with the currently active document.


You can call DocumentCollection.GetDocument() to get the associated document for a database.

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Are you interested in helping shape the future of the Autodesk Community? To participate in this brief usability study, please click here. Your time and input is greatly appreciated!