How to reset default number feature (can use iLogic)

How to reset default number feature (can use iLogic)

Anonymous
Not applicable
526 Views
1 Reply
Message 1 of 2

How to reset default number feature (can use iLogic)

Anonymous
Not applicable

When I delete a feature in the part and recreate a new feature. At this point, the default feature name automatically increases the number. Now I want it to return to the default setting when it was originally created. As an example I create a Split feature. It is named Split1 by default. After a while I deleted and recreated it it turned out to be Split2. But in Part there is only one Split feature.hoi.PNG

0 Likes
Accepted solutions (1)
527 Views
1 Reply
Reply (1)
Message 2 of 2

dutt.thakar
Collaborator
Collaborator
Accepted solution

@Anonymous 

 

iLogic Can be helpful here, try the below code, it will rename all your splits in sequence starting from 1.

 

Dim oDoc As PartDocument = ThisApplication.ActiveDocument
Dim oDef As PartComponentDefinition = oDoc.ComponentDefinition

Dim oFeat As PartFeature
Dim i As Integer = 1

For Each oFeat In oDef.Features
	If oFeat.Type = ObjectTypeEnum.kSplitFeatureObject
		oFeat.Name = "Split" & i
		i = i + 1
	End If
Next

 

 

If this answer has solved your problem please ACCEPT SOLUTION and hit like if you found it helpful..!


Regards,
Dutt Thakar
LinkedIn
0 Likes