Results 1 to 2 of 2

Thread: External application - open Document

  1. #1
    Member
    Join Date
    2006-04
    Posts
    2

    Default External application - open Document

    Hi,

    I'm creating a batch application in Revit.
    It should open some rvt's and do some checks on it.

    I thought it was simple... but my code isn't working. I must be missing some basics..
    I allways get a "Object not initialized" on the line mydoc = app.... Logical I think, but how should I initialize an app from within an IExternalApp ? (Not from a IExternalCommand !!)
    Code:
    Public Function OnStartUp(ByVal myApp As UIControlledApplication) As Autodesk.Revit.UI.Result Implements IExternalApplication.OnStartup
            Dim app As Autodesk.Revit.ApplicationServices.Application
            Dim myDoc As Document
    
            myDoc = app.OpenDocumentFile("c:\\Temp\\test.rvt")
    
            Return (Autodesk.Revit.UI.Result.Succeeded)
        End Function
    Can someone help me ?

  2. #2
    Active Member
    Join Date
    2005-12
    Location
    Escondido, CA
    Posts
    89

    Default Re: External application - open Document

    I don't believe you can access documents in the OnStartup method. You need to get the document from the UIApplication class, which you can obtain from ExternalCommand calls or Events.

Similar Threads

  1. Revit can't run the external application
    By oakam430373 in forum Nordic - Revit Architecture
    Replies: 0
    Last Post: 2011-11-06, 01:20 PM
  2. cant display a menu as external application
    By andresvite in forum Revit - API
    Replies: 2
    Last Post: 2009-03-20, 09:15 PM
  3. Replies: 2
    Last Post: 2008-04-16, 07:11 PM
  4. Document application (.VLX) not found
    By stein1977 in forum AutoLISP
    Replies: 0
    Last Post: 2007-01-16, 11:29 PM
  5. Edit MText when using an external application
    By ruthellenwilliams in forum AutoCAD General
    Replies: 1
    Last Post: 2006-03-07, 05:06 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •