Calling a align. with variables?

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

  • Calling a align. with variables?

    I have a program where 1 of 2 very different alignments will be used. I want to do this with one program and a yes/no statement. Does anyone see a problem with the fowwoling?
    IF/CC1.INPUT == "YES"
    ASSIGN/V31 =
    _ABC =ALIGNMENT/START,RECALL:A02,LIST=YES
    ALIGNMENT/LEVEL,YMINUS,PLN004
    ALIGNMENT/ROTATE_CIRCLE,XMINUS,TO,CIR004,AND,CIR006,ABOUT,YM INUS
    ALIGNMENT/TRANS,YAXIS,PLN004
    ALIGNMENT/TRANS,XAXIS,CIR004
    ALIGNMENT/TRANS,ZAXIS,CIR004
    ALIGNMENT/END
    END_IF/
    ELSE_IF/CC1.INPUT == "NO"
    ASSIGN/V31 =
    A09 =ALIGNMENT/START,RECALL:A02,LIST=YES
    ALIGNMENT/LEVEL,YMINUS,PLN004
    ALIGNMENT/ROTATE_CIRCLE,XPLUS,TO,CIR002,AND,PNT014,ABOUT,YMI NUS
    ALIGNMENT/TRANS,YAXIS,PLN004
    ALIGNMENT/TRANS,XAXIS,CIR001
    ALIGNMENT/TRANS,ZAXIS,CIR001
    ALIGNMENT/TRANS_OFFSET,ZAXIS,65.97
    ALIGNMENT/TRANS_OFFSET,XAXIS,-14.59
    ALIGNMENT/END
    END_ELSEIF/
    RECALL/ALIGNMENT,INTERNAL,V31

  • #2
    I have never assigned an alignment to a variable. Let us know how you make out. If it does not work then do not try to put variables into your alignment which may sound like the next logical thing to try, when you do it your dimension nominals do not change. You could if none of it works out create a (or multipe) generic features with variables that locate them. Assign the variables that are in the generic feature(s) as appropriate then align to the generic feature(s). I have done that.

    Craig
    <internet bumper sticker goes here>

    Comment


    • #3
      Well, have you thought about using MARKED SETS, one for each of the alignments' check features?
      sigpic
      Originally posted by AndersI
      I've got one from September 2006 (bug ticket) which has finally been fixed in 2013.

      Comment


      • #4
        Originally posted by Matthew D. Hoedeman View Post
        Well, have you thought about using MARKED SETS, one for each of the alignments' check features?
        I've done it that way in the past. If this works it will be a much better way of doing it. I'm more looking to see if anyone see a problem with this than another means of doing it. Right now I'm getting a error that the program is missing a recall id but I look and it seems to be there. I'll keep trying.

        Comment


        • #5
          I could not get it to allow an assignment of alignment to a variable. But it would let your recall an alignment using a variable. When trying to assign the alignment, it asked the right questions - "Does this refer to a variable...", but it would not accept it.

          Code:
          MYALIGNMENT=ALIGNMENT/START,RECALL:FINAL_BA, LIST= YES
                      ALIGNMENT/END
                      ASSIGN/ALIGNMENT1 = "MYALIGNMENT"
          A0         =ALIGNMENT/START,RECALL:ALIGNMENT1, LIST= YES
                      ALIGNMENT/END
          Links to my utilities for PCDMIS

          Comment


          • #6
            Originally posted by cmmguy View Post
            I could not get it to allow an assignment of alignment to a variable. But it would let your recall an alignment using a variable. When trying to assign the alignment, it asked the right questions - "Does this refer to a variable...", but it would not accept it.

            Code:
            MYALIGNMENT=ALIGNMENT/START,RECALL:FINAL_BA, LIST= YES
                        ALIGNMENT/END
                        ASSIGN/ALIGNMENT1 = "MYALIGNMENT"
            A0         =ALIGNMENT/START,RECALL:ALIGNMENT1, LIST= YES
                        ALIGNMENT/END
            YEEP HAD THE SAME THING HAPPEN
            I USED
            IF/CC1.INPUT == "YES"
            RECALL/ALIGNMENT,INTERNAL,A_ABC
            END_IF/
            ELSE_IF/CC1.INPUT == "NO"
            ASSIGN/V31 =
            RECALL/ALIGNMENT,INTERNAL,A09PCG
            END_ELSEIF/

            WORKING GOOD OFF LINE NOW IF IT WILL WORK DURNING A RUN.

            Thanks all

            Comment


            • #7
              I do it a lot. I have some fixtures on the machine that are used for various size parts. I align to the fixture in one program, save as an external alignment. Since there are 2 fixtures, I can recall either on using the variable.
              Code:
              C1         =COMMENT/INPUT,Enter FIX1 for FIXTURE 1,
                                       ,FIX2 for FIXTURE 2.
                          ASSIGN/V1 = C1.INPUT
                          RECALL/ALIGNMENT,EXTERNAL,V1,FIX2:fix2
                          MODE/DCC
                          MOVE/POINT,0,0,8
              You have to execute the comment for this to work.
              When in doubt, post code. A second set of eyes might see something you missed.
              sigpic

              Comment


              • #8
                I use a button script not for fixtures but for impression numbers but would work the same. I run this script and then right after the script call out I assign v1

                Function Main()
                Begin Dialog Menu 192,45,140,115, "Main Menu",.enable
                OptionGroup .GROUP_1
                OptionButton 10,16,68,12,"Imp 5",.choice1
                OptionButton 10,28,68,12,"Imp 6",.choice2
                OptionButton 10,40,68,12,"Imp 7",.choice3
                OptionButton 10,52,68,12,"Imp 8",.choice4
                OptionButton 10,64,68,12,"Imp 9",.choice5
                OptionButton 10,76,68,12,"Imp 10",.choice6
                OKButton 8,88,48,16
                CancelButton 64,88,64,16
                End Dialog

                Dim app As Object
                Set App = CreateObject("pcdlrn.Application")

                Dim part As Object
                Set Part = App.activePartProgram

                Dim cmds As Object
                Dim cmd As Object

                Dim dlg1 As Menu
                button = Dialog( Dlg1 )

                Dim sel_text As String

                If button = -1 Then
                'comment MsgBox "button:" & button ' uncomment For button return value
                Select Case Dlg1.GROUP_1
                Case 0
                sel_text = "005"
                Case 1
                sel_text = "006"
                Case 2
                sel_text = "007"
                Case 3
                sel_text = "008"
                Case 4
                sel_text = "009"
                Case 5
                sel_Text = "010"
                End Select
                Else
                MsgBox "Cancel was Pressed"
                End If

                Set cmds = part.Commands
                'comment Get the assignments command
                For Each cmd In cmds

                If cmd.TypeDescription = "Assignment" Then
                bln = cmd.PutText("""" + sel_text + """",SRC_EXPR,0)
                cmd.ReDraw
                End If

                Next cmd

                End Function
                sigpic
                if you had soap on a rope it would be tied to yer ankle

                Comment

                Related Topics

                Collapse

                Working...
                X