Message 1 of 19
VBA/iLogic Rule to Rename Model Parameter NAMES
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello!
I have this code written by me:
Option Explicit
Public Sub Rename()
Dim i As Integer
Dim oDoc As PartDocument
Set oDoc = ThisApplication.ActiveDocument
If oDoc.DocumentType = kPartDocumentObject Then
Dim oPartCompDef As PartComponentDefinition
Set oPartCompDef = oDoc.ComponentDefinition
For i = 1 To oPartCompDef.Parameters.ModelParameters.Count
Dim param As String
param = "d" & i
Dim pName As String
pName = oPartCompDef.Parameters.ModelParameters(i).Name
pName = param
oDoc.Update2 (True)
Next i
Else
Exit Sub
End If
End Sub
I want to automatically rename model parameter names by numeric order: d1, d2, d3, ...
Please help with it - to write it correctly so it worked
Thanks