×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Jornal: Load(read) all materials from material library

Jornal: Load(read) all materials from material library

Jornal: Load(read) all materials from material library

(OP)
Hey!
I write a journal to add attributes and material to every component in assembly.
In this journal I have combobox with material.
My idea is add all materials from material library to this Combobox.
I can't find way to read material from library.

Maybe somebody know what I must doing.

Best regards

Michał Nowak

NX9 & Tc10

RE: Jornal: Load(read) all materials from material library

Learn to read .xml files via VB - the material library is an .xml file!

RE: Jornal: Load(read) all materials from material library

(OP)
Thanks daluigi, it works.
I still thought - what I must doing for do it with NX.

If anyone ever going to need this I wrote this code:

CODE --> vb

Imports System.Xml     
Imports System.IO

Dim material_File as String
Dim IS_Material_File as Boolean = False        
If(File.Exists(UGIIROOTDIR & "physicalmateriallibrary.xml")) Then
	material_File = UGIIROOTDIR & "physicalmateriallibrary.xml"
	IS_Material_File = True
Else
	Msgbox ("I have no blade pojecie gdzie jest baza materiałów")
End if  
     If Is_Material_File = true then  
        Dim xmldoc As New XmlDocument()
        Dim xmlnode As XmlNodeList
        Dim i As Integer
        Dim str As String
        Dim fs As New FileStream(material_File, FileMode.Open, FileAccess.Read)
        xmldoc.Load(fs)
        xmlnode = xmldoc.SelectNodes("//Material/BulkDetails")
		lw.Writeline(xmlnode.Count)
        For i = 0 To xmlnode.Count - 1
            str = xmlnode(i).ChildNodes.Item(0).InnerText.Trim() 
            myDialog.ComboBox1.Items.Add(str)
        Next
     End If 





Best regards
Michał Nowak

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources