Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

Placing a Part in the same position in an Assembly Using iLogic

Anonymous

Placing a Part in the same position in an Assembly Using iLogic

Anonymous
Not applicable

I'm trying to develop an application that automates a process. I place a Part in a specific position in the Assembly and I would like to copy this part as many times as I want and place it in the same position using programming.

I'm using VBA for this inside de iLogic in Inventor 2018.

0 Likes
Reply
392 Views
2 Replies
Replies (2)

bradeneuropeArthur
Mentor
Mentor

That goes also without programming!

Curious?

In the application options change:

bradeneuropeArthur_0-1627745954666.png

 

Add a component pattern with distance "0" and a Qty and you need for this component

 

Regards,

Arthur Knoors

Autodesk Affiliations:

Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:Drawing List!|Toggle Drawing Sheet!|Workplane Resize!|Drawing View Locker!|Multi Sheet to Mono Sheet!|Drawing Weld Symbols!|Drawing View Label Align!|Open From Balloon!|Model State Lock!
Posts and Ideas:Dimension Component!|Partlist Export!|Derive I-properties!|Vault Prompts Via API!|Vault Handbook/Manual!|Drawing Toggle Sheets!|Vault Defer Update!


! For administrative reasons, please mark a "Solution as solved" when the issue is solved !

0 Likes

Michael.Navara
Advisor
Advisor

Here is sample code for "Copy occurrence" to the same position

Dim asmDef As AssemblyComponentDefinition = ThisDoc.Document.ComponentDefinition

Dim occ As ComponentOccurrence = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kAssemblyOccurrenceFilter, "Pick Occurrence")
Dim occDocument As Document = occ.Definition.Document
Dim occDocumentName As String = occDocument.FullDocumentName
Dim position As Matrix = occ.Transformation
Do
	asmDef.Occurrences.Add(occDocumentName, position)
Loop While (MsgBox("Again?", MsgBoxStyle.YesNo + MsgBoxStyle.Question) = MsgBoxResult.Yes)
0 Likes