- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
I'm trying to write an iLogic that changes the punch representation of certain punches. For now it takes the punch representation and checks if it is 64517 (which is 2D Sketch and center mark type), if it is not, then it should change it to that one. When running the code I got and error "Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL))". Do you know how to change representation type to make it work?
Dim oDoc As PartDocument = ThisDoc.Document
Dim oPropSets As PropertySets = oDoc.PropertySets
Dim oSheetmetalCompDef As Inventor.SheetMetalComponentDefinition = oDoc.ComponentDefinition
Dim oCD As SheetMetalComponentDefinition = oDoc.ComponentDefinition
Dim currCount As Integer = 0
Dim oPunches As New List(Of String)
If oSheetmetalCompDef.HasFlatPattern Then
For Each oPunch As PunchToolFeature In oCD.Features.PunchToolFeatures
If oPunch.Suppressed = False Then
Dim PunchID As String = oPunch.iFeatureDefinition.PunchId
For i = 1 To oPunch.PunchCenterPoints.Count
If PunchID <> ""
oPunch.PunchRepresentationType = 64517
End If
Next
End If
Next
End If
Solved! Go to Solution.