I've a problem by replacing multiple occurences in an assembly. One occurence works fine but the 2nd replacement throws an exception. Here my latest attemptim objApp As SolidEdgeFramework.Application = NothingDim objDoc As SolidEdgeAssembly.AssemblyDocument = NothingDim objOccurrence As SolidEdgeAssembly.Occurrence = NothingDim objOccurrences As SolidEdgeAssembly.OccurrencesDim part1 As StringDim part2 As StringDim file_name As String ' start app objApp = CreateObject("SolidEdge.Application") For i = 0 To dgvTeile.Rows.Count - 2' read row valuespart1 = dgvTeile.Rows(i).Cells(1).Valuepart2 = dgvTeile.Rows(i).Cells(2).Valuefile_name = dgvTeile.Rows(i).Cells(0).Value ' open fileobjApp.Documents.Open(file_name)objDoc = objApp.ActiveDocumentobjOccurrences = objDoc.OccurrencesobjOccurrence = objOccurrences.Item(1)objOccurrence.Replace(NewOcc
Posted by: Markus Feder
Post date: 8/26/2009 3:37:42 AM
i see, you have Item(1) in the both replaces. Is this correct? However, try with objApp.DoIdle after replace.
Posted by: JR
Post date: 8/27/2009 11:59:35 PM