Below Is code for your situation, either run As internal Or external rule. You can use it for iProperties also. This still requires user input but it is less clicking.
https://forums.autodesk.com/t5/inventor-customization/automate-idw-drawing-file-creation-for-all-ipa...
http://inventortrenches.blogspot.com/2013/03/determine-file-type-for-ilogic-rule.html
Instructions***************************************************
Before starting:
Ensure the iPart table browser Is expanded.Step Required
2. Add parameter columns to the iPart factory table before running this rule.
'What will happen
> This rule will loop through each member applying the parameters then activate each member.
> This activation will force the System generated Message Box To appear reading
'"The values in the Active Row of the table do not match the document's current values.
Do you wish To update the table before continuing?"
> Manually accept this change and select yes.
> Cycle repeats.
Sub Main
Check = MessageBox.Show("Loop through iPart factory and populated members, This will take a while. Are you sure?" _
, "Ilogic Instructions", MessageBoxButtons.YesNo, MessageBoxIcon.Warning)
If Check = vbYes Then
Dim oDoc As Document
oDoc = ThisDoc.Document
'Check if ODoc is a Part Document
If oDoc.DocumentType = Inventor.DocumentTypeEnum.kPartDocumentObject Then
'MessageBox.Show("This is a part file.", "iLogic")
'Set a reference to the component definition
oDef = ThisApplication.ActiveEditDocument.ComponentDefinition
'Make sure we have an iPart factory.
If oDef.IsiPartFactory = False Then
MsgBox ("Chosen document is not a factory.", vbExclamation)
Exit Sub
End If
' Set a reference to the factory.
Dim oFactory As iPartFactory
oFactory = oDef.iPartFactory
'iPartF = oDef.iPartMember.ParentFactory
'Get the number of rows in the factory.
Dim iNumRows As Integer
iNumRows = oFactory.TableRows.Count
Dim iRow As Integer
'Set iRow = First Member
oStart = InputBox("Pick a Start Row", "Member Start Row#", 1)
oEnd = InputBox("Pick a Start Row", "Member Start Row#", iNumRows)
Try
For iRow = oStart To oEnd
'Use if this main rule is external
iLogicVb.RunRule("HolePlacement")
'Change ipart Row
iPart.ChangeRow("", iRow)
'Use if memberfile name needed
'MemberFileName = oFactory.FileNameColumn(iRow).Value
'MessageBox.Show(MemberFileName, "Title")
'[---Call external "function" or rule or do something---
'[Select by UI the node of current member in order to bring up the message ipart has change contents,
'If this is not used parameters will only apply to last member active
'https://forums.autodesk.com/t5/inventor-customization/possible-to-check-all-members-of-factory-for-errors-using-ilogic/td-p/3863094
Dim oErrorManager As ErrorManager
oErrorManager = ThisApplication.ErrorManager
Dim oTop As BrowserNode
oTop = oDoc.BrowserPanes("Model").TopNode
Dim bHasErrorOrWarning As Boolean
'To skip without messages, this will not work for change of parameter
'ThisApplication.SilentOperation = False
' Highlight the iPart table row
oTop.BrowserNodes("Table").BrowserNodes.Item(iRow).DoSelect
' Activate the iPart table row, this will trigger the "Do you want to change table contents accept yes to allow parameters to be saved to ipart member row.
Dim oCommand As ControlDefinition
oCommand = ThisApplication.CommandManager.ControlDefinitions("PartComputeiPartRowCtxCmd")
oCommand.Execute
If oErrorManager.HasErrors Or oErrorManager.HasWarnings Then
MsgBox (oErrorManager.LastMessage, vbOKCancel)
End If
'Use if required
'ThisDoc.Document.Rebuild()
'Create each member
' Try
' Call oFactory.CreateMember
' Catch
' MessageBox.Show("Error creating Member", "iLogic")
' End Try
Next
Catch
MessageBox.Show("Error Exiting", "iLogic")
End Try
iLogicVb.UpdateWhenDone = True
'open folder
'oFolder = ThisDoc.Path &"\" & ThisDoc.FileName(False)
'Call Shell("explorer.exe" & " " & oFolder, vbNormalFocus)
Else
End If
Else
End If
End Sub
If this solved a problem, please click (accept) as solution.
Or if this helped you, please, click (like)
Regards
Alan