Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change a Parameter into a ParameterSet using a MACRO 1

Status
Not open for further replies.

diegocatia

Aerospace
Feb 19, 2015
5
ES
Good morning,

I am trying to change a parameter from a ParameterSet recording a Macro.

Attached is a screenshot of the location of the parameter "b", the one to change, and the macro script.

I am not sure about what is happening in the script, and why it does not achieve the parameter "b".

The Macro works when I try to change a parameter out of the ParameterSet.

Do you know how can I make it work????? [ponder]


Thank you very much!!
 
Replies continue below

Recommended for you

Try this from VBA code.

Code:
    Dim partDoc As PartDocument
    
    Set partDoc = CATIA.ActiveDocument
    
    Dim SubParamSet As ParameterSet
    
    Set SubParamSet = partDoc.Part.Parameters.RootParameterSet.ParameterSets.GetItem("SubParameterSet")
    
    Dim oParameter As Parameter
    
    Set oParameter = SubParamSet.AllParameters.GetItem("ParameterInSubParameterSet")
    
    MsgBox (oParameter.ValueAsString)

download.aspx




Eric N.
indocti discant et ament meminisse periti
 
Thank you very much itsmyjob!!!

This is the VBS code I´ve use:

Language="VBSCRIPT"

Sub CATMain()

Set partDocument1 = CATIA.ActiveDocument

Set part1 = partDocument1.Part

Set parameters1 = part1.Parameters

Set parameterSet1 = parameters1.RootParameterSet

Set parameterSets1 = parameterSet1.ParameterSets

Set parameterSet2 = parameterSets1.GetItem("SubParameterSet")

Set parameter=parameterSet2.AllParameters

Set parametertochange=parameter.GetItem("ParameterInSubParameterSet")

Set lenght1=parametertochange

lenght1.Value=35.000

part1.Update

End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Top