oPath_and_FileName = ThisDoc.PathAndFileName(False) ' without extension oQuestion = MessageBox.Show("Do you want to derive this file?", "iLogic",MessageBoxButtons.YesNo) If oQuestion = vbNo Then Return Else ' Create a new part file to derive the selected part into 'note: kPartDocumentObject is the default template Dim oPartDoc As PartDocument oPartDoc = ThisApplication.Documents.Add(kPartDocumentObject, ThisApplication.FileManager.GetTemplateFile(kPartDocumentObject)) 'Create a derived definition for the selected part Dim oDerivedPartDef As DerivedPartUniformScaleDef oDerivedPartDef = oPartDoc.ComponentDefinition.ReferenceComponents.DerivedPartComponents.CreateUniformScaleDef(ThisDoc.PathAndFileName(True)) ' set the scale to use oDerivedPartDef.ScaleFactor = 1 'define the mirror plane 'kDerivedPartMirrorPlaneXY = 27393 'kDerivedPartMirrorPlaneYZ = 27394 'kDerivedPartMirrorPlaneXZ = 27395 oDerivedPartDef.MirrorPlane = 27394 ' Create the derived part. oPartDoc.ComponentDefinition.ReferenceComponents.DerivedPartComponents.Add(oDerivedPartDef) ' Save the new derived part. oPartDoc.SaveAs(oPath_and_FileName & "_derived.ipt", False) oPartDoc.Close MessageBox.Show("New file created at:" & vbLf & oPath_and_FileName & "_derived.ipt", "iLogic") End If