! *** Magnetic Link Element Command Macro                          mpg
!
! Create Link Element for Multibody Magnetic Analysis
!
! *** Developed by Miklos Gyimesi
!     for magnetic edge element, SOLID117
!
! *** Notice - This file contains ANSYS Confidential information ***
!
! *** Usage
! - Create model with magnetic edge element solid117
! - Create ndlnk1 and ndlnk2 node components
! - Call this macro from /prep7
! - The macro adds a link element
!
/nopr
/com 
/com *** Create Link Element for Multibody Magnetic Analysis
/com
!
*if,arg1,le,1e-3,then
/nopr
/out,scratch
*else
/out
/gopr
*endif
!
cm,_node,node
cm,_elem,elem
!
cmsel,s,ndlnk1
esel,s,ename,,117
nsle,r
!
_nd1=ndnext(0)
!
cmsel,s,ndlnk2
esel,s,ename,,117
nsle,r
!
_nd2=ndnext(0)
!
cmsel,s,_node
cmsel,s,_elem
cmdele,_elem
cmdele,_node
!
!*get,_typ,etyp,,num,max
!*get,_mat,mat,,num,max
!*get,_r,rcon,,num,max
!
et,1153,115,3
mp,murx,1153,1
r,1153
!
type,1153
mat,1153
real,1153
!
e,_nd1,_nd2
!
_nd1=
_nd2=
/out
