Jump to content
flamenco7641

Macro normals

Recommended Posts

Hi all,

I created macro auto adjust normals:
 

proc adjust_normals {} {
	*createmark comps 1 all
	*createmark elems 2 "by config" quad4 tria3
	set List_comps [hm_getmark comps 1]
	for {set n 0} {$n<[hm_marklength comps 1]} {incr n} {
		*createmark elems 1 "by collector" [lindex $List_comps $n]
		*markintersection elems 1 elems 2
		if {![hm_marklength elems 1]} {continue} else {
		set List_elems [hm_getmark elems 1]
		set ID_elems_ori [lindex $List_elems 0]
		*normalsadjust elems 1 $ID_elems_ori 0 0
		}
	}
	*normalsoff
	hm_usermessage "Done."
}

but it doesn't work in some case, such as seperated components...
Please suggest a way to improve it.

Share this post


Link to post
Share on other sites

If you have access to Altair script exchange.Then kindly have a look at it.You would find readily available macros for similar request.

 

Regards

Rahul R

Share this post


Link to post
Share on other sites

Hi,

the better way is isolate only tria3 and quad4

then do a "while loop" to adjust normal for elems "by attached", then mask them, until no elems display

 

more advanced, you should care about connectivity error (two areas share only 1 node?)

and if there are T-connection (should select base elem on the largest area?)

Share this post


Link to post
Share on other sites
On 1/7/2016 at 4:11 PM, Rahul R said:

If you have access to Altair script exchange.Then kindly have a look at it.You would find readily available macros for similar request.

 

Regards

Rahul R

Thanks Rahul, I can't access to  Altair script exchange :(

5 hours ago, tinh said:

Hi,

the better way is isolate only tria3 and quad4

then do a "while loop" to adjust normal for elems "by attached", then mask them, until no elems display

 

more advanced, you should care about connectivity error (two areas share only 1 node?)

and if there are T-connection (should select base elem on the largest area?)

Thanks tinh,
Did you mean "by adjacent" because all components are connected by rbody?

Share this post


Link to post
Share on other sites

Hi, 

I mean that should not loop through each component

instead, loop through each "attached elems area", do not care about RBODY because you isolated only tria3 and quad4

so "by attached" will not select over RBODY connection

Share this post


Link to post
Share on other sites
7 hours ago, tinh said:

Hi, 

I mean that should not loop through each component

instead, loop through each "attached elems area", do not care about RBODY because you isolated only tria3 and quad4

so "by attached" will not select over RBODY connection

OK, thanks tinh

Share this post


Link to post
Share on other sites

×
×
  • Create New...