lklo
Industrial
- Nov 24, 2010
- 226
Hi -
I am trying to put all curves in a nx part into a array , except the curves from Flat Pattern Feature, if such feature excist in part.
But I am not sure how to ask each curve , and see of it belong to Flat pattern or not.
Any one have a suggest ???
lklo
(attached Function which also will handle FlatPattern curves
'==============================================================================================
'MOVE CURVE FUNCTION
Public Function MoveCurve_outside(ByVal minRangeLayer As Integer, ByVal maxRangeLayer As Integer, ByVal DestLayer As Integer)
'set undo mark
Dim theMarkId6 As Session.UndoMarkId = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Move Curves to layer" & " " & DestLayer) ' undo flag
'set arraylist for objects to move
Dim objectsToMove As New List(Of DisplayableObject) ' new list
'prepare and do cycle of objects
For Each tempCurve As Curve In workPart.Curves
'put Objects outside defined range into arraylist
If tempCurve.Layer > 0 = True And tempCurve.Layer < minRangeLayer = True Or tempCurve.Layer > maxRangeLayer = True And tempCurve.Layer < 256 = True Then
objectsToMove.Add(tempCurve)
'put objects into counter
Report_count_to_Layer(10) = (Report_count_to_Layer(10) + 1) ' count of objects
End If
'End If
Next
'here we move collected objects
Dim displayModification1 As DisplayModification
displayModification1 = theSession.DisplayManager.NewDisplayModification()
displayModification1.ApplyToAllFaces = False
displayModification1.NewLayer = DestLayer
displayModification1.Apply(objectsToMove.ToArray)
displayModification1.Dispose()
Try
theSession.UpdateManager.DoUpdate(theMarkId6)
Catch ex As Exception
NX("Exception")
End Try
Report_count_to_Layer(11) = DestLayer ' set destination Layer in
Return Report_count_to_Layer 'return updated array prepared for final user info
End Function
'==============================================================================================
I am trying to put all curves in a nx part into a array , except the curves from Flat Pattern Feature, if such feature excist in part.
But I am not sure how to ask each curve , and see of it belong to Flat pattern or not.
Any one have a suggest ???
lklo
(attached Function which also will handle FlatPattern curves
'==============================================================================================
'MOVE CURVE FUNCTION
Public Function MoveCurve_outside(ByVal minRangeLayer As Integer, ByVal maxRangeLayer As Integer, ByVal DestLayer As Integer)
'set undo mark
Dim theMarkId6 As Session.UndoMarkId = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Move Curves to layer" & " " & DestLayer) ' undo flag
'set arraylist for objects to move
Dim objectsToMove As New List(Of DisplayableObject) ' new list
'prepare and do cycle of objects
For Each tempCurve As Curve In workPart.Curves
'put Objects outside defined range into arraylist
If tempCurve.Layer > 0 = True And tempCurve.Layer < minRangeLayer = True Or tempCurve.Layer > maxRangeLayer = True And tempCurve.Layer < 256 = True Then
objectsToMove.Add(tempCurve)
'put objects into counter
Report_count_to_Layer(10) = (Report_count_to_Layer(10) + 1) ' count of objects
End If
'End If
Next
'here we move collected objects
Dim displayModification1 As DisplayModification
displayModification1 = theSession.DisplayManager.NewDisplayModification()
displayModification1.ApplyToAllFaces = False
displayModification1.NewLayer = DestLayer
displayModification1.Apply(objectsToMove.ToArray)
displayModification1.Dispose()
Try
theSession.UpdateManager.DoUpdate(theMarkId6)
Catch ex As Exception
NX("Exception")
End Try
Report_count_to_Layer(11) = DestLayer ' set destination Layer in
Return Report_count_to_Layer 'return updated array prepared for final user info
End Function
'==============================================================================================