Looking to be able to generate files without selecting them (by highlighting) right clicking generate files and then having to hit ok during each factory member generation.
Is there a way I can bypass clicking ok on every file being generated?
I have a macro on my keyboard that repeatedly presses enter to sort of automate this but there has to be a more official way.
I want a button/external rule I can run that takes care of generating all the files so I can share it with my team so save monotonous button clicking/key pressing for dozens of files daily.
Solved! Go to Solution.
Solved by WCrihfield. Go to Solution.
Hi @cmcewanE2U82. I do not currently use iAssemblies, but I think the following code example should work for a task like that.
Sub Main
Dim oADoc As AssemblyDocument = TryCast(ThisDoc.Document, Inventor.AssemblyDocument)
If oADoc Is Nothing Then Return
Dim oADef As AssemblyComponentDefinition = oADoc.ComponentDefinition
Dim oFactory As iAssemblyFactory = Nothing
If oADef.IsiAssemblyFactory Then
oFactory = oADef.iAssemblyFactory
ElseIf oADef.IsiAssemblyMember Then
oFactory = oADef.iAssemblyMember.ParentFactory
End If
If oFactory Is Nothing Then Return
'Dim sMembersFolder As String = oFactory.MemberCacheDir
For Each oRow As iAssemblyTableRow In oFactory.TableRows
oFactory.CreateMember(oRow)
Next
End Sub
If this solved your problem, or answered your question, please click ACCEPT SOLUTION .
Or, if this helped you, please click (LIKE or KUDOS) 👍.
Wesley Crihfield
(Not an Autodesk Employee)
Can't find what you're looking for? Ask the community or share your knowledge.