Not allowed to assign the C.input from one comment to the .input for a later comment?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Not allowed to assign the C.input from one comment to the .input for a later comment?

    ***EDIT: In classic PC-DMIS fashion, it just started working. I just kept running it and opening the report, and the input is now showing up on the report. I dunno ¯\_(ツ)_/¯


    For reasons that are more tedious than they are relevant, I am trying to have the operator check something early in the program and type text into an Input Comment. Later, at the end of the program, I have assigned that input from the operator into a new Input Comment which will display on the report where I want it to be.

    The text is showing up in the value when I build the Expression and the Assignment is correctly configured. Unfortunately, the text is not showing up in the second Comment's input field when I execute the first Input Comment as a block-exe. When I scroll to the end of the program, select the Destination comment, the Status window shows my default text, but not the text assigned from the original Operator Input.

    I have built and re-built the assignments and expression and it just will not show up on the report or the status window. The Destination comment is configured to display on Report, but it will only display the default text and the Input field is blank even though the expression-builder shows the text from the first Source comment when I F9 it and investigate.

    Is this a bug? Can anyone duplicate this? Is there a specific reason one would not be allowed to do this?

    Thanks for any info you may have for me!
    Last edited by UseAsIs; 05-22-2019, 09:37 PM.

  • #2
    To start with, post some code. If that fails, post some code

    Seriously though, are you doing this in "Learn" mode? The variables values do not persist in learn mode.

    At the end of the routine, add a comment/operator and display the original input variable, and execute the routine

    Comment


    • UseAsIs
      UseAsIs commented
      Editing a comment
      The input is text, if that has any effect on whether it persists or not. I have not run the entire program, but doing quick block-exe's on other Assignments is working and displaying just fine. Number values are populating in their destination assignments with no issue.

      The only place where I'm having trouble is when I'm going from an Op-Input comment to another Op-Input comment.

      I am holding on to hope that when I do a full run of the entire program, it will make some sort of voodoo magic happen where it displays finally. I have only executed the small blocks where the input assignment was relevant. But like I said, the numerical values are working just fine when assigned from comments to Key In Dims. Text values from Comment to Comment are absolutely the only thing not working correctly. Does Learn Mode affect text the way it would numerical values?

      I am using this comment as a source:


      C10 =COMMENT/INPUT,NO,FULL SCREEN=YES,
      BP 31:
      3/8-16 UNC THREADS

      PASS/FAIL?


      and I am using this as the destination:


      ASSIGN/C12.INPUT=C10.INPUT
      C12 =COMMENT/INPUT,YES,FULL SCREEN=NO,
      ----------------
      BP 31:
      3/8-16 UNC THREADS

      PASS/FAIL?


      I want the operator's input on C10 to populate the input for C12, but it will just not show up on the report no matter what I do. Keep in mind, the text is showing up in the Assignment/Expression dialogs when I open them up to investigate. It just fails to actually show up on the report or the Status window.

  • #3
    Why are you doing two operator inputs? Why not just do a report comment that uses the C10.INPUT?

    I'm not at the CMM, but do something like this:

    C12 =COMMENT/REPT
    "OPERATOR COMMENT:"+C10.INPUT

    Comment


    • UseAsIs
      UseAsIs commented
      Editing a comment
      I want the result to show up in the report in a toleranced block just like regular dimensions. Either way, it seems to work now. I didn't even change anything, I just ran it over and over and magically it works now lol

  • #4
    AFAIK the .INPUT property is read-only.

    As bfire said collect the information with an Input comment and put it on the report with a Report comment
    Automettech - Automated Metrology Technology

    Comment


    • UseAsIs
      UseAsIs commented
      Editing a comment
      My goal was to avoid comments on the report, and to have the result in a toleranced key-in dimension that looks nice and pretty like the rest of the measured dimensions. It works now because the PCDMIS gods have accepted my offering of a dead goat I left on the machine over the weekend

  • #5
    C1 =COMMENT/INPUT,NO,FULL SCREEN=NO,
    Please edit comment text
    ASSIGN/V1=C1.INPUT
    CS1 =SCRIPT/FILENAME= C:\USERS\RHULMAN\DESKTOP\SCRIPT_TEST.BAS
    FUNCTION/Main,SHOW=YES,ARG1=V1,,
    STARTSCRIPT/
    ENDSCRIPT/
    C2 =COMMENT/INPUT,NO,FULL SCREEN=NO,
    Please edit comment text


    And here is script. Just copy to basic script editor in Pcdmis.

    Sub Main(Newinput AsString)

     

    Dim DmisApp AsObject

    Dim DmisPart AsObject

    Dim DmisCommands AsObject

    Dim DmisCommand AsObject

     
    Set DmisApp = CreateObject("PCDLRN.Application")

    Set DmisPart = DmisApp.ActivePartProgram

    Set DmisCommands = DmisPart.Commands

     
    CommandCount = DmisCommands.Count

    Set DmisCommand = DmisCommands.Item(CommandCount)

    DmisCommands.InsertionPointAfter DmisCommand

     
    ForEach DmisCommand In DmisCommands

    'MsgBox str(dmiscommand.Type)

    If DmisCommand.ID = "C2" Then

    ' MsgBox "found one"

    dmiscommand.puttext Newinput, 709, 1

    EndIf

    Next DmisCommand

    DmisPart.RefreshPart

    EndSub

    Comment


    • UseAsIs
      UseAsIs commented
      Editing a comment
      Thank you! Very detailed, I appreciate the work you've done here even though it's over my head at the moment. This will be good study material for me though. You'll hate this, but my original way of doing it started working after a few runs through the full program. I can't imagine why it didn't at first, but now it does, so I'm happy and I won't question divine providence lol

Related Topics

Collapse

Working...
X