AnsweredAssumed Answered

Solidworks API Macro Insert and mate derived part

Question asked by Joe Pickens on Sep 19, 2019

I am creating a macro in which the user makes a sketch with points and the macro inserts features around the point. What i am trying to do is reference the features back to the point so if the user moves the point it moves the features. With that said currently the macro uses 

 

"swPart.InsertPart2(derivedFileName, swInsertPartOptions_e.swInsertPartImportSolids)"

 

to insert a derived part and then i use

 

"swFeatMgr.InsertMoveCopyBody2(0#, 0#, 0#, 0#, XRotationPoint, YRotationPoint, ZRotationPoint, XRotation, YRotation, ZRotation, False, 1)" 

 

to place the derived part. The problem is that this method doesn't link the derived parts location to the point. If I was to do this manually i would insert the part using mates but i dont see any API call to allow me to do this.

 

Is there a way to locate a part using mates with API

Outcomes