Jump to content
Guest

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

Recommended Posts

Guest

Hi,

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

Thanks

Share this post


Link to post
Share on other sites
Guest

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

Share this post


Link to post
Share on other sites
2 hours ago, Manoj Yandra said:

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

 

Share this post


Link to post
Share on other sites
9 hours ago, Manoj Yandra said:

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" :)  Try it!

 

Share this post


Link to post
Share on other sites

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.

 

 

 

Share this post


Link to post
Share on other sites

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

 

Share this post


Link to post
Share on other sites

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.

mesh.PNG

Share this post


Link to post
Share on other sites
13 hours ago, Manoj Yandra said:

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.

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.

 

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites
3 hours ago, Manoj Yandra said:

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]

 

Share this post


Link to post
Share on other sites

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  

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
You are posting as a guest. If you have an account, please sign in.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...