Document.Open Property

Document.Open Property

Jef_E
Collaborator Collaborator
396 Views
2 Replies
Message 1 of 3

Document.Open Property

Jef_E
Collaborator
Collaborator

Hi,

 

I'm was searching the API and set my eye up-on the document.open property.

 

Spoiler

Document.Open Property

Parent Object: Document

Description

Property that returns whether this document is currently open. If False, the document has only been initialized and calling methods or properties on the document could cause it to open.

Syntax

Document.Open() As Boolean

Version

Introduced in Inventor version 11

 

The question raised to me, when is a document required to be open? And what does it mean for the document to be "initialized"? What can you do with a document when it's only initialized?

 

For me this description is vague, and would like some more info. 



Please kudo if this post was helpfull
Please accept as solution if your problem was solved

Inventor 2014 SP2
0 Likes
Accepted solutions (1)
397 Views
2 Replies
Replies (2)
Message 2 of 3

frederic.vandenplas
Collaborator
Collaborator

@Anonymous_ 

 

I don't dare to write the exact definition here of an initialized document 🙂

 

But in my opinion it will be similar to apprentice document possibilities.

 

I would create the situation as described in the help in inventor.

use vba and use the debug environment and reference that part.

In de immediate window, you'll see the accesible properties, if not accesible it will be indicated with an error trying to access it.

 

If you think this answer fullfilled your needs, improved your knowledge or leads to a solution,
please feel free to "kudos"
Message 3 of 3

rossano_praderi
Collaborator
Collaborator
Accepted solution

Hi Jef,

you initialize a document while you refer to it (as banal example), which mean begin to assign your document to a variable for the next steps.


For example:
- you create a new document (with your code), while you are not using any methods o properties which require it to be open, then "Document.Open" will return the value "False"
- you make a reference to a closed document, same previous situation

 

Opening a document mean lock it for read/write operations, refer to it doesn't mean "Open the Document".

 

Using "Apprentice" doesn't mean "not opening the Document", if you would like to make changes you have to open and close the document.

 

At the end, this property will return "True" only if your referencing document is already open, return "False" while it's referenced/initialized.

 

I hope to have made a clear explanation and that can be helpful to understand it better.

 

Bregs

Rossano Praderi



--------------------------------------
If my post answers your question, please click the "Accept as Solution"
button. This helps everyone find answers more quickly!
---------------
0 Likes