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

Re: Revit 2025 and Visual Studio Code DocumentOpened event

$
0
0

Hi @Eduardo.SaezDRTV4 ,

 

It looks like the error you're seeing is due to a return statement in a method that is declared to return void.

public void DocumentOpenedHandler(object? sender, DocumentOpenedEventArgs e) { if (e.Status == RevitAPIEventStatus.Succeeded) { try { // Display a message box when a document is opened TaskDialog.Show("Test Macro", "Revit File Opened"); } catch (Exception) { TaskDialog.Show("Error", "There was a problem opening the document"); // No return is needed since the method is void } } }

Viewing all articles
Browse latest Browse all 67020

Trending Articles



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