Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Open model in the current session.

2 REPLIES 2
Reply
Message 1 of 3
Anonymous
274 Views, 2 Replies

Open model in the current session.

Anonymous
Not applicable
I have an external application (VB.NET) that copies a central model from a server location to the local computer and renames it per our Revit/CAD standards. I need to open that local model in the current open session of Revit. I seem to be hung up on the easiest part of the code. Documentation includes this function, but I’m not sure how to implement it.

Public Function OpenDocumentFile( ByVal fileName As String) As Document

Thanks in advance.
0 Likes

Open model in the current session.

I have an external application (VB.NET) that copies a central model from a server location to the local computer and renames it per our Revit/CAD standards. I need to open that local model in the current open session of Revit. I seem to be hung up on the easiest part of the code. Documentation includes this function, but I’m not sure how to implement it.

Public Function OpenDocumentFile( ByVal fileName As String) As Document

Thanks in advance.
2 REPLIES 2
Message 2 of 3
Anonymous
in reply to: Anonymous

Anonymous
Not applicable
My impression is that OpenDocumentFile will open the document programmatically (giving you access to the document object) - however, it does not change the "ActiveDocument". There is no API at present to modify the ActiveDocument within Revit.

-Matt
0 Likes

My impression is that OpenDocumentFile will open the document programmatically (giving you access to the document object) - however, it does not change the "ActiveDocument". There is no API at present to modify the ActiveDocument within Revit.

-Matt
Message 3 of 3
Anonymous
in reply to: Anonymous

Anonymous
Not applicable
mattmas wrote:
> My impression is that OpenDocumentFile will open the document programmatically (giving you access to the document object) - however, it does not change the "ActiveDocument". There is no API at present to modify the ActiveDocument within Revit.
>
> -Matt
Matt is right , OpenDocumentFile and CreateNewProject etc all open documents in
the background and aren't suitable for your requirements. You need to use other
win32API solutions for opening as the active document.

Guy
0 Likes

mattmas wrote:
> My impression is that OpenDocumentFile will open the document programmatically (giving you access to the document object) - however, it does not change the "ActiveDocument". There is no API at present to modify the ActiveDocument within Revit.
>
> -Matt
Matt is right , OpenDocumentFile and CreateNewProject etc all open documents in
the background and aren't suitable for your requirements. You need to use other
win32API solutions for opening as the active document.

Guy

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report