Quantcast
Channel: All Revit API Forum posts
Viewing all articles
Browse latest Browse all 66666

Re: Open .rfa file to edit it

$
0
0

I answered an almost identical question this very morning:

 

https://stackoverflow.com/questions/52161965/revit-api-how-to-make-a-external-command-run-asynchrously

 

The Revit API can only be used within a valid Revit API context, and such a context is provided exclusively by Revit events:

 

http://thebuildingcoder.typepad.com/blog/2015/08/revit-api-context-and-form-creation-errors.html#2

 

http://thebuildingcoder.typepad.com/blog/2015/12/external-event-and-10-year-forum-anniversary.html#2

  

You can however implement an external event and trigger that from outside to obtain access to a valid Revit API context. This is discussed in detail with many solutions provided by The Building Coder in the topic group on Idling and External Events for Modeless Access and Driving Revit from Outside:

 

http://thebuildingcoder.typepad.com/blog/about-the-author.html#5.28

 

Another approach might be to make use of the DocumentOpened Event:

 

https://apidocs.co/apps/revit/2019/7e5bc7a1-0475-b2ec-0aec-c410015737fe.htm

 

You could use that to trigger the execution flow you desire.

 

I would start out reading the numerous solutions listed in the topic group, and probably end up making use of an external event.

 

Good luck and have fun!

 

Cheers, 

 

Jeremy

 


Viewing all articles
Browse latest Browse all 66666

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>