Jump to content

modifying / getting Nastran CBEAM properties (orientation / offset vectors)

Recommended Posts

Hi Guys,
I'm trying to automate the creation of CBEAM elements along a node path wrt to a given "template" element which is already in the model. What I could achive so far is the creation of the CBEAM elements with help of the *feature_add command to create plot elements along a given nodepath and then switch the configuration of the created PLOTEL. These PLOTEL can now be "switched" to CBEAMs utilizing the *attributeupdateint, *attributeupdatedouble and *attributeupdateentity command. The correct property assignment can be done with the *propertyupdate command.

So far so good. In the next step, the orientation and offset vectors of the newly created CBEAM elements have to be adjusted with the *barelementupdatewithoffsets command. But the questions is, how can I extract these vectors from the "template" element. I already tried to use the hm_attributevalue / hm_atttributearrayvalue and hm_getentityvalue, but I don't know the correct keyword, to access the needed information. This leads me to two questions:

  • Does anybody know the correct command / keyword to obtain the orientation and offset vector data from a CBEAM element or
  • is there any possibility / a list to get all the possible query options to make on an element.

Thanks for you help,
# get nodes along beam path
*createlistbypathpanel nodes 1 "Select nodes for the beam:"
# save nodes in list
set lstNodeList [hm_getlist nodes 1]
# create plot element along node path
*features_add 1 0 0
# put newly created element in element mark 1
*createmark elms 1 "by comp name" "^open features"
# save plot element in list
set lstPlotElementList [hm_getmark elms 1]
# switch configuration to bar for all elements in list
*configedit 1 "bar2"
foreach numPlotElementID $lstPlotElementList {
 *attributeupdateint elms $numPlotElementID 4841 1 2 0 0
 *attributeupdatedouble elms $numPlotElementID 3273 1 0 0 0
 *attributeupdateentity elms $numPlotElementID 3271 1 0 0 nodes 0
 *attributeupdateentity elms $numPlotElementID 3272 1 0 0 nodes 0
# choose template element
*createmarkpanel elms 2 "Select template CBEAM element"
# save element id in list
set numTemplateElementID [hm_getmark elms 2]
# get property from template element
set numHMPropertyID [hm_getentityvalue elms $numTemplateElementID property 0]
# get property name
set strHMPropertyName [hm_getentityvalue props $numHMPropertyID name 1 -byid]
# put new beam elements to mark
*createmark components 1  "^open features"
# assign properties on component
*propertyupdate components 1 "$strHMPropertyName"



now the part with getting the element properties (X1 X2 X3 W1A W2A W3A W1B W2B W3B) from the "template" element should come


Share this post

Link to post
Share on other sites

hi Blubber

why you have to mesh "plot" then switch them to "bar2"?

you can create "bar2" from nodes by (example)


*elementsizeset 10

eval *createlist nodes 1 $NodeList

*linemesh_preparenodelist 1

*linemesh_saveparameters 0 1 0 0

*linemesh_saveparameters 1 1 0 0

*createvector 1 $vx $vy $vz ;#orient vector

*linemesh_savedata_bar nodes 1 60 0 1 $ax $ay $az $bx $by $bz 0; # a and b is offset values




anyway if you want to get vector and offset values of bar element  by hm_getentityvalue please refer 


Share this post

Link to post
Share on other sites

Hi tinh,


thanks for your reply and you're right, yours is a far more elegant way to create the bar/beam elements, and I think I'll implement it. But still, even by refering to the reference guide, I couldn't find the correct keyword to access the vector data. From trial an error I could obtain the GA and GB nodes by e.g. hm_getentityvalue elms $elemID node1 0 -byid and hm_getentityvalue elms $elemID node2 0 -byid respectively, but I've no clue what the correct data_name / keyword for the vector definition is. Refering to the template names by e.g. hm_getentityvalue elms $elemID \$GA 0 -byid doesn't work either.


Do you have any other idea?





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.

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