Jump to content
Sign in to follow this  
Guest

Use Comment Entries for renaming

Recommended Posts

Guest

Hi everybody,

I need to use Comment Entries form Component-Cards to do a rename of Components.

Solver Template is Nastran.

It works fine so far with PSOLIDs but doesn't with PSHELLs .

I tried to get the information of the comments, but using :

hm_attributeindexarraylength comps $comp1 6 -byid (6 is the index) doesn´t work fine.

There are Comps with the information in index 6, some in 7 others in 5 or 8 or even higher!

Is there no fix definition ?

Does anyone know a more direct way to get these infos in HM8.0SR1 (all SA-Updates installed)?

Bye,

Florian

Share this post


Link to post
Share on other sites
Guest

try using the hwat command ::hwat::utils::RenameEntity ...to review how its usage, review the altair tools help...

you may need to add a path to the hwat libraries, use the following code

	set tclDir [hm_info -appinfo SPECIFIEDPATH hw_tcl_common]	set hwatDir [file join $tclDir "hwat"]	lappend auto_path $hwatDir	package require hwat

Share this post


Link to post
Share on other sites
Guest

Hi Cesar,

Sorry! I wrote wrong hm_ command in my question! Must of course be: ...value

hm_attributeindexarraylength --> hm_attributeindexarrayvalue

Renaming by Macro is no problem. My problem is to read out the comment-information.

Example: A component is named by import of Nastran-Deck -> PSHELL_13013

it has the comment info (CAD-Part-name, Mat & Thickness)

-> 123456_C1A_Test-Part (1st comment line)

-> DX54C 4.5 (2nd comment line)

Target is to rename PSHELL_13013 --> P13013;123456_C1A_Test-Part_DX54C_4x5mm

As I wrote, I know a way to get these infos, by :

hm_attributeindexarrayvalue comps CompID indexID -byid

but there seems to be no definition which indexID is reseverd for comment-lines.

Do you or anyone else know a (mybe unsupported) command to get the comment lines as string values?

Share this post


Link to post
Share on other sites
Guest

try using less characters, I counted 39 characters, try using up to 32. I would avoid using ";" in the collector name, I would use "_" instead.

Share this post


Link to post
Share on other sites
Guest

You can also use the hm_attribute.... commands with the name of the values you want to get. It takes a bit of digging in the template to get the names - in the include directory for the nastran template is components.tpl. The comments are in COMMENT_ARRAY, COMMENT_ARRAY_NUM stores the number of lines.

try:

set comment_text_line1 [hm_attributearrayvalue COMPS "PSHELL_13013" "$COMMENT_ARRAY" 1]

and repeat for each line of comment info you want to use, up to the value of COMMENT_ARRAY_NUM. Then you can use the string manipulation commands to combine all the string variables into the new string name you want to use.

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.

Sign in to follow this  

×
×
  • Create New...