hexagon logo

Reset to nominals

Here's one...

I got it from WILCOX
  • Can't you get the same effect by marking all, then having it show the path lines and saving? OR, do you mean something other than resetting all feature's actuals to the nominals (targets)?
  • Chees pick pick pick. Never went that route. Should have said I got it from Wilcox too. OK?
  • Oh don't take your ball and go home. I was just ribbin ya.
  • Is that what it does? Really?

    V3.7 kind of developed a BUG using my method, you can show the path lines, save the program, close it, open it back up, and ALL the features will show that the actuals do match the nominals (target values) BUT NONE OF THE DIMENSIONS will update to show the new actuals! What you need to do at that point is re-enter the feature ID in the first dimension, then they will all update. Nice bug, eh?

    WARNING, the show path lines method will make Pcdmis set all the actuals to the TARGET values. In most cases, these will match the nominals, but not always. For an example, the only feature(s) I have ever changed the TARGET values for is a small hole (say, 3mm) that was more than 0.5mm off location and the 2mm ball wouldn't go into the hole, that kind of thing. I do not know what your BS, er I mean, B&S solution would do in that case.
  • Have you ran that code James? Your variable declarations are commented.

    Craig


    See your application object declaration is commented (Dim App As PCDLRN.Application). Then you Set your reference (Set App). Does this instantiate dynamically? I don't believe it does but I have been wrong before.

    Also I believe that PartProgram is a member of the PCDLRN.Application and should be instantiated as such. I am no expert at this so that is why I ask if this code runs.

    Perhaps this code:
    '
    '  Dim App As PCDLRN.Application
    '  Dim Cmd As PCDLRN.Command
    '  Dim FCmd As PCDLRN.FeatCmd
    '  Dim Part As PCDLRN.PartProgram
    '  Dim Cmds As PCDLRN.Commands
    
    Dim Cmds As Object
    Dim FCmd As Object
    Dim Cmd As Object
    
      Set App = CreateObject("PCDLRN.Application")
      Set Part = App.ActivePartProgram
      Set Cmds = Part.Commands
    


    Should be:
    '
    Dim App As Object
    Dim Part As Object
    Dim Cmds As Object
    Dim FCmd As Object
    Dim Cmd As Object
    
      Set App = CreateObject("PCDLRN.Application")
      Set Part = App.ActivePartProgram
      Set Cmds = Part.Commands
    


    Perhaps the code you posted is making an attempt at early binding and that is why it looks as such but I believe you may still need to uncomment the first lines.
  • Craiger, Yes it runs. But, I will again say that this is a WILCOX .bas I can't take credit for it. I can understand some VB stuff but the class I took was quite a while ago and most of my app's don't require mucking around with a lot of VB.
  • I guess I'm a little lost. Does the instance of the application object not need to be declared? It looks as if it does not. the line "Dim App As PCDLRN.Application" is commented, I understand that this would early bind the variable if it were not commented. Then the variable is set to point to PCDMIS with "Set App = CreateObject("PCDLRN.Application")". However, there is no object declared, so is the object declared dynamically as well as pointed to PCDMIS with this line? I see the same thing is being done with part programs and commands. Understanding that the code does run, is it safe to do this by convention? Is it being done this way because the calling application is the same application being automated. Maybe I'll check a VB forum to see. Like I said I am not entirely on top of my game with this, just enough to be dangerous.

    Craig
  • So how do you run the basic programs? I'm familiar with VBA in Word and Excel, and with VB in Visual Studio, but those apps are not on the CMM computer.

    Thanks,
    Keith

    Slight smile
  • insert>basic script. Leave this in the program and at the end it will reset everything (make sure you put in a print command first), or insert this in the program and F9 it and hit the play button in the basic script edit window and it will run the script.