How to read .csv file in hypermesh and import meshed component automatically?

sanket_patil
sanket_patil Altair Community Member
edited October 2020 in Community Q&A

I want to read my database excel sheet in hypermesh to import part directly. How can we do that?? 

Answers

  • tinh
    tinh Altair Community Member
    edited October 2018

    Can you open/read a csv file?

  • sanket_patil
    sanket_patil Altair Community Member
    edited October 2018

    yes

     

  • tinh
    tinh Altair Community Member
    edited October 2018

    Can you import parts?

  • sanket_patil
    sanket_patil Altair Community Member
    edited October 2018

    no..can you tell tcl script to read .csv file in hypermesh?? 

  • Nagarjuna Pagadala
    Nagarjuna Pagadala
    Altair Employee
    edited October 2018

        set fp [open $filepath r]
        set fileData [read $fp]
        close $fp
        
        set fileLines [split $fileData '\n']

     

        foreach line $fileLines {
            set lineData [split $line ,]
            
            puts 'Parts of the line: [lindex $lineData 0] and [lindex $lineData 1]'
        }