Unable to cast object of type 'Autodesk.Revit.DB.AnnotationSymbol' to type 'Autodesk.Revit.DB.PrintSetting'

Unable to cast object of type 'Autodesk.Revit.DB.AnnotationSymbol' to type 'Autodesk.Revit.DB.PrintSetting'

Anonymous
Not applicable
1,555 Views
1 Reply
Message 1 of 2

Unable to cast object of type 'Autodesk.Revit.DB.AnnotationSymbol' to type 'Autodesk.Revit.DB.PrintSetting'

Anonymous
Not applicable

Hi Can anyone help with the error in the subject line and in the attached? Many thanks.

 

DotNETError.png

0 Likes
1,556 Views
1 Reply
Reply (1)
Message 2 of 2

architect.bim
Collaborator
Collaborator

Hi!

There is something wrong in your code that leads to aInvalidCastException exception, which is thrown when the conversion of an instance of one type to another type is not supported.

Somewhere in your code you pass instance of AnnotationSymbol class instead of PrintSetting.


Maxim Stepannikov | Architect, BIM Manager, Instructor
0 Likes