hexagon logo

Execute feature


I want to create a button that executes a feature and immediately RefreshPart the dimension.


something similar to this.


Set PCDApp = CreateObject("PCDLRN.Application")
Set PCDPartPrograms = PCDApp.PartPrograms

PCDApp.Visible = True

Set PCDPartProgram = PCDApp.ActivePartProgram
AppActivate ("PC-DMIS CAD++ 2019 R1 (release)")
PCDPartProgram.EXECUTEfeature
PCDPartProgram.RefreshPart

Parents
  • Hi Carlos silva maybe something like this is what you want. You could then tie it to a custom button or menu option:

    Sub Main
    Dim App As Object
    Set App = CreateObject ("PCDLRN.Application")
    Dim Part As Object
    Set Part = App.ActivePartProgram
    Dim Ew As Object
    Set Ew = Part.EditWindow
    Dim Cmds As Object
    Set Cmds = Part.Commands
    Dim Cmd As Object
    
    ' Selects the command where the cursor is
    EW.SelectCommand
    
    ' Sets the current command as the command object
    Dim myCommand as Object
    Set myCommand = Cmds.CurrentCommand
    
    ' Executes the current command
    MsgBox "Command Selected. Attempting to execute command."
    myCommand.Execute
    
    ' Refreshes
    Part.RefreshPart
    End Sub




Reply Children
No Data