LoadFamily Method Exceptions

LoadFamily Method Exceptions

ahmadmahrous_1
Contributor Contributor
331 Views
1 Reply
Message 1 of 2

LoadFamily Method Exceptions

ahmadmahrous_1
Contributor
Contributor

As per API Documentation for: LoadFamily Method (Document, IFamilyLoadOptions) at this page:

https://www.revitapidocs.com/2021.1/cb950c8e-f440-c6db-8563-d1dd16ef3fee.htm 

Autodesk.Revit.Exceptions InvalidOperationException may be raised when "the load was cancelled due to a conflict and a False return from one of the interface methods".

What is this mean?

Thank you

0 Likes
332 Views
1 Reply
Reply (1)
Message 2 of 2

bhprest
Advocate
Advocate

Someone please correct me if this is wrong.

 

LoadFamily() takes two arguments:

  1. a target document
  2. class that inherits from the IFamilyLoadOptions interface

 

The IFamilyLoadOptions interface has two methods, both have a bool return value. Revit uses these two methods to execute some user-defined code prior to loading the family. This exception will be thrown if either of these methods return false.

 

Hope this helps.

0 Likes