2 Replies Latest reply on Feb 27, 2014 3:19 AM by Ralf Brostedt

    Error querying IDerivedPartFeatureData interface in SW2014

    Ralf Brostedt

      We have a SolidWorks AddIn that analyzes a part document feature by feature and also handles derived parts.

       

      Whenever traversing through the features encounters a "stock" or "mirror stock" feature, I call the feature's GetDefinition() method and cast the result into a IDerivedFeatureData object, while remembering if it is mirrored (mirror stock) or not (stock).

      This worked very well until SolidWorks 2013 (including).

       

      We expected the SolidWorks 2014 API to be backward compatible so that the 2013's designated AddIn would also work in 2014, but though the stock object seem to further work as expected, a mirror stock cannot be cast into a IDerivedFeatureData interface anymore:

       

      "Unable to cast COM object of type 'System.__ComObject' to interface type 'SolidWorks.Interop.sldworks.DerivedPartFeatureData'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{A1672AF7-E65F-46E8-800C-7CBF4DA6E80F}' failed due to the following error: Interface not supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE))."

       

      Does anybody know if there has something changed in the SWX API from version 2013 to 2014 regarding mirror stock objects? Or is it a bug in the new version's API?