Anonymous
999 Views, 4 Replies
01-29-2018
02:14 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
01-29-2018
02:14 PM
Hi,
I am using VBA to look through a folder of Custom iParts and fix any that have lost connection to their iFactory. It seems I can do this with regular iParts but not custom ones?
I'm having trouble with iPartMember.ChangeRow. I can call .ChangeRow(intRow) but I can't figure out how to specify custom properties. I have only one custom property, "Length".
Here is my code:
Sub Test_iPartFolder()
Dim sFile As String
Const sPath As String = "C:\users\ntonkinson\desktop\102767\"
Dim oDoc As Document
Dim oIpart As iPartMember
sFile = Dir(sPath & "*.ipt*")
Do Until sFile = ""
Set oDoc = ThisApplication.Documents.Open(sPath & sFile, False)
If oDoc.ComponentDefinition.IsiPartMember = False Then GoTo NextFile
Set oIpart = oDoc.ComponentDefinition.iPartMember
If oIpart.HealthStatus <> kUpToDateHealth Then GoTo NextFile
'to do: pre-load iFactory tables to determine ChangeRow
'fix it
Call oIpart.ChangeRow(668) 'works if I only call an int, but not if I use other arguments
'in this specific test case, I know I need to call row 668. Later I will add logic to determine what row is needed.
oDoc.Update
oDoc.Save
NextFile:
oDoc.Close
DoEvents
sFile = Dir
Loop
End Sub
This article and this post shows how to use custom properties but in my IDE method does not seem to support more than two arguments.
Environment:
Inventor 2015, no vault
Windows 7
Related posts:
Solved! Go to Solution.