Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
A.Acheson
in reply to: anavazquez5LRNJ

It looks like your manually choosing the occurrences. Would it be easier to just get all occurrences in the view into a list and then just loop through the occurrence list? The function below is getting the views curves and returning one but it could be made into a sub routine and a list could be added.  Of course you could do the same with the occurrence selection tool you have and manually add the occurrence to the list leaving the user in control. 

 

Function GetOccurrence(occName As String, curves As DrawingCurvesEnumerator) As ComponentOccurrence

	For Each curve As DrawingCurve In curves
		For Each curveSegment As DrawingCurveSegment In curve.Segments
			Try
				Dim modelGeom As Object = curve.ModelGeometry
				occ = modelGeom.ContainingOccurrence
			Catch
			End Try
			If occ.Name = occName Then
				Logger.Info("found occ from curve " & occ.Name)
				Return occ
			End If
		Next	
	Next
End Function

 

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan