- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi everyone,
when we start new dwg it shows listbox with client names. Picking desired one it fill title block with client name. If someone start and hit enter key it just skip rule and will not fill title block with client.
My question is : Is it possible to add line of code(s) if enter key is pressed to do nothing until pick something from list, or just to close file to teach people to not skip nothing.
Again, Big thanks for help
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
hi Misterzs
I dont know if is possible for the enter key but the box who appear when you create a new drawing is a rule?
Sorry for my poor english ![]()
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Something like this should work :
Dim vendorProperty As String
vendorProperty = ""
Dim vendorList As New ArrayList
vendorList.add("Test1")
vendorList.add("Test2")
vendorList.add("Test3")
While vendorProperty = ""
vendorProperty = InputListBox("Prompt", vendorList, "", Title := "New Title Here", ListName := "List Name Here")
End While
iProperties.Value("Project", "Vendor") = vendorProperty
''' You could even do something like :
'If iProperties.Value("Project", "Vendor") = "" Then
' While vendorProperty = ""
' vendorProperty = InputListBox.......
' End While
' iProperties.Value("Project", "Vendor") = vendorProperty
'End If
''' that way, if the iProperty Value is already filled out, you won't
''' even see the dialog to select a new one.
''' It might not be useful, but I figured I would give an example.
If my solution worked or helped you out, please don't forget to hit the kudos button
iLogicCode Injector: goo.gl/uTT1IB

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Thanks MegaJerk,
i end up with this code. Required excel sheet. On opening new dwg show up input box with clients. If hit enter won't go away. In my case Client is maped into Title block and will be written on save. Hope this may help to others.
'Open list of our Clients
GoExcel.Open("C:\Customer.xlsx", "Sheet1")
lastUsedRow = 2
'set the list to be read from the XLS file
Dim myArrayList As New ArrayList
'add the values from the Excel file to an array list
While GoExcel.CellValue("A" & lastUsedRow) <> ""
myarraylist.add(GoExcel.CellValue("A" & lastUsedRow))
lastUsedRow = lastUsedRow + 1
End While
If iProperties.Value("Summary", "Company") = "" Then
While CompanyProperty = ""
CompanyProperty = InputListBox("Select Customer from list", myArrayList, myArrayList, Title := "iLogic", ListName := "Customer")
End While
iProperties.Value("Summary", "Company") = CompanyProperty
End If