Message 1 of 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi All
I'm relatively new to iLogic so please excuse if this question is trivial.
I am trying to write an ilogic code that:
- looks at an assembly,
- fetches all the parts in the assembly,
- measures their extent dimensions, and then
- groups them according to some condition (for example if max_extent/min_extent > 10 then MessageBox.Show("This is a plate"))
My current code only measures the extents of the full assembly, instead of each individual part, which is of no use to me.
Any help would be much appreciated, thanks!
' Get the active assembly. Dim oAsmDoc As AssemblyDocument oAsmDoc = ThisApplication.ActiveDocument ' Get the assembly component definition. Dim oAsmDef As AssemblyComponentDefinition oAsmDef = oAsmDoc.ComponentDefinition ' Get all of the leaf occurrences of the assembly. Dim oLeafOccs As ComponentOccurrencesEnumerator oLeafOccs = oAsmDef.Occurrences.AllLeafOccurrences ' Iterate through the occurrences and print the name. Dim oOcc As ComponentOccurrence For Each oOcc In oLeafOccs meas = Measure.ExtentsLength 'here is where I am having my problem MessageBox.Show(oOcc.Name & meas) Next
Solved! Go to Solution.