🎉Community Raffle - Win $25

An exclusive raffle opportunity for active members like you! Complete your profile, answer questions and get your first accepted badge to enter the raffle.
Join and Win

how to find node number If I create node with *createnode command

User: "Altair Forum User"
Altair Employee
Updated by Altair Forum User

Hi,

I have created node with *createnode command.How to get the node number of newly created node with using TCL command.

Thanks

Find more posts tagged with

Sort by:
1 - 21 of 211
    User: "Altair Forum User"
    Altair Employee
    OP
    Updated by Altair Forum User

    There is a pretty easy way to get the id of an entity that you just created. HM keeps a stack of those entities

    *createnode 0 1 0 1 0 0 *createmark nodes 1 -1set node_id [hm_getmark nodes 1]puts 'The node id I just made is $node_id'

    You can also get the second last entity using -2, etc.

    Eric

    User: "Jaggs"
    New Altair Community Member
    Updated by Jaggs

    Thanks etg, very useful

    User: "Manoj Yandra"
    Altair Community Member
    Updated by Manoj Yandra

    Hello, I have created a circle center node. I want to renumber it with a known value just after it is created (using tcl code). How can I do it?

    User: "QuyNguyenDai"
    Altair Community Member
    Updated by QuyNguyenDai

    Hello, I have created a circle center node. I want to renumber it with a known value just after it is created (using tcl code). How can I do it?

     

    Here's an example: you create the center of circle by 3 nodes (1712, 1709 & 1541). Then you renumber the center as 50000:

     *createmark nodes 1 1712 1709 1541 *createbestcirclecenternode nodes 1 0 1 0 set centerID [hm_latestentityid nodes] *clearmark nodes 1 *createmark nodes 1 $centerID *renumbersolverid nodes 1 50000 1 0 0 0 0 0

     

    User: "Manoj Yandra"
    Altair Community Member
    Updated by Manoj Yandra

    Hello, the above code worked. Thanks

     

    I have created a line entity. I want to renumber it with a known value just after it is created (using tcl code). How can I do it.

    User: "QuyNguyenDai"
    Altair Community Member
    Updated by QuyNguyenDai

    Hello, the above code worked. Thanks

     

    I have created a line entity. I want to renumber it with a known value just after it is created (using tcl code). How can I do it.

     

    The same as nodes. You remplace entity 'nodes' by 'lines' :)/emoticons/default_smile.png' srcset='/emoticons/smile@2x.png 2x' title=':)' width='20' />  Try it!

     

    User: "Manoj Yandra"
    Altair Community Member
    Updated by Manoj Yandra

    Ya, I did the same as you suggested, I wrote the script as:

    *createlist nodes 1000

    *createvector 1 0 1 0

    *createcirclefromcenterradius 1 1 22.5 360 0

    set lineid [hm_latestentityid lines]

    *clearmark lines 1

    *createmark lines 1 $lineid

    *renumbersolverid lines 1 10000 1 0 0 0 0 0

     

    When I tried the above script, the error is shown as 'program stopped executing at *renumbersolverid lines 1 10000 1 0 0 0 0 0 '.

    I think the line is not getting renumbered to 10000. Can you please tell me the mistake in above script or any alternative solution?

    Thank You for your fast responses. Very much appreciated.

     

     

     

    User: "QuyNguyenDai"
    Altair Community Member
    Updated by QuyNguyenDai

    The following code works without issue for me:

     *createlist nodes 1 96 94 100 *createcirclefrompoints 1 1 set lineid [hm_latestentityid lines] *createmark lines 1 $lineid *renumbersolverid lines 1 10000 1 0 0 0 0 0

     

    User: "Manoj Yandra"
    Altair Community Member
    Updated by Manoj Yandra

    The above code worked. Thx.

    I created a 2d cylindrical mesh and I wanted to renumber it in a specific order as shown in figure. I want to get #13 just above #1 (i mean once the node#12 is numbered in first plane, then #13 must be starting just above #1). The objective is to align nodes 25, 37, 49, 61, ..... with nodes 1 and 13; similarly 26, 38, 50, 62,........ with nodes 2 and 14.

    I tried renumbering 'node by path' but couldn't control the manner of numbering.

    <?xml version="1.0" encoding="UTF-8"?>mesh.PNG

    User: "Adriano_Koga"
    Altair Employee
    Updated by Adriano_Koga

    i know you're trying a script for that, but you should take a look at the 'Aerospace' userprofile in HM.

    User Profiles>>Enginenering Solutions>>Aerospace.

     

    There is the Spatial ID Manager, that probably do what oyu need.

    image.png.bfe1a0d2aa74b6724a1035e174f87a73.png

    Unable to find an attachment - read this blog

    User: "QuyNguyenDai"
    Altair Community Member
    Updated by QuyNguyenDai

    The above code worked. Thx.

    I created a 2d cylindrical mesh and I wanted to renumber it in a specific order as shown in figure. I want to get #13 just above #1 (i mean once the node#12 is numbered in first plane, then #13 must be starting just above #1). The objective is to align nodes 25, 37, 49, 61, ..... with nodes 1 and 13; similarly 26, 38, 50, 62,........ with nodes 2 and 14.

    I tried renumbering 'node by path' but couldn't control the manner of numbering.

    <?xml version="1.0" encoding="UTF-8"?>mesh.PNG

     

    I don't think you can do that with method 'automatic' renumbering, via Hypermesh panel.

    But maybe it's simpler to control at begin of mesh creation? I mean you use Tcl script to create element by element for one layer and then copying later to get full mesh.

     

    User: "Manoj Yandra"
    Altair Community Member
    Updated by Manoj Yandra

    Thx Mr.Adriano and Mr.Nguyen for ur responses.

    @Mr.Adriano, My Hypemresh is 2019.1 version and I couldnt find 'Aerospace' list.

    @Nguyen, I am actually trying to renumber the nodes of face elements of a hexamesh.

    User: "Adriano_Koga"
    Altair Employee
    Updated by Adriano_Koga

    change user profile first to engineerign slutions>> Aerospace user profile.

    User: "Manoj Yandra"
    Altair Community Member
    Updated by Manoj Yandra

    Ya, I will try that.

    I think the below actions would work to ensure node alignment:

    1) Projecting duplicate nodes of first circle to the 2nd plane

    2) Equivalencing the 2nd plane nodes to the duplicate nodes

    User: "Manoj Yandra"
    Altair Community Member
    Updated by Manoj Yandra

    /profile/97129-adriano-a-koga/?do=hovercard' data-mentionid='97129' href='<___base_url___>/profile/97129-adriano-a-koga/' rel=''>@Adriano A. Koga, I tried the panel you suggested, but it displayed as that the function doesnt support for hexa element nodes.

     

    Can  anyone say how to define base node (in N1,N2,N3,B plane) through its node id?

    User: "QuyNguyenDai"
    Altair Community Member
    Updated by QuyNguyenDai

    *createplane ?

    User: "Manoj Yandra"
    Altair Community Member
    Updated by Manoj Yandra

    yes, when i look the tcl script it defines the plane by coordinates of nodes. I want to project nodes along y-axis at one base point. And the base point keeps on changing for each case. So it will be difficult to enter location of node in script everytime. i thought it would be easy if we can be able to define the base point through its id. or is there any other way to do projection of nodes to a plane using script?

    User: "Manoj Yandra"
    Altair Community Member
    Updated by Manoj Yandra

    how do we retrieve node coordinates of a node and use its coordinates to define a base point?

    User: "QuyNguyenDai"
    Altair Community Member
    Updated by QuyNguyenDai

    how do we retrieve node coordinates of a node and use its coordinates to define a base point?

     

     	set x [hm_getvalue nodes id=$nodeID dataname=globalx] 	set y [hm_getvalue nodes id=$nodeID dataname=globaly] 	set z [hm_getvalue nodes id=$nodeID dataname=globalz]

     

    User: "Adriano_Koga"
    Altair Employee
    Updated by Adriano_Koga

    set node_coords [lindex [hm_nodevalue $id ] 0 ]

    User: "Xavier"
    Altair Community Member
    Updated by Xavier

    the spatial renumbering allows renumber with respect to axis and adjacent, but what if we require renumber along specific path, 

    for example A SPIRAL PATH ALONG SCREW THREAD