Jump to content


  • Content Count

  • Joined

  • Last visited

About Philip

  • Rank

Profile Information

  • Are you University user?

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. I have debugged it! There were some minor errors like \n instead of "\n" and the semicolon separator {;} in the split command. For those of you wondering what the final code looks like, you can find it beneath. Note: I've added a line to create a loadcollector for each created force. Thanks for the help tinh!
  2. What the script does now is creating a node at 0 0 0 and a force on that node with components 0 0 0. My test csv file doesn't contain this node, nor a zero force. I'm not sure what's wrong here?
  3. Yeah at first I did. Now, I typed it in myself and it actually gives me another error. Note that now, I created an extra variable $n to show on which node the force needs to be applied. I checked it in the command file and this should actually work. But, I don't really understand the error showing up now.
  4. Okay, so trying the simpler code you provided above, I still get an error. foreach line [split $buf \n] { lassign [split $line] x y z fx fy fz f *createnode $x $y $z *createmark nodes 1 1 *loadcreateonentity_curve nodes 1 1 1 $fx $fy $fz 0 0 $f 0 0 0 0 0 } The reason I put [split $line] is because it is actually separated with a semicolon, so a comma wouldn't work. The error I get is the following: extra characters after close-quote. I would assume that there might be a problem with the '{' after the foreach command, but I'm not sure. Any advice?
  5. The loaded nodes will be linked to the mesh with RBE2 or RBE3 elements (depending on the type of load). These will, for now, be implemented manually afterwards.
  6. Hi, I am making a TCL script to import a CSV file in Altair HyperMesh. The CSV file contains 7 columns (x-coordinate, y-coordinate, z-coordinate, x-force, y-force, z-force and resultant force). The idea is to run the script, the nodes are created on the coordinates given in the first 3 columns, the node is selected, a force is created on the selected note. (This should run through all the rows of the csv file.) The code I have until now is the following: lappend auto_path "C:/Program Files/Altair/2017/hw/tcl/tcllib-1.19/modules" package require csv package require struct::matrix set data [::struct::matrix] $data add rows 16 $data add columns 7 set csvfile [open "coordinates-forces.csv"] csv::read2matrix $csvfile data , auto close $csvfile set rows [data rows] for {set i 0} {$i < $rows} {incr i} { *createnode [data get cell 0 i] [data get cell 1 i] [data get cell 2 i] *createmark nodes 1 i *loadcreateonentity_curve nodes i 1 1 {data get cell 4 i} {data get cell 5 i} {data get cell 6 i} 0 0 {data get cell 7 i} 0 0 0 0 0 } The error I currently get is 'invalid command name "data"'. Any help would be appeciated. Thanks in advance! Philip
  7. Hi, I'm trying to export the laminate that I get as a result of the optimization to some sort of CAD format (sheet or solid). The goal is to get a step file that contains the different thicknesses of the component. Is there an easy way to export this, maybe by using a TCL script? Thanks in advance! Philip
  • Create New...