Message 1 of 4
Insert ipart from listbox
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello I hope that they can help me:
I have listbox that shows ipartname of one ipartfactory it would like and me that when selecting one of them it could send to the assembly ipart selected hear show code.
Dim InvApp As Inventor.Application
Set InvApp = GetObject(, "Inventor.Application")
Dim IpartSeleccion As ipartMember
Set IpartSeleccion = listbox1.Value
Dim oDoc As AssemblyDocument
Set oDoc = InvApp.ActiveDocument
Dim oOccs As ComponentOccurrences
Set oOccs = oDoc.ComponentDefinition.Occurrences
Dim oPos As Matrix
Set oPos = InvApp.TransientGeometry.CreateMatrix
Dim oStep As Integer
oStep = 10
Dim iRow As Object
iRow = listbox1.Selected
' Add a translation along X axis
oPos.SetTranslation (InvApp.TransientGeometry.CreateVector(oStep, oStep, 0))
Dim oOcc As ComponentOccurrence
oOcc = oOccs.AddiPartMember("C:\Temp\Abarcon generales.ipt", oPos, iRow)
MsgBox (listbox1.Value)
Thanks in advance
