Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

Rename multiple parameters at one shot

Status
Not open for further replies.

JSVKAN

Mechanical
Dec 20, 2013
20
0
0
US
Hi,
I have created set of parameters like Parameter1, parameter2, parameter3 and so through vba coding.

I know how to rename induvial parameter, but I want to select all parameters and rename all parameters with common name (Modified Parameter) at one shot.

Could anybody help me how to do it?


Thanks!
 
Replies continue below

Recommended for you

adapt this code to your needs

Code:
Sub MyParam()

   Dim MyDocument As Document
   Dim myPart As Part
   Dim MyParametrsSet As ParameterSet
   Dim MyDirectParam As Parameters
   Dim i As Integer

   Set MyDocument = CATIA.ActiveDocument
   Set myPart = MyDocument.Part
   Set MyParametrsSet = myPart.Parameters.RootParameterSet
   Set MyDirectParam = MyParametrsSet.DirectParameters

      For i = 1 To MyDirectParam.Count
        MsgBox MyDirectParam.Item(i).Name
      Next i
End Sub
 


Thank you very much!

Now, I can able to count and rename parameters.

To rename parameters, I included this line in your coding: MyDirectParam.Item(i).Rename "Modified"


Thanks once again.

 
Status
Not open for further replies.
Back
Top