forked from bguest/ansys-macros
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMADD.mac
38 lines (34 loc) · 1.11 KB
/
CMADD.mac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
!&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
! CMADD.mac
! B.Guest - BenGuest@gmail.com
! DESCRIPTION: This macro adds things (volumes, areas,
! lines, keypoints, elements or nodes) to a component
! group.
! PRECONDTIONS:
! ARG1 = component type
! 'volu' --> volumes, 'area' --> Areas,
! 'line' --> lines, 'kp' --> Keypoints,
! 'elem' --> elements , 'node' --> nodes
! ARG2 = component name (must be a string)
! ARG3-ARG5: first, last and incrment of things
! ARG3 < 0 --> All currently selected things are added
!======================================================
compType = ARG1
compLetter = STRSUB(compType,1,1)
compName = ARG2
cm,tmp%compType%,compType !Save original state
!Select Things
*if,arg3,ge,0,then
%compLetter%sel,s,,,ARG3,ARG4,ARG5 !Select Things
*endif
!Add to component if it exists
*if,flag%compName%,ne,1,then
flag%compName% = 1
*else
cmsel,a,compName
*endif
cm,compName,compType
cmsel,s,tmp%compType% !Resume original State
cmdele,tmp%compType% !Delete temp component
!======THE--END========THE--END========THE--END========
!ITS THE END OF THE FILE AS WE KNOW IT, AND I FEEL FINE