Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

ilogic populating custom iProperties from excel

0 REPLIES 0
Reply
Message 1 of 1
brandoncairl
410 Views, 0 Replies

ilogic populating custom iProperties from excel

I am in the process of created a list box that shows up when a user starts a new assembly file that shows a list of customers that they can select from. With their selection, I want Inventor to populate 3 custom iproperty values that correlate with the customer. I have customer name, customer street address, and customer city address. All 3 are seperate custon iProperty values. I have an excel sheet set up with 3 columns, one for each value. I have the code set up to pull in the list of customer names and set the name in iproperties, but I can't figure out how to tie in the street address, or the city address at the same time.

 

Here is the code I have so far:

 

 

'get list from excel using an array list

'define excel location
myxls="S:\BCairl\Templates\Customer Info.xlsx"
GoExcel.Open(myxls)

'index row 2 through 1000
For rowNumber=2 To 1000
'find first empty cell in column A Customer Name
If(GoExcel.CellValue("A"&rownumber)=("")) Then
'Create a variable for the row that is one row less than the first empty row found
'this assumes the first empty row is the end of the list
lastUsedRow=rowNumber-1

Exit For
End If

Next

'set the list to be read from the excel file
Dim myArrayList As New ArrayList
i=2

'add the values from the excel file to an array list
Do Until i=lastUsedRow+1
myArrayList.add(GoExcel.CellValue("A"&i))
i=i+1
Loop

'present the list to the user
custName = InputListBox("Select from the list", myarraylist, myarraylist.item(0), "Customer Infomation", "Customers")
'set the iproperty
iProperties.Value("Custom", "Customer Name")=custName
'Present the Result
MessageBox.Show("The Customer is: "&iProperties.Value("Custom", "Customer Name"), "Customer Information")

0 REPLIES 0

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report