- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
Is there a way to use iLogic to update a parameter in a part (\top folder\count.ipt) given it's file path?
This parameter is used to hold a number - an external rule performs a save as (on a new file) reads the value from count.ipt, saves the file then add 1 to the parameter in count.ipt.
I had this working using Excel but it's throwing up a com error after a windows update..
Below is an external rule which loops saving a copy of the file you now have open. Reading the start number from an excel file (AutoNumberCounter.xlsx) - working before the windows update.
apologies - development code a bit messy..hopefully it provides a little more insight.
possibly replace 'AutoNumberCounter.xlsx' with 'count.ipt' - if the parameter can be edited?
'test rule to save as & increment number
xx= ThisDoc.PathAndFileName(True)
yy = ThisDoc.Path
MessageBox.Show(xx, yy)
aa = ThisDoc.FileName(False)
'without extension bb = number
bb = Right(aa, 5)
' extension
EXT1 = Right(xx, 4)
dd = Left(aa, 12)
'################
'counter path
cp = Left(yy, 44)'copy the top folder location
an = cp & "AutoNumberCounter.xlsx"
ExNo = GoExcel.CellValue(an, "Sheet1", "A1")
ExNoS = CStr(ExNo)
'MessageBox.Show(an, ExNoS)
'####################
FrName = Left(aa, 12)
EdNameSt = Right(aa, 5)
Dim RepeatX As Integer
RepeatX = InputBox("How Many", "Incremental Save", "2")
StartNo = ExNo
EndNo = ExNo + RepeatX
For ee = 1 To RepeatX
'NameC6 = EdNameSt + ee
NameC6 = StartNo + ee
NameCt = "00000" & NameC6
EdName = Right(NameCt, 5)
'MessageBox.Show(EdName, NameCt)
'xx1 = ee
''yy1 = "00" & CStr(xx1)
'yy1 = CStr(xx1)
MessageBox.Show(xx, yy)
''mm = yy & "\" & bb & yy1 & cc
''mm = yy & "\" & bb & dd & yy1 & cc
mm = yy & "\" & FrName & EdName & EXT1
'MessageBox.Show(mm, CStr(EdName))
ThisDoc.Document.SaveAs(mm, True)
Next
GoExcel.CellValue(an, "Sheet1", "A1") = EndNo
MessageBox.Show("Save the xlxs - pop up behind Inventor", "Remember")
Regards
Andrew
Solved! Go to Solution.