Anonymous
2210 Views, 10 Replies
11-02-2018
06:05 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
11-02-2018
06:05 AM
Hello Everyone,
I came across this great post about renaming features in a part using iLogic (code below is from the solution of this post.) I was hoping to take it a step further to include other features, iFeatures and sketches. Adjusting the code to update other features is pretty straight forward but, I am running into issues when I try to get iFeatures and/or sketches to rename. I think this is due to my limited knowledge of code.
Here is the Code I'm working with;
oDoc = ThisApplication.ActiveDocument oBodies = oDoc.ComponentDefinition.SurfaceBodies 'look at the bodies For Each oBody In oBodies i = 1 'look at all the features that make up the body For Each oFeature In oBody.AffectedByFeatures 'look at only extrude features If oFeature.Type = ObjectTypeEnum.kExtrudeFeatureObject Then 'rename feature using solid name 'and pad the number with zero if under 10 oFeature.Name = oBody.Name _ & " - Ext. " & If(i < 10, "0" + CStr(i), CStr(i)) i = i + 1 End If Next Next
In the code above, I think I need to change "oFeature" and ObjectTypeEnum.kExtrudeFeatureObject. However, I don't know what I need to change this to.
Any idea how I can make this work?
Thanks,
Paul
Solved! Go to Solution.