- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi All,
Happy holidays and hope everyone is doing well and is keeping warm and hydrated. While people are chewing on some turkey or food of choice hopefully someone can offer assistance to this post.
I was doing a little learning last week with a great piece of code posted kindly by @ j.haggenjos
Link Here. I was able to balloon parts that have been rolled up via the part number where they have separate document descriptors. However I was not able to balloon multiple occurrences. Shown in the partslist as missing 006 balloons
These are the changes to Subs so far that gets a portion of the way there. What else needs to be changed? Attached is the text file with these changes. Any help much appreciated.
Friend Sub AddBallonToView(View As DrawingView)
Dim PartsList As PartsList = View.Parent.PartsLists.Item(1)
InitialiseViewBoundingBox(View)
For Each Row As PartsListRow In PartsList.PartsListRows
For RefQty = 1 To Row.ReferencedFiles.Count 'Run for all references files
CreateRowItemBalloon(Row, View)
Next
Next
ArrangeBalloonsOnView(View)
End Sub
Public RefQty As Integer
and
Private Function GetBalloonAttachGeometry(Item As PartsListRow, View As DrawingView) As GeometryIntent
Dim itemOccurrences As ComponentOccurrencesEnumerator = View.ReferencedDocumentDescriptor.ReferencedDocument.ComponentDefinition.Occurrences.AllReferencedOccurrences(Item.ReferencedFiles.Item(RefQty).DocumentDescriptor)
Dim OccurrencesCurves As List(Of DrawingCurve) = GetCurvesFromOcc(itemOccurrences, View)
Return GetAttachPoint(GetBestSegmentFromOccurrence(OccurrencesCurves))
End Function
Or if this helped you, please, click (like)
Regards
Alan
Solved! Go to Solution.