Update Partslist in IDW is slow

Update Partslist in IDW is slow

Anonymous
Not applicable
329 Views
2 Replies
Message 1 of 3

Update Partslist in IDW is slow

Anonymous
Not applicable

We developed an Inventor-Addin, in this addin we update cells in the partslist like this:

 

foreach (PartsListRow partsListRow in partsList.PartsListRows)

{

   // this takes to long

    partsListRow[ConfigurationConstants.InventorPartslistItemItemIdColumnKey].Value = string.Empty;

}

 

in a small drawing everything is ok, but we have drawings with over 80 position then this command takes everytime 10 seconds and because we update 2 cells in each row this goes up to more then 30 minutes.

 

the same can be reprodused using a smal macro like this.

 

Any help would be welcome!

 

Sub UpdateZelle()

Dim partsList As partsList

Dim partsListRow As partsListRow

Dim drawing As DrawingDocument

Dim partsListCell As partsListCell

 

 

Set drawing = ThisApplication.ActiveDocument

Set partsList = drawing.ActiveSheet.PartsLists(1)

 

For Each partsListRow In partsList.PartsListRows

    partsListRow("ItemID") = ""

Next

 

End Sub

 

 

Regards

Daniel

0 Likes
330 Views
2 Replies
Replies (2)
Message 2 of 3

DeerSpotter
Collaborator
Collaborator

Why not create a Universal Update Code?

 'Define the open document
Dim openDoc As Document
openDoc = ThisDoc.Document

'Look at the model file referenced in the open document
Dim docFile As Document
If ThisDoc.ModelDocument IsNot Nothing Then
docFile = ThisDoc.ModelDocument
Else
MessageBox.Show("This drawing has no model reference", "iLogic")
Return
End If

iLogicVb.UpdateWhenDone = True 
InventorVb.DocumentUpdate()
InventorVb.DocumentUpdate(iProperties.Mass)
'InventorVb.DocumentUpdate(iProperties.Material)


'format model file name                   
Dim FNamePos As Long
FNamePos = InStrRev(docFile.FullFileName, "\", -1)                        
Dim docFName As String 
docFName = Right(docFile.FullFileName, Len(docFile.FullFileName) - FNamePos) 
InventorVb.DocumentUpdate(iProperties.Mass)

 

Image and video hosting by TinyPic
..........................................................................................................................
Did you find this reply helpful ? If so please use the Accept as Solution or Kudos button below.
..........................................................................................................................


See My LinkedIn Profile
0 Likes
Message 3 of 3

Anonymous
Not applicable

Thank you for your answer.

We have some special properties witch are not related to any model information. We just need to update this properteis in the drawing partslist not in the model.

 

0 Likes