Jump to content
Sign in to follow this  
Nik

How to assign 1 property per 1 element in Hypermesh?

Recommended Posts

Hello all.

I have a model with properties assigned to groups of elements: 1 property per several elements.

Is it possible to split these properties as follows:

1 element - 1 property.

Element ID = property ID.

 

I suppose it can be done using some scripts.

Or even the way using Excel import \ export will be helpful.

Share this post


Link to post
Share on other sites

it would be possible to create a script, for that, but maybe excel or some text editor would be enough depending on what you already have.

I'm attaching a similar script, not completed, that does something similar to your request, if I remeber correclty.. 

 

 

 

properties_breaker.tcl property_divide.tcl

Share this post


Link to post
Share on other sites
On 7/3/2020 at 9:13 PM, Q.Nguyen-Dai said:

How many elements do you have in your model?

 

~8000 elements and ~100 properties

Share this post


Link to post
Share on other sites

 

On 7/3/2020 at 9:41 PM, Adriano A. Koga said:

 

Thank you.

Now I can split all properties in a way that each element has its own property.

So I have like 10000 properties. This is what I need.

But I still don't know how to assign to each property ID of an element inside this property.

Now I have Prop ID = 1 with Element ID = 2000 in it.

My goal to have Prop ID = 2000 with element ID = 2000.

 

 

 

Share this post


Link to post
Share on other sites

If you want to assign property ID=2000 to element ID=2000 AND if all properties exist already, use my following code:

*createmarkpanel elements 1 "Select elements"
set elemList [hm_getmark elements 1]

foreach eid $elemList {
    *createmark props 1 $eid
    set propList [hm_getmark props 1]
    if { [llength $propList] == 1 } {
	   *setvalue elems id=$eid propertyid=$eid
    } else {
       puts "Prop ID=$eid does not exist!"
    }
}

 

Share this post


Link to post
Share on other sites

It's almost what I need, but I have 2000 elements in ID range 10000 - 12000 (example) AND 2000 properties with ID range 1 - 1999.

Element #10000 has property with ID = 23.

Goal is to renumber current element property with ID of the element.

Share this post


Link to post
Share on other sites

You can use "Tool" => Renumber => Property,

but this automatical method is dangereous and you can get wrong results with element.

What's the difference between Prop 1 & Prop 2, shell thickness? Your elements are shell type?

 

Share this post


Link to post
Share on other sites

I have 3 elm types. 

Crod/Cbar and Cshell.

I did try Renumber tool, but in my case it's too time consuming to renumber properties 1 by 1.

 

As I can see the process:

1) choose element

2) check the property assigned to this element

3) now we have element ID and property ID.

4) set property ID = element ID - where I stuck.

 

But, as I understand there are 2 ID types in HM: solver ID and HM internal ID. 

I tried *renumbersolverid properties 1 $elem_id 1 0 0 0 0 0 as it in command.tcl, but it doesn't work properly.

 

 

Share this post


Link to post
Share on other sites

In nastran, PID is equal EID by default if you don't assign property to element

Don't use *commands in long 'for' loops, use 'puts' to write property cards to a file then import that file, it just takes a few seconds.

 

Share this post


Link to post
Share on other sites

Ok. Thank you for the help.

I did what I want. 

My script is attached.

 

1) choose element

2) store elem ID and prop ID

3) create new property with PID = EID and Pname = EID

4) update new property with stored data from old prop

5) assign new property to element

props_split.tcl

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