Message 1 of 5

Not applicable
09-26-2013
09:07 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
I`m looking for some help here. I finally learned how to add a virtual part from an excel list to assembly using vb.net plugin. I`d like to know how to change iProperties of the virtual part through vb.net.
The iLogic code that I would typically use is:
Dim occs As ComponentOccurrences occs = asmDoc.ComponentDefinition.Occurrences Dim identity As Matrix identity = ThisApplication.TransientGeometry.CreateMatrix
Dim virtOcc As ComponentOccurrence If v_qty >= 1 Then virtOcc = occs.AddVirtual(sVirtPart, identity) Try iProperties.Value(sVirtPart & ":1", "Project", "Description") = oProp1 iProperties.Value(sVirtPart & ":1", "Summary", "Title") = oProp1 Catch End Try .......
so for the plugin I need to re-write this code:
Dim _invApp As Inventor.Application Dim occs As ComponentOccurrences occs = asmDoc.ComponentDefinition.Occurrences
Dim identity As Matrix identity = _invApp.TransientGeometry.CreateMatrix Dim virtOcc As ComponentOccurrence If vp_qty >= 1 Then virtOcc = occs.AddVirtual(sVirtPart, identity) 'Try ' iProperties.Value(sVirtPart & ":1", "Project", "Description") = oProp1 ' iProperties.Value(sVirtPart & ":1", "Summary", "Title") = oProp1 'Catch 'catch error when oProp1 = nothing 'End Try
How should I re-write the text in bold , so it works?
Any help is appreciated.
Thank you.
Alex.
Solved! Go to Solution.