3 Replies Latest reply on Jul 20, 2018 10:05 AM by Olexandra T.

    Unable to cast COM object

    Olexandra T.

      Hi. I have an error when try to build my project. Error message: unable to cast com object of type 'system.__comobject' to interface type 'solidworks.interop.sldworks.rendermaterial'.

      My code is :

      RenderMaterial swMaterial = default(RenderMaterial);               

      swMaterial = (RenderMaterial)face;


      Where face - Face2 of Component.

      What am i doing wrong?

      Thanks for any help.