! ******************************
! $Revision: 145002 $
! $Date: 2009-11-13 11:20:27 -0500 (Fri, 13 Nov 2009) $
! ******************************
! macro MTtranBC (_smkeyl)

! *** primary function: transfer the boundary conditions to the model

! *** Notice - This file contains ANSYS Confidential information ***

!  input arguments:
!   _smkeyl             (int,sc)      =0, transfer to FE model
!                                     =1, transfer to solid model
!                                     =2, transfer to solid or FE model -
!                                           whichever is appropriate!
!                                           (for "to ANSYS" button!)

!  output arguments:
!   _success            (int,sc)      =0 no success, =1 success  


/nopr
_SUCCESS=1

! --- debug
*if,_DEBUG,gt,0,then
!{
   /gopr
   *vwrite
   (' === MTtranBC:')
   *vwrite,_CURENV,arg1
   ('     ENV =',f4.0,'   solid model key =',f3.0)
   *if,_DEBUG,lt,3,then
   !{
      /nopr
   !}
   *endif
!}
*endif

_smkeyl=arg1

*get,_immed,active,,IMMED
/prep7
immed,0     ! turn off immediate display (too slow and we replot anyway!)

*get,_xjunk,active,,keyword,,PR_STRUC
*if,_xjunk,eq,1,then 
   !  structural

   ! transfer displacement constraints
   mttrand,_smkeyl

   ! transfer forces if not modal
   *get,_xjunk,active,,keyword,,MODAL
   *if,_xjunk,eq,0,then 
      mttranf,_smkeyl
   *endif
*else
   !  thermal
   mttranth,_smkeyl
*endif

/prep7
immed,_immed

*if,_DEBUG,gt,0,then
!{
   /gopr
   /com, === leave MTtranBC
!}
*endif

! delete local variables
*del,_xjunk
*del,_smkeyl
*del,_immed
