Assignsystem and rename generated table
Hello,
I am writing a tcl script to create geometry and mesh it.
I would like to associate local coordinate system to the mesh and remesh the table with another name than the default one (DistCordTbl1)
For that, I am using the following code :
*assignsystem_option elems 2 0 2 1 10 2 -> What is the difference between assignsystem_option and assignsystem ?
I tried to rename the table by
set Tablename [hm_getvalue tables id=1 dataname=name]
*endnotehistorystate {Renamed Tables from $Tablename to 'test'}
or
*setvalue tables id=1 name='test'
or
*endnotehistorystate {Renamed Tables from 'DistCordTbl1' to 'test'}
But none is working.
Can you help me ?
Thank you in advance
Best Regards
Find more posts tagged with
Thank you Tinh,
I found my mistake $ after incr in TCL ! So now it works.
Unfortunately, I am still stuck due to the following issues :
- Test with : *assignsystem_fromcurves elements 2 lines 1 10 7 1 0 $increment_table 1
+ a table is created but each element id is missing
+ the element orientation is unchanged '-Y direction' instead of 'Z direction' provided by the curve
- Test with : *assignsystem_option elements 2 0 2 1 50 7
+ No table is created
+ the element orientation is unchanged '-Y direction' whatever the axis used except for the X axis where no vector is printed
As I don't use Optistruct for the code, the 'assign' button is not available. I can only have access to the 'project' button when I select elements by 'props'.
As the props are defined separately from HyperMesh, it is not what I want.
Do you have any clue to solve my issues ?
Thank you in advance
<?xml version="1.0" encoding="UTF-8"?>
I checked that. I tried to add manually an elem id with the following line :
*createmark elems 2 200000
same for the line, I created manually the line mark
*createmark lines 1 546
But unfortunately, nothing works.
When I look at the table with missing elem id, the total number of line is consistent with the number of element in the mark. i.e 20
I don't understand your last point.
As you can see, the id 200000 exists.
In my TCL script, I renumbered elem id before to assign a system with that line :
*renumbersolverid elems 2 [expr 2*$Noeud_Elem_RD_Id_Start_BaseLine] 1 0 0
Here is an extract of the output file. The id 200000 is defined.
*ELEMENT,TYPE=S4R,ELSET=ELEM_PEAU_RAIDISSEUR_AMONT_COMP
200000, 100000, 100001, 100002, 100021
200001, 100021, 100002, 100003, 100020
200002, 100020, 100003, 100004, 100019
200003, 100019, 100004, 100005, 100018
200004, 100018, 100005, 100006, 100017
200005, 100017, 100006, 100007, 100016
200006, 100016, 100007, 100008, 100015
200007, 100015, 100008, 100009, 100014
200008, 100014, 100009, 100010, 100013
My code :
set NSET_PEAU_RAIDISSEUR ''
set ELSET_PEAU_RAIDISSEUR ''
set ELSET_PEAU_RAIDISSEUR_COMP ''
set elem_ids []
set nodes_ids []
set TABLE_NAME ''
set Line_Id_ELEM_Orien 0
append NSET_PEAU_RAIDISSEUR 'NODES_' $NOM_PEAU_RAIDISSEUR '_AMONT'
append ELSET_PEAU_RAIDISSEUR 'ELEM_' $NOM_PEAU_RAIDISSEUR '_AMONT'
append ELSET_PEAU_RAIDISSEUR_COMP 'ELEM_' $NOM_PEAU_RAIDISSEUR '_AMONT_COMP'
*createentity sets type=nodes name=$NSET_PEAU_RAIDISSEUR id=100
*createentity sets type=elems name=$ELSET_PEAU_RAIDISSEUR id=101
*createentity comps name=$ELSET_PEAU_RAIDISSEUR_COMP id=102
incr increment_table
# Recuperation du numero de la lisgne a utiliser
*createmark lines 1 'by surface' [lindex $Surf_List_Amont_Raidisseur 0]
set lines_ids [hm_getmark lines 1]
*clearmark lines 1;
# Selection de la ligne de projection
set lines_ids [regexp -all -inline {\S+} $lines_ids]
set lines_ids [lsort -unique $lines_ids]
foreach Line_Id $lines_ids {
*createmark lines 1 $Line_Id
lassign [join [hm_getboundingbox lines 1 0 0 0]] x_min y_min z_min x_max y_max z_max
# Surface parallele au plan YZ
if {[expr $y_max - $y_min] <= 0.1 && [expr $z_max - $z_min] >= 0.1} {
set Line_Id_ELEM_Orien $Line_Id
break
}
}
# Parcours de toutes les sufaces
foreach Surf_Id $Surf_List_Amont_Raidisseur {
set lines_ids []
*createmark surfs 1 $Surf_Id;
*interactiveremeshsurf 1 $TailleElement_Raidisseur 4 2 2 1 1
#*set_meshfaceparams 0 5 0 0 0 1 0.5 1 1
*set_meshfaceparams 0 2 1 0 0 1 0.5 1 1
#*automesh 0 5 0
*automesh 0 2 4
*storemeshtodatabase 1
*ameshclearsurface
*clearmark surfs 1;
*createmark nodes 1 'by surface' $Surf_Id
*renumbersolverid nodes 1 $Noeud_Elem_RD_Id_Start_BaseLine 1 0 0
*createmark nodes 1 'by surface' $Surf_Id
lappend nodes_ids [flatten [hm_getmark nodes 1]]
*createmark elems 2 'by surface' $Surf_Id
#*renumbersolverid elems 2 [expr 2*$Noeud_Elem_RD_Id_Start_BaseLine] 1 0 0
*createmark elems 2 'by surface' $Surf_Id
lappend elem_ids [flatten [hm_getmark elems 2]]
*clearmark elems 2
# Affection de l'orientation materiau aux elements
*createmark lines 1 $Line_Id_ELEM_Orien
*createmark elems 2 'by surface' $Surf_Id
*assignsystem_fromcurves elements 2 lines 1 10 7 1 0 $increment_table 1
*clearmark lines 1
*clearmark elems 2
}
set nodes_ids [lsort -unique $nodes_ids]
set elem_ids [lsort -unique $elem_ids]
eval *createmark nodes 1 [flatten $nodes_ids]
eval *createmark elems 2 [flatten $elem_ids]
*entitysetupdate $NSET_PEAU_RAIDISSEUR nodes 1
*entitysetupdate $ELSET_PEAU_RAIDISSEUR elems 2
*movemark elements 2 $ELSET_PEAU_RAIDISSEUR_COMP
append TABLE_NAME 'SYS_ORIEN_TABLE_SURF_AMONT'
*setvalue tables id=$increment_table name=$TABLE_NAME
*clearmark elems 2
*clearmark nodes 1
*clearmark lines 1
The created table is empty. The element orientation is the default one. I am sure about the line. (see the 1st picture)
<?xml version="1.0" encoding="UTF-8"?>
With the same code and the Optistruct Template, the orientation element is good. (see the 2nd picture)
<?xml version="1.0" encoding="UTF-8"?>
As you can see, I also tried to create shell property that is assigned to the same surface. I tried to define material orientation per the Analysis > Systems > material orientation. When I select the 3-local axis, the element orientation remain following the 2 - local axis.
So my question is, is there any thing I made wrong or is there any bug in the Abaqus template ?
About assignsystem_option and assignsystem: you should read reference help.
If *setvalue tables id=1 name='test' is not working, maybe a table named test is existing, or id 1 not found