Xml file into a multiValue

Xml file into a multiValue

nicolas.oeillet
Participant Participant
284 Views
1 Reply
Message 1 of 2

Xml file into a multiValue

nicolas.oeillet
Participant
Participant

Hello everyone,

I am working with iLogic to automate the design of some assemblies and drawings.

But I have a problem, I have an XML "database" for all my different software.

That way, I can easily communicate between each of them.

For example, here is the XML file for the construction code:

 

 

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Lst_Code xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
	<Ligne>
		<Code>ASME VIII Div.1</Code>
	</Ligne>
	<Ligne>
		<Code>AD 2000 Merkblatt</Code>
	</Ligne>
	<Ligne>
		<Code>CODAP Div.2</Code>
	</Ligne>
	<Ligne>
		<Code>EN 13480</Code>
	</Ligne>
	<Ligne>
		<Code>EN 13445</Code>
	</Ligne>
</Lst_Code>

 

 

So, with VB.net, I managed to put this xml list in a combobox using a Dataset, but with Ilogic, I don't know how to do it.

It is very important for us to put the information in one place.

I have the same problem for the stock. For example, I have another xml file for the stock of flanges per reference. In Vb.net, I loaded the xml in a dataset but with Ilogic, once again I don't know how to do it.

Thanks

0 Likes
Accepted solutions (1)
285 Views
1 Reply
Reply (1)
Message 2 of 2

JelteDeJong
Mentor
Mentor
Accepted solution

Many people think that iLogic and VB.Net are different things. But that is not true. iLogic is just an ide for writing VB.net code. Just like Visual Studio is an ide for writing VB.net code. So anything you can do in VB.net can also be done in the iLogic environment. (don't confuse VB.net with VBa which are different things.)

Anyway here is a small code example:

AddReference "System.xml.dll"
Dim xmlDoc As New System.Xml.XmlDocument()
xmlDoc.Load("C:\temp\XmlFile.XML")

Dim codeList As New List(Of String)
Dim Lignes = xmlDoc.SelectNodes("/Lst_Code/Ligne")
For Each Ligne As System.Xml.XmlNode In Lignes
	Dim code = Ligne.SelectSingleNode("Code")
	codeList.Add(code.InnerText)
Next

chosenItem = InputListBox("Prompt", codeList, codeList.Item(0), Title := "Title", ListName := "List")

MsgBox(chosenItem)

Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Blog: hjalte.nl - github.com