CAD-ProEngineer

 view release on metacpan or  search on metacpan

interp.pl  view on Meta::CPAN

  print "\n";
}


sub dim_visit_action {
  my $o = new CAD::ProEngineer;
  # print "action args (", scalar(@_), "): ",join('|',@_),"\n";

  my $name = $o->ProDimensionSymbolGet($_[0]);
  my $val = $o->ProDimensionValueGet($_[0]);
  # print " dim: $name = $val ", "\n";

  $o->ProMessageDisplay("msg_file.txt", "USER %0s", "dim: $name = $val");
  $o->ProMessageClear;
  return $o->PRO_TK_NO_ERROR;
}


sub param_visit_action {
  my $o = new CAD::ProEngineer;
  print "action args (", scalar(@_), "): ",join('|',@_),"\n";

  my $paramval = $o->ProParameterValueGet($_[0]);
  my $name = $o->ProParameterNameGet($_[0]);
  my $val = $o->ProParamvalueValueGet($paramval);

  print $_[0], " name: $name   val: $val ", $_[2], "\n";
  $o->ProMessageDisplay("msg_file.txt", "USER %0s", "parameter: $name = $val");
  # $o->ProMessageClear;
  return $o->PRO_TK_NO_ERROR;
}


sub param_visit_filter {
  my $o = new CAD::ProEngineer;
  print "filter args (", scalar(@_), "): ",join('|',@_),"\n";
  return $o->PRO_TK_NO_ERROR;
}


sub user_initialize {
  my($ui_err);
  my $o = new CAD::ProEngineer;

  $o->ProMessageDisplay("msg_file.txt", "USER %0s", "Hello world!");


  # Defining a new UICmdAction and specifying an anonymous subroutine 
  # with a reference to a scalar.  The reference will be passed to 
  # display_model_info().
  #
  my($test) = 1;
  $ui_err = $o->ProCmdActionAdd("Stuff", sub { display_model_info(\$test) }, 
                                $o->uiProeImmediate, $o->ACCESS_AVAILABLE, 
                                $o->PRO_B_TRUE, $o->PRO_B_TRUE, $cmd_id);



  # Registering UICmdAction on the "Utilities" menu.
  #
  $ui_err = $o->ProMenubarmenuPushbuttonAdd("Utilities", "Stuff", "Stuff", 
                                            "Special stuff commands",
                                            "Utilities.psh_util_aux", 
                                            $o->PRO_B_TRUE, $cmd_id, 
                                            "msg_file.txt");

}


# END blocks are not executed when the interpreter shuts down
#
END {
  print "END reached.", "\n";
}





( run in 0.765 second using v1.01-cache-2.11-cpan-cdf2f3d4e48 )