This is the other info:
System.Runtime.InteropServices.COMException (0x80004005): Errore non specificato. (Eccezione da HRESULT: 0x80004005 (E_FAIL))
in Microsoft.VisualBasic.CompilerServices.LateBinding.InternalLateSet(Object o, Type& objType, String name, Object[] args, String[] paramnames, Boolean OptimisticSet, CallType UseCallType)
in Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateSet(Object Instance, Type Type, String MemberName, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, Boolean OptimisticSet, Boolean RValueBase, CallType CallType)
in Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateSet(Object Instance, Type Type, String MemberName, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments)
in ThisRule.Main() in regola: Regola0, nel documento PivotconSA.ipt:riga 11
in Autodesk.iLogic.Exec.AppDomExec.ExecRuleInAssembly(Assembly assem)
in iLogic.RuleEvalContainer.ExecRuleEval(String execRule)
This is my code:
oDoc = ThisApplication.ActiveDocument
oFeatures = oDoc.ComponentDefinition.Features
ext = 1
iFeat = 1
'same pattern for other feature counts here
For Each oFeature In oFeatures 'look at all the features that make up the body
Select Case oFeature.Type
Case = ObjectTypeEnum.kExtrudeFeatureObject
oFeature.Name = oFeature.SurfaceBodies(1).Name & "_Es" & If (ext < 10, "0" + CStr(ext), CStr(ext))
ext = ext + 1
Case = ObjectTypeEnum.kiFeatureObject
oFeature.Name = oFeature.SurfaceBodies(1).Name & "_Es" & If (iFeat < 10, "0" + CStr(iFeat), CStr(iFeat))
iFeat = iFeat + 1
'Case = ObjectTypeEnum.k...
'same pattern as above
End Select
Next
For Each oFeature In oFeatures 'look at all the features that make up the body
Select Case oFeature.Type
Case = ObjectTypeEnum.kRevolveFeatureObject
oFeature.Name = oFeature.SurfaceBodies(1).Name & "_Riv" & If (ext < 10, "0" + CStr(ext), CStr(ext))
ext = ext + 1
Case = ObjectTypeEnum.kiFeatureObject
oFeature.Name = oFeature.SurfaceBodies(1).Name & "_Riv" & If (iFeat < 10, "0" + CStr(iFeat), CStr(iFeat))
iFeat = iFeat + 1
'Case = ObjectTypeEnum.k...
'same pattern as above
End Select
Next
For Each oFeature In oFeatures 'look at all the features that make up the body
Select Case oFeature.Type
Case = ObjectTypeEnum.kFilletFeatureObject
oFeature.Name = oFeature.SurfaceBodies(1).Name & "_Racc" & If (ext < 10, "0" + CStr(ext), CStr(ext))
ext = ext + 1
Case = ObjectTypeEnum.kiFeatureObject
oFeature.Name = oFeature.SurfaceBodies(1).Name & "_Racc" & If (iFeat < 10, "0" + CStr(iFeat), CStr(iFeat))
iFeat = iFeat + 1
'Case = ObjectTypeEnum.k...
'same pattern as above
End Select
Next
For Each oFeature In oFeatures 'look at all the features that make up the body
Select Case oFeature.Type
Case = ObjectTypeEnum.kChamferFeatureObject
oFeature.Name = oFeature.SurfaceBodies(1).Name & "_Sm" & If (ext < 10, "0" + CStr(ext), CStr(ext))
ext = ext + 1
Case = ObjectTypeEnum.kiFeatureObject
oFeature.Name = oFeature.SurfaceBodies(1).Name & "_Sm" & If (iFeat < 10, "0" + CStr(iFeat), CStr(iFeat))
iFeat = iFeat + 1
'Case = ObjectTypeEnum.k...
'same pattern as above
End Select
Next
Thanks thousand