hexagon logo

Help: Puttext method Problem

Hi,

Since our operators dont seem to be able to enter SNs correctly, I'm trying to program a dropdown menu fed with a textfile that contains all the SNs.
The Dropdown is made in Basic and reads out everything in the textfile...
So far so good...
When I try to transfer the data to PCDMIS, it doesnt work anymore (most probably because I'm doing something wrong)...


This is my code inside PCDMIS:

ZUWEISEN/DROP_SEL=""
CS1 =SKRIPT/DATEINAME= U:\LAURENT DESPINEUX\PC DMIS\AUTOMATED\SUPERDYNAMIC\DROPDOWN HYPERDYNAMIC (FROM FILE).BAS
FUNKTION/Main,EINBLENDEN=JA,,
STARTSKRIPT/
ZUWEISEN/DROP_SEL=0
ENDESKRIPT/
KOMMENTAR/PROT,
"" + DROP_SEL​



Dim PCDDmisApp As Object
Dim PCDDmisPart As Object
Dim PCDDmisCommands As Object
Dim PCDDmisCommand As Object
Dim DROP_SEL As String

Sub Main ()



Set PCDDmisApp = CreateObject("PCDLRN.Application")
Set PCDDmisPart = PCDDmisApp.ActivePartProgram
Set PCDDmisCommands = PCDDmisPart.Commands

Dim Command As Object

Let Count = "1"
Open "U:\Laurent Despineux\PC DMIS\Automated\Superdynamic\list.txt" For Input As #1
Do While Not EOF(1)
       Line Input #1, Textline
       Count = Count + 1
Loop
Close #1

Dim MyList$ (25)

Let C= "0"
Open "U:\LAURENT DESPINEUX\PC DMIS\AUTOMATED\SUPERDYNAMIC\list.txt" For Input As #1
Do While Not EOF(1)
       Line Input #1, Textline
               MyList(C) = LEFT(Textline, 10)
       C = C + 1
Loop
Close #1

Begin Dialog DialogName1 200,184, "Part Number Selection Dialog Box"
Text 10,10,88,22, "N auswählen:"
DropListBox 42,76,108,186, MyList$(), .DropList1$
CancelButton 42,108,40,12
OKButton 90,108,40,12
End Dialog


Dim Dlg1 As DialogName1

'       Dlg1.DropList1  =  0 this shows item (0) default In the window In the drop down list
'       You can change it To show Any item On top from Mylist()
Dlg1.DropList1  =  0

'       If cancel button is selected, Exit Sub
Button = Dialog(Dlg1)
If Button = 0 Then Exit Sub
  
Vari = Dlg1.DropList1
Set PCDDmisCommand = PCDDmisCommands.Add(ASSIGNMENT,True)
PCDDmisCommand.Marked = True
retval = PCDDmisCommand.PutText("DROP_SEL",DEST_EXPR,0)
retval = PCDDmisCommand.PutText(mylist$(Vari),SRC_EXPR,0)
MsgBox mylist$(Vari)
End Sub

​


If i'm putting a Value manually (for instance "12345") instead of the variable (mylist$(Vari)) then it's working...
Additional information: the "ZUWEISEN/DROP_SEL=0" contains the Value chosen in the dropbox when the script is finished... unluckily I cannot use it since when i check it's content with a usercomment, it is "0"
Any ideas?

Parents

  • I adapted a little but still have the same problem.
    It shows me the Serial Number I selected inside the code that embeds the script...
    But when i try "to do something" inside PCDMIS it shows a 0 Value.
    Pretty sure, that's why it's colored in red too.

    When i replace the Values in my list with

    01234
    01235
    01236
    01237
    01238
    01239

    and i select "01239" then it's all good and works...

    I now noticed, that no matter what I type into my list, only the last item in the list works inside of PCDMIS.
    It also needs to be a purely numeric value (anything else and it's red again).
  • "I now noticed, that no matter what I type into my list, only the last item in the list works inside of PCDMIS"
    - Can you please elaborate further or please post your code.
Reply Children
No Data