.NET

Reply
Valued Contributor
mbujak
Posts: 53
Registered: ‎07-07-2004
Message 1 of 3 (161 Views)

Temporary Document and Database

161 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
mbujak
Posts: 53
Registered: ‎07-07-2004
Message 2 of 3 (138 Views)

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?

 

Regards,

 

Mike

Valued Mentor
DiningPhilosopher
Posts: 370
Registered: ‎05-06-2012
Message 3 of 3 (113 Views)

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
Announcements
Are You Going To Be @ AU 2014? Feel free to drop by our AU topic post and share your plans, plug a class that you're teaching, or simply check out who else from the community might be in attendance. Ohh and don't forgot to stop by the Autodesk Help | Learn | Collaborate booths in the Exhibit Hall and meet our community team if you get a chance!