Here is a macro that parses the path name from Client:RunCommonDialog and passes it to 
an external executable (csv_gbn.exe).
HTH

' RunBom.bas - ClientBasic macro for Protel 99 SE
' Form BOM report with company numbers -  text output style
' 
' Schematic must be in 'windows file system' DDB format
' 'csv_gbn.exe' v3.2  must be in c:\program files\design explorer 99 SE\ 

Sub Main

Dim b      as Integer
Dim l      as Integer
Dim Fname  as String *255
Dim AFile  as String 
Dim BFile  as String

  
   ResetParameters
   
   AddStringParameter "DocumentType","SCH" 
   AddStringParameter "Prompt"',"Select Schematic for BOM report" 
   AddStringParameter "Dialog","ChooseDocument" 
   
   RunProcess "Client:RunCommonDialog" 
   
   GetIntegerParameter "Result", b
If b  Then
      GetStringParameter "FileName", Fname

'   Msgbox Fname     'diagnostic 

      ResetParameters
      AddStringParameter "DocumentName", Fname 
      RunProcess "Sch:ReportBOM" 
   
      ResetParameters
      RunProcess "Client:CloseDocument" 

      SetCursorBusy

'  Parse Filename string to get path
     b = InStr(1, Fname, "$RP") 'locate preceding field
     b = b + 4                    'set first char of path 
     l = InStr(1, Fname, "$RN") 'locate end of path 
     l = l - b                    'length of path 
     AFile = Mid(Fname, b, l) 'fetch path name 
     BFile = Mid(Fname, b, l) 'fetch path name for later use 
      
'  Parse Filename string to get schematic name 
     b = InStr(1, Fname, "$ON") 'locate preceding field
     b = b + 4                    'set first char of schematic name 
     l = InStr(1, Fname, "$ID") 'locate end of schematic name
     l = l - b                    'length of sch name 
     AFile = AFile + "\" + Mid(Fname, b, l) 'fetch schematic name
     l = Len(AFile)
     AFile = Mid(AFile, 1, (l-3))
     AFile = AFile + "sch" 'form lowercase extension for csv_gbn.exe

 
'   Msgbox AFile    'diagnostic  
    
     Open "C:\Program Files\Design Explorer 99 SE\bom_sch.tmp" For Output As #1 
     Write #1, AFile 
     Close #1 
    
    
     ResetParameters
     RunApplication "C:\Program Files\Design Explorer 99 SE\csv_gbn.exe" 
 
   
     ResetCursor
     
     '  Parse Filename string to get DDB name 
     b = InStr(1, Fname, "$RN") 'locate preceding field
     b = b + 4                    'set first char of DDB name 
     l = InStr(1, Fname, "$OP") 'locate end of DDB name
     l = l - b                    'length of DDB name 
     BFile = BFile + "\" + Mid(Fname, b, l) 'fetch DDB name & add to path 
  
'    Form Bom Filename   
     l = Len(AFile)
     AFile = Mid(AFile, 1, (l-4))
     AFile = AFile + "_bom.txt" 
'         Msgbox BFile        'diagnostic  

     ResetParameters     
     AddStringParameter "FileName", BFile  
 
     RunProcess "Client:OpenDocument"
      
     ResetParameters
     AddStringParameter "CreateNewDesign", "False"      
     AddStringParameter "FileName", AFile  
 
     RunProcess "Client:OpenDocument"

Else 
      Msgbox "File confusion?"   
End If

End Sub   
'--------------------------------------------------------------------------------------}



> -----Original Message-----
> From: ERIC BOBILLIER [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, November 04, 2003 7:42 AM
> To: Protel EDA Forum
> Subject: Re: [PEDA] Macro with process container
> 
> 
> Wojciech
> 
> Perhaps my explain was not clear.
> I want place process container in sch with macro because it's 
> the only way i
> have found to run it simply with sch:ExecuteProcessContainer.
> I want choose document in folder outside DDB, get his address 
> (path), store
> it via Processcontainer who have 3 parameters:
> 1)Process : RunApplication
> 2)InstanceName : Name of document
> 3)Configuration : application = Nodepad | parameter = address of the
> selected document
> 
> And run it with  sch:ExecuteProcessContainer.
> 
> Like that, everytime i open my sch i can run the specific 
> document associate
> with him.
> 
> The problem is not to store the path string in the sch,but to 
> read it after
> to open nodepad with the good document.
> 
> If you know how read a string (for use in macro)in the sch, i'm very
> interest.
> 
> You know,if i can place processcontainer with parameter,after i can
> associate different kind of document (Like PDF,Image,etc)
> in the sch.And open there with there specific readers with 
> juste modify the
> name of the application in (3).
> 
> Regards
> 
> Eric
> 
> 
> 


* * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* To post a message: mailto:[EMAIL PROTECTED]
*
* To leave this list visit:
* http://www.techservinc.com/protelusers/leave.html
*
* Contact the list manager:
* mailto:[EMAIL PROTECTED]
*
* Forum Guidelines Rules:
* http://www.techservinc.com/protelusers/forumrules.html
*
* Browse or Search previous postings:
* http://www.mail-archive.com/[EMAIL PROTECTED]
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

Reply via email to