Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

iassembly generate files using external rule

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
cmcewanE2U82
151 Views, 2 Replies

iassembly generate files using external rule

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.

Labels (3)
2 REPLIES 2
Message 2 of 3
WCrihfield
in reply to: cmcewanE2U82

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

EESignature

(Not an Autodesk Employee)

Message 3 of 3
cmcewanE2U82
in reply to: WCrihfield

Thankyou I will give it a try and see how it behaves.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Technology Administrators


Autodesk Design & Make Report