Jump to content

Recommended Posts

Dear all,

 

I am working right now on a topology optimization based on a tcl script. It is important to me to identify certain nodes in order for my load cases.

Lets say I have in my script something like

*createnode 0 0 0 0 0 0
*createnode 0 1 0 0 0 0

 

and then a section where I want to apply a load to it. I did it like this:

*createmark nodes 1  1(that 1 is the node id)
*loadcreateonentity_curve nodes 1 1 1 0 0 150 0 0 150 0 0 0 0 0

 

The problem I have is, that the block with the createnode part can vary so the Ids are not always the same. I did not find a way to include a specific ID in the *createmark line in order to work with it later.... it does more or less: id: 1,2,3,4 as you progress creating your nodes.

I thought on selecting my nodes differently, maybe with *createmark nodes 1 "on plane" but I did not have sucess there either. How would you solve this problem? I must work with specific nodes I create but te nodes can vary so either I have to renumber it in a way I know which id it has, maybe based on coordinates or assign specific node Ids.

 

Thanks in advance for discussing this topic with me,

 

Best regards,

Merula

 

Share this post


Link to post
Share on other sites
Guest

Hello,

 

maybe it helps if you save the node IDs, like this:

 

*createnode 100 100 100 0 0 0
*createmark nodes 1 -1
set NID1 [hm_getmark nodes 1]

now the node Id of the last created node (-1) is saved at NID1...

 

Best Regards,

Mario

 

Share this post


Link to post
Share on other sites

Thanks Mario, that works great. I am having one issue though regarding this method

 

if I want to combine several node Ids into one variable, something like

 

set myIds $NID1 $NID2 ...

and later I want to reuse my collector with the *createmark command, this does not work

works:
*createmark nodes 1 $NID1 $NID2

does not work
*createmark nodes 1 $myIds

Thanks in advance for your help and keep up the good work :)

 

Merula

Share this post


Link to post
Share on other sites

Thanks for the help. The answer was to use lists....like:

set myIds "$NID1 NID2"

what seems strange to me at the moment is, that in the thread you mentioned, it is highly suggested to use hm_createmark instead of *createmark. Would you agree? I try substituting it in my script but at the following statement it is impossible to get hm_createmark working like it should:

eval *createmark nodes 1 {"by box"} [expr $x-$delta] [expr $y-$delta] [expr $z-$delta] [expr $x+$delta] [expr $y+$delta] [expr $z+$delta] 0 inside 0 0 0 

what I tried is 

hm_createmark nodes 1 [expr $x-$delta] [expr $y-$delta] [expr $z-$delta] [expr $x+$delta] [expr $y+$delta] [expr $z+$delta] 0 inside 0 0 0 

Syntax error: 
wrong # args: should be "hm_createmark entity_type mark arg3 ?arg4?"

Any thoughts ?

Thanks in advance,

Merula

Share this post


Link to post
Share on other sites

due to your "by box" disappeared

:lol:

 

 

actually hm_createmark will invoke the command "eval *createmark..."

so if you already know how "eval" works, hm_createmark is unneccessary anymore

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...