AnsweredAssumed Answered

Add Smart Component not working

Question asked by Colin Poushay on Nov 24, 2016
Latest reply on Nov 29, 2016 by Colin Poushay

I am trying to insert a PEM fastener into an assembly document. My assembly document consists of one panel with a hole in it. Here is what my code looks like:

 

           String pemDoc = "C:\\swPEMS\\SP-832-1.SLDPRT";

            int errors = 99;

            int warnings = 99;

           ModelDoc2 pemModelDoc =   app.OpenDoc6(pemDoc, 1, 1, "", ref errors, ref warnings);

          

           var pemAdded = assemblyDocument.AddSmartComponent(pemDoc, x , y  z);

 

I can't figure out why 'AddSmartComponent' is returning null. As far as I can tell I have done things correctly; the pem  part document opens, and it contains Mate References.

 

I can add it to the assembly using the 'AddComponent' method, it's just the addSmartComponent method that does not work.

 

Thanks,

Colin

Outcomes