Reading Excel or text file to fill some iproperties

Reading Excel or text file to fill some iproperties

info
Explorer Explorer
470 Views
1 Reply
Message 1 of 2

Reading Excel or text file to fill some iproperties

info
Explorer
Explorer

Hello,

 

I'm looking for an Ilogic rule which does the following:

1)Reading Excel file in C\temp (is .txt. faster?)

2)Fill some iProperties values in .iam and .ipt. like Engineer,  Checked By, Project, Company

 

I have a rule which runs a few other rules when it is a part or assembly.

So my wish is to add this new rule to the existing

 

Who is able to help me?

0 Likes
471 Views
1 Reply
Reply (1)
Message 2 of 2

A.Acheson
Mentor
Mentor

It looks like these iProperties you want to enter are a small number and will likely not change much. You can build these in to an external rule using an arraylist of strings and select them by a Input list box and input box. No need for excel unless you have this information all ready prepopulated in some control document you are using. Can you tell us how you will be interacting with this information? Are you looking for individual entry on each document or looking to use static information to fill out multiple documents?

 

External Rule 

 Dim oEngineer, oCheckedBy, oProject, oCompany As String
'[ Engineer
 Dim Engineers As New ArrayList
 Engineers.Add("David")
 Engineers.Add("Mark")
 Engineers.Add("Cassandra")
 
 oEngineer = InputListBox("Pick One", Engineers, d0, Title := "iProperties", ListName := "Engineer List")

 iProperties.Value("Project", "Engineer")= oEngineer
 
 ']

'[ Checkers
 Dim Checkers As New ArrayList
 Checkers.Add("DA")
 Checkers.Add("AD")
 Checkers.Add("FD")
 
 oCheckedBy = InputListBox("Pick One", Checkers, d0, Title := "iProperties", ListName := "Checked By List")

 iProperties.Value("Status", "Checked By") = oCheckedBy
 
 ']
 
 '[ Companies
 Dim Companies As New ArrayList
 Companies.Add("DADDT")
 Companies.Add("Icescream")
 Companies.Add("Dirt Removal")
 
 oCompany = InputListBox("Pick One", Companies, d0, Title := "iProperties", ListName := "Companies List")

 iProperties.Value("Summary", "Company") = oCompany
 
 ']

oProject = InputBox("Prompt", "Project Name", "Enter Project Name here")
iProperties.Value("Project", "Project") = oProject

For multiple document using static information from excel sheet use the below rule

iProperties.Value("Project", "Engineer") = GoExcel.CellValue("filename.xls", "Sheet1", "A2")'Enter File path 
iProperties.Value("Status", "Checked By") = GoExcel.CellValue("filename.xls", "Sheet1", "B2")'Enter File path 
iProperties.Value("Summary", "Company") = GoExcel.CellValue("filename.xls", "Sheet1", "C2")'Enter File path 
iProperties.Value("Project", "Project") = GoExcel.CellValue("filename.xls", "Sheet1", "D2")'Enter File path 
 

 Find the excel snippets here

AAcheson_0-1631980628269.png

 

A text file may be faster but formatting and reading the file via code  is harder to set up and may not be user friendly at dealing with lists etc. 

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
0 Likes