Twullf
Mechanical
- Jan 24, 2012
- 196
This monster program I am writing places a point, datum, offset line, then sketch. I want it to name each feature. This was working perfectly until I added sketches into the mix. For some reason, the array is not counting the sketches.
The first point, datum, and line are named as usual but as soon as it reaches this point in the workflow after the first sketch has been put in place, it can no long for the feature needing to be renamed so errors out.
I have a different callout for datums and points, so the problem is not because it is trying to find a point and calling a line, if I comment out my code to add the sketch this works fine. Does anyone know what is different about sketches? Is there a way to count them separately? If they are not a feature, what would they be classified as?
I know I'm posting a lot of questions on here and I promise I am looking elsewhere for the answers.
Code:
Dim featArray() As Feature = myFeats.ToArray()
Dim lastFeatNum As Integer = featArray.GetUpperBound(0)
Dim lastFeat As Feature = featArray(lastFeatNum)
ufs.Modl.SetCurrentFeature(lastFeat.Tag())
Dim oldLName As String
Dim newLName As String
oldLName = "LINE(" & lastFeatNum &")"
Dim associativeLine1 As Features.AssociativeLine = CType(workPart.Features.FindObject(oldLName), Features.AssociativeLine)
newLName = "S" & counter
associativeLine1.SetName( newLName )
The first point, datum, and line are named as usual but as soon as it reaches this point in the workflow after the first sketch has been put in place, it can no long for the feature needing to be renamed so errors out.
I have a different callout for datums and points, so the problem is not because it is trying to find a point and calling a line, if I comment out my code to add the sketch this works fine. Does anyone know what is different about sketches? Is there a way to count them separately? If they are not a feature, what would they be classified as?
I know I'm posting a lot of questions on here and I promise I am looking elsewhere for the answers.