catia

CATIA v5 macro open properties


I have a macro where i add properties to the part.

But i need to open the properties to change a few options (drop list)

How can i make the code to open the part properties and leave it opened (and finish the macro)

my macro ends like this:

'---------------MSG BOX---------------------------

msgbox "PARAMETERS CREATED - CHANGE NECESSARY PROPERTIES ACCORDING SELECTED MATERIAL", , name

partDocument1.Save

Set partDocument1 = CATIA.ActiveDocument

Set product1 = partDocument1.GetItem("") <<<<--- this one do nothinG

End Sub


Solution

  • Here an example how to open the properties of a CATPart\CATproduct via StartCommand. Be aware, Startcommands are are language-dependent.

    Sub CATMain()
    
    Dim oDoc as Document
    Dim osel as Object 'Selection
    
    Set oDoc = Catia.ActiveDocument
    Set oSel = oDoc.Selection
    
    oSel.Clear
    oSel.Add oDoc.Product
    
    Catia.StartCommand "Properties"
    
    End Sub