Enter command in iLogic

Enter command in iLogic

GosponZ
Collaborator Collaborator
1,192 Views
4 Replies
Message 1 of 5

Enter command in iLogic

GosponZ
Collaborator
Collaborator

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

 

0 Likes
Accepted solutions (1)
1,193 Views
4 Replies
Replies (4)
Message 2 of 5

Anonymous
Not applicable

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 😞

0 Likes
Message 3 of 5

GosponZ
Collaborator
Collaborator

Yes it is rule, very simple and very handy but some people ignore and hit enter and rule skip.Unfortunately.

0 Likes
Message 4 of 5

MegaJerk
Collaborator
Collaborator
Accepted solution

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

GitHub
Message 5 of 5

GosponZ
Collaborator
Collaborator

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