Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
jacqueline.lima
in reply to: A.Acheson

I changed my code for this:

 

Dim myList, mySelect As New ArrayList
Dim Instalacao

TolMax = InputBox("Qual a tolerância superior do diâmetro de passagem do parafuso?", "Tolerância Superior")
TolMin = InputBox("Qual a tolerância superior do diâmetro de passagem do parafuso?", "Tolerância Superior")
myList.Add("Cemented")
myList.Add("Screwed")
myList.Add("N/A")
myList_selected = InputListBox("Cimentado, Parafusado ou N/A?", myList, myList(0), Title := "Selecione abaixo", ListName := "List")
mySelect.Add(myList_selected)
For Each Instalacao In mySelect
'	MessageBox.Show("Arquivo .txt gerado com sucesso! Todos os itens foram definidos como: " & Instalacao, "Sucesso!")
Next

oWrite = System.IO.File.CreateText(ThisDoc.Path & "\" & "VerificarConexoes" & ".txt")
Dim oDoc As Inventor.Document
For Each oDoc In ThisApplication.Documents.VisibleDocuments
	If oDoc.DocumentType = kAssemblyDocumentObject Then
		item = iProperties.Value("Project", "Part Number")
		A = Parameter("Ap")
		Emax = Parameter("DIA") + TolMax
		Emin = Parameter("DIA") - TolMin
		B = Parameter("B")
		oWrite.WriteLine(item & ";" & Round(A, 2) & ";" & Round(B, 2) & ";" & Round(Emax, 2) & ";" & Round(Emin, 2) & ";" & Instalacao)
	End If
Next

oWrite.Close()

 

But still not working. The .txt file that is exporting returns just the infos from the assembly that are visible repeating for all documents opened, as below:

jacquelinelima_0-1649783465088.png