AnsweredAssumed Answered

Unable to cast COM object

Question asked by Olexandra T. on Jul 20, 2018
Latest reply on Jul 20, 2018 by 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.