*MSG,WARNING
('The MTmeshp macro is obsolete. Use TCL ::euidl::mtmeshp.')
!! arg1 entity type (1-KP, 2-LINE, 3-AREA, 4-VOLU)
!/nopr
!/PMACRO
!*if,_DEBUG,gt,0,then
!!{
!   /gopr
!   /com, === MTmeshp:
!   *vwrite,arg1
!   ('    enttype =',f3.0)
!   *if,_DEBUG,lt,3,then
!   !{
!      /nopr
!   !}
!   *endif
!!}
!*endif
!_err = 0
!! Argument checking
!*IF,ARG1,LT,1,THEN 
!!{
!   _ERR = 1
!   _enttype = -99  
!!}
!*ELSE              
!!{
!   _enttype = arg1
!!}
!*ENDIF             
!*if,_enttype,gt,0,then
!!{
!   !
!   ! Process Keypoints
!   !
!   *IF,_enttype,eq,1,then
!   !{
!      /com,process keypoints
!   !}
!   *ENDIF
!   !
!   ! Process Lines
!   !
!   *IF,_enttype,eq,2,then
!   !{
!      /com,process lines
!   !}
!   *ENDIF
!   !
!   ! Process Areas
!   !
!   *IF,_enttype,eq,3,then
!   !{
!      _cntsel=ARINQR(0,13)
!      *if,_cntsel,eq,0,then
!      !{
!          _err=32
!      !}
!      *ENDIF
!      *if,_err,eq,0,then
!      !{
!         cm,_curset,AREA          ! save current selected set
!         *IF,_cntsel,eq,1,then
!         !{
!            aclear,all
!            amesh,all
!         !}
!         *ELSE
!         !{
!            /UIS,REPLOT,0
!            /GSAV
!            /PLO,INFO,0
!            /GTYPE,,NODE,0
!            /GTYPE,,VOLU,0
!            /GTYPE,,LINE,0
!            /GTYPE,,KEYP,0
!            GPLO
!            Fnc_MT_MeshArea
!            /GRES
!            /UIS,REPLOT,1
!         !}
!         *ENDIF
!         CMSEL,s,_curset
!         CMDEL,_curset
!      !}
!      *endif
!   !}
!   *ENDIF
!   !
!   ! Process Volumes
!   !
!   *IF,_enttype,eq,4,then
!   !{
!      _cntsel=VLINQR(0,13)
!      *if,_cntsel,eq,0,then
!      !{
!         _err=42
!      !}
!      *ENDIF
!      *if,_err,eq,0,then
!      !{
!         cm,_curset,VOLU          ! save current selected set
!         *IF,_cntsel,eq,1,then
!         !{
!            vclear,all
!            vmesh,all
!         !}
!         *ELSE
!         !{
!            /UIS,REPLOT,0
!            /GSAV
!            /PLO,INFO,0
!            /GTYPE,,NODE,0
!            /GTYPE,,AREA,0
!            /GTYPE,,LINE,0
!            /GTYPE,,KEYP,0
!            GPLO
!            Fnc_MT_MeshVolu
!            /GRES
!            /UIS,REPLOT,1
!         !}
!         *ENDIF
!         CMSEL,s,_curset
!         CMDEL,_curset
!      !}
!      *endif
!   !}
!   *ENDIF
!!}
!*ENDIF
!*IF,_enttype,lt,0,then
!!{
!   _ERR=2
!!}
!*ENDIF
!*IF,_enttype,gt,4,then
!!{
!   _ERR=2
!!}
!*ENDIF
!! ERROR STUFF
!*IF,_ERR,EQ,2,THEN
!!{
!   /OUTPUT
!   *MSG,ERROR
!   Valid Arguments for entity type are (1-KP, 2-LINE, 3-AREA, 4-VOLU).
!!}
!*endif
!*IF,_ERR,EQ,3,THEN
!!{
!   /OUTPUT
!   *MSG,ERROR
!   ANOTHER ERROR.
!!}
!*endif
!*del,_enttype
!*del,_cntsel
!*del,_cntent
!*del,_matnum
!*del,_typnum
!*del,_relnum
!*del,_arnum
!*del,_vlnum
!*del,_ERR
!/go
