The MESHPARTS Add-on contains an extensive library of useful APDL macros for ANSYS Mechanical APDL. The macros can of course also be used in ANSYS Workbench.

Once you have installed the MESHPARS Add-on on your computer, you get instant access to the macros. Most of the macros you are allowed to use without any restriction, even after the license of your MESHPARTS software has expired. A few macros, however, can no longer be used once the license has expired.

A further trustworthy source of useful macros for ANSYS is Sheldon's project.

Below you will find an alphabetical index of our macro library.

picture not available

This macro saves current model as CDB for ABAQUS import module.
The macro takes some changes to the current model prior to saving as cdb file.
Changes are conversions of unsuported elements (MATRIX27 and surface based constraints).
Unsuported elements are converted into elements supported by the ABAQUS import module.
The conversion macros are AD_PILO2CE.MAC and AD_MATRIX2COMBIN.MAC.
All sections will be deleted (not supported by ABAQUS import module).
The saved model is named JOBNAME_4ABAQUS.CDB.

No input arguments needed.

This macro is not encrypted and has an unlimited license term.

This macro drags a line set defined by arg4 along a path defined by a vector [arg1,arg2,arg3].
arg4 can be a number of a line or a lines component name.
If arg4 is undefined or equal null all selected lines will be draged.
Lines to drag must be selected!

Input arguments:
arg1 = x component of direction vector
arg2 = y component of direction vector
arg3 = z component of direction vector

This macro is not encrypted and has an unlimited license term.

This macro sets the angular element size for all selected circle lines.
Important: All predefined line divisions will be overwritten or reset to zero.

Input arguments:
arg1 = angular size in degrees.

This macro is not encrypted and has an unlimited license term.

This macro saves one avi animation from all first arg2 results sets.
AVI file name is the job name.
Last result plot will be used for all animations.

Input arguments:
arg1 = last result set to be animated (defaults to last result set)
arg2 = increment of result set number (defaults to 1)
arg3 = Time delay (seconds) between animation frames (defaults to 0.5 seconds).

This macro is not encrypted and has an unlimited license term.

This macro reverses normals of selected areas, such that the normal always points to the positive z direction.

No input arguments needed.

This macro is not encrypted and has an unlimited license term.

This macro is an alternative to aglue oder aovlap, if the original commands should not work.

No input arguments needed.

This macro is not encrypted and has an unlimited license term.

Computes area normal of area arg1.
Saves the normal vector to global variables NORMX, NORMY, NORMZ.

Input arguments:
arg1 = area number

This macro is not encrypted and has an unlimited license term.

This macro divides selected areas by local coordinate sytem plane.

Input arguments:
arg1 = local csys plane to substract from areas = e.g. 'xy' or 'yx' or 'zx' etc.
arg2 = offset of the local csys plane

This macro is not encrypted and has an unlimited license term.

Select area entities based on their surface area

Input arguments:
arg1 = lower surface bound
arg2 = upper surface bound

This macro is not encrypted and has an unlimited license term.

Creates a rectangle or block geometry oriented by the actual coordinate system
Advantage: Working plane must not be moved or rotated by the user.

Input arguments:
arg1 to arg6 = X1,X2,Y1,Y2,Z1,Z2 corner coordinates of the rectangle or block geometry.

This macro is not encrypted and has an unlimited license term.

Creates a borehole in the first selected volume along the negative Z-axis of the active coordinate system
The active coordinate system must be cartesian. Its origin should be on the surface of selected volume.
The resulting geometry can be meshed with VSWEEP.
Optionally, the dimensions of the prismatic volume can be also specified, in which the borehole will be generated.

Input arguments:
arg1 = bore hole diameter
arg2 = bore hole depth
arg3 = width of prismatic volume where bore hole will be created
arg4 = depth of prismatic volume where bore hole will be created

Calling example for a 8x10 borehole:

ad_bohrung,8e-3,10e-3

Calling example for a 8x10 borehole in a specified volume with 16e-3 (width) x 16e-3 (width) x 15e-3 (deep):

ad_bohrung,8e-3,10e-3,16e-3,15e-3

This macro is not encrypted and has an unlimited license term.

This macro saves the actual FE modell as CDB file with name arg1.cdb
Caution: The workspace parameters will be deleted prior to writing the cdb file!

Input arguments:
arg1 = name of CDB file (input in quotes)

Calling example:
ad_cdwrite,'test'

This macro is not encrypted and has an unlimited license term.

This macro uses the command ceintf in a slightly different way:
Nodes on the interfaces must be input by nodal component names.

Input arguments:
arg1 = component name of nodes from the more dens mesh region
arg2 = component name of nodes from the less dens mesh region
arg3 = tolerance as for ceintf (see ansys help)
arg4,...,arg9 = interface DOF's
ar10 = move tolerance as for ceintf (see ansys help)

This macro is not encrypted and has an unlimited license term.

This macro deletes files with the extentions in the EXT char array.
If the EXT char array is not defined then it will be automatically defined in the following way:
*dim,ext,char,13
ext(1)='bcs'
ext(2)='emat'
ext(3)='esav'
ext(4)='full'
ext(5)='ldhi'
ext(6)='mntr'
ext(7)='mlv'
ext(8)='osav'
ext(9)='pvts'
ext(10)='rdb'
ext(11)='stat'
ext(12)='page'
ext(13)='sda'

Input arguments:
arg1 = job name, defaults to active job name (input in quotes)

Example:
ad_clean,'file'

This macro is not encrypted and has an unlimited license term.

This macro clears the ansys database available in the workspace.

Input arguments:
arg1 = option for preserving parameters (arg1=1: parameters are preserved, arg1=0: parameters are not preserved)
arg2 = optional job name to be set after clearing database. (use quotes)

This macro is not encrypted and has an unlimited license term.

This macro renames all components begining with arg1 in to the union of arg2 and the rest of the initial name.

Input arguments:
arg1 = string prefix of components (input in quotes)
arg2 = string to be prepended (input in quotes)

Example ad_cmmod,'cm1','cm2' will rename the components cm11 cm12 cm13 to cm21 cm22 cm23

This macro is not encrypted and has an unlimited license term.

This macro findes the node nearest to the coordinates arg1,arg2,arg3 (using NNEAR),
Then it defines as nodal component with name arg4 consisting of the found node,
Finaly it inserts a red dot at this node.

Input arguments:
arg1 = x coordinate
arg2 = y coordinate
arg3 = z coordinate
arg4 = name of the node component (enclosed between '')

This macro is not encrypted and has an unlimited license term.

This macro defines the node arg1 as component with name arg2 and inserts a red dot at this node.

Input arguments:
arg1 = node number or nodal component name
arg2 = name of nodal component to be defined

This macro is not encrypted and has an unlimited license term.

This macro writes coordinates of 2 user picked nodes to a file temp.out

Input arguments:
arg1 = number of decimal places.
arg2 = a multiplicator of the length unit, if the units are not meters.

This macro is not encrypted and has an unlimited license term.

This macro calculates for all contact elements with contact state 3 (closed and sticking) the contact pressure and the element surface.
It is therefore assumed that the contact pressure acts uniform on the surface.
All contacts must have the normal pointing in the global Z direction and the contact formulation must be penalty.

No input arguments needed.

This macro is not encrypted and has an unlimited license term.

This macro copies all files in the directory arg1 with the extention arg2 to the directory arg3.

Input arguments:
arg1 = Source File Path
arg2 = Source File Extention
arg3 = Target File Path

Call Macro by: ad_copy,'Source File Path','Source File Extention','Target File Path'
Caution: Paths must Allways end with a back slash!

This macro is not encrypted and has an unlimited license term.

This macro defines a cartesian local coordinate system arg4 by 1, 2 or 3 nodes, defined by arg1, arg2, arg3.
If only one node provided, local system is identical to the nodal system.
If two nodes provided, the origin of the local system will be the first node and local systems x axis will be parallel to the direction defined by the two nodes.
If three nodes provided, the origin of the local system will be the first node and local systems x axis will be parallel to the direction defined by the first two nodes. Local systems z axis will pe normal to the plane defined by the three nodes.

The macros ad_cs and ad_cs2 differ in the way the under-determined case 2 (only two nodes provided) is handled.

Input arguments:
arg1 = first node number
arg2 = second node number (optional)
arg3 = third node number (optional)
arg4 = coordinate system number to be defined

This macro is encrypted and has a limited license term, depending on your type of MESHPARTS license.

This macro defines a cartesian local coordinate system arg4 by up to three nodes defined by arg1, arg2, arg3.
If only one node provided, local system is identical to the nodal system.
If two nodes provided, the origin of the local system will be the first node and local systems x axis will be parallel to the direction defined by the two nodes.
If three nodes provided, the origin of the local system will be the first node and local systems x axis will be parallel to the direction defined by the first two nodes. Local systems z axis will pe normal to the plane defined by the three nodes.

The macros ad_cs and ad_cs2 differ in the way the under-determined case 2 (only two nodes provided) is handled.

Input arguments:
arg1 = first node number
arg2 = second node number (optional)
arg3 = third node number (optional)
arg4 = coordinate system number to be defined

This macro is encrypted and has a limited license term, depending on your type of MESHPARTS license.

This macro defines a local coordinate system arg1 of type arg2 with origin at arg3,arg4,arg5 and z axis colinear to the direction defined by arg6,arg7,arg8.

Input arguments:
arg1 = coordinate system number
arg2 = coordinate system type (see LOCAL command)
arg3, arg4, arg5 = origin coordinates of the coordinate system
arg6, arg7, arg8 = vector defining z direction of coordinate system to be defined

This macro is not encrypted and has an unlimited license term.

This macro defines a local coordinate system with reference number "arg1" on node "arg2" and parallel to the nodal coordinate system of the same node.
The coordinate system type is determined by "arg3".
The coordinate system is::
- Cartesian if arg3=0,
- Cylindrical (circular or elliptical), if arg3=1,
- Spherical (or spheroidal), if arg3=2,
- Toroidal, if arg3=3.

Input arguments:
arg1 = coordinate system number
arg2 = node number
arg3 = coordinate system type (see LOCAL command)

Calling example:
ad_csonnd,arg1,arg2,arg3
ad_csonnd,1001,56,2

This macro is not encrypted and has an unlimited license term.

This macro defines metaelements from selected meshed geometry (lines, areas or volumes).
Metaelements are grouped to elements components named E1, E2, E3, ...
This macro is needed when performing topology optimization with MESHPARTS TOPOAD and the METAELEMENTS option.

Input arguments:
arg1 = 2, 3 or 4.
arg1=2: Use selected lines for metaelements definition
arg1=3: Use selected areas for metaelements definition
arg1=4: Use selected volumes for metaelements definition

This macro is not encrypted and has an unlimited license term.

This macro deletes all files with extensions provided by arg1 to ar18.

Input arguments:
arg1 to ar18 = file extensions

This macro is not encrypted and has an unlimited license term.

This macro deletes all files with no extention in the working directory.
Files with no extension are often temp files defined by ANSYS when a macro from a macro library are executed.
If the macro run is stoped by an error, the temp files remain in the directory.
In the next macro call the temp files are not overwriten and are executed instead.

No input arguments needed.

This macro is not encrypted and has an unlimited license term.

This macro deletes all parameters in workspace inclding hidden parametrs.

No input arguments needed.

This macro is not encrypted and has an unlimited license term.

This macro computes the 3 mean displacements (ux,uy,uz) of selected nodes.
Results are saved to the global parameters MEANUX, MEANUY and MEANUZ respectivelly.

If arg1=1 or arg2=1 or arg3=1, then MEANDISP=MEANUX or MEANDISP=MEANUY or MEANDISP=MEANUZ
If two of arg1, arg2 and arg3 = 1, then the variable MEANDISP is the mean of the two DOF
If all of arg1, arg2 and arg3 = 1, then the variable MEANDISP is the mean of the three DOF

Input arguments:
arg1 = boolean (0 or 1)
arg2 = boolean (0 or 1)
arg3 = boolean (0 or 1)

This macro is not encrypted and has an unlimited license term.

This macro returns the available DOF for node arg1.
The available DOF are marked with a 't' in the dof list, doflist.

Input arguments:
arg1 = node number

This macro is not encrypted and has an unlimited license term.

This macro draws a line beteen Node arg1 and arg2.

Input arguments:
arg1 = first node number
arg2 = second node number
arg3 = color index of the annotation line (e.g. red=12, blue=4, see ansys help on annotations)

Calling example:
ad_drawline,n1,n2,colorindex

This macro is not encrypted and has an unlimited license term.

This macro draws a dashed line beteen two points defined by coordinates arg1,arg2,arg3 and arg4,arg5,arg6.

Input arguments:
arg1 = x coordinate of first point
arg2 = y coordinate of first point
arg3 = z coordinate of first point
arg4 = x coordinate of second point
arg5 = y coordinate of second point
arg6 = z coordinate of second point
arg7 = color index of the annotation line (e.g. red=12, blue=4, see ansys help on annotations)

Calling example:
ad_drawline2,x1,y1,z1,x2,y2,z2,colorindex
ad_drawline2,0,0,0,1,2,3,12

This macro is not encrypted and has an unlimited license term.

This macro defines volumes with kepoints falling on the same nodes as the selected elements.

Caution: algorithm requires much computing resources.

No input arguments needed.

This macro is not encrypted and has an unlimited license term.

This macro computes stiffness matrix and strain energy of plane element arg1 of type plane42.
Stiffness matrix saved to array parameter KE.
Strain energy saved to scalar parameter senee.
Nodal forces are saved to array parameter FE.

Input arguments:
arg1 = element number

This macro is not encrypted and has an unlimited license term.

This macro selects all elements of specified Type (arg1), Material (arg2), Real (arg3) and Section (arg4).

Input arguments:
arg1 = element type number
arg2 = material number
arg3 = real number
arg4 = section number

This macro is not encrypted and has an unlimited license term.

This macro selects elements by element order arg2.

Input arguments:
arg1 = selection key ('s', 'r', 'a', 'u')
arg2 = element order (0, 1, 2, 3)

Example:
ad_eselbyorder,'u',1

This macro is encrypted and has a limited license term, depending on your type of MESHPARTS license.

This macro creates line or shell elements overlayed on the faces of selected line, plane, solid or shell elements
Only the faces with all selected nodes are taken in to acount
This macro is more general then the esurf command, since the esurf command cannot create line elements on the edge of planes or shells
and also not on contact or target elements

No input arguments needed.

This macro is not encrypted and has an unlimited license term.

This macro reflects selected elements along the axis given by arg1 and the active csys.
Optional argument arg2='reflect': Reflect elements instead of copy.
Optional argument arg3: Absolute Tolerance when merging coincident nodes on the reflection plane (see argument TOLER of the NUMMRG command).

Input arguments:
arg1 = axis name ('x', 'y' or 'z')
arg2 = reflection keyword ('reflect')

Calling example:
ad_esym,'x'
ad_esym,'x','reflect'
ad_esym,'x','reflect',1e-6

This macro is not encrypted and has an unlimited license term.

This macro sets the real constants for matrix27 elements.

Input arguments:
arg1 = real constant number
arg2 = translational stiffness/damping in x
arg3 = translational stiffness/damping in y
arg4 = translational stiffness/damping in z
arg5 = rotational stiffness/damping about x
arg6 = rotational stiffness/damping about y
arg7 = rotational stiffness/damping about z

This macro is not encrypted and has an unlimited license term.

This macro applies forces on nodes arg1 (sigle node number, component name or keyword 'all') in arg2 direction ('fx', 'fy', 'fz', 'mx', 'my' or 'mz') and of magnitude arg3 (real) and arg4 (immaginary).
The force is equally distributed to the nodes.

Input arguments:
arg1 = node number or keyword 'all'
arg2 = force direction ('fx', 'fy', 'fz', 'mx', 'my' or 'mz')
arg3 = real part of force
arg4 = imaginary part of force

This macro is not encrypted and has an unlimited license term.

This macro reflects selected elements along the axis given by arg1 and the active csys.

Elements with all nodes lying on the symmetry plane will not be copy-reflected.
Copy-reflecting a model with target pilot nodes (TSHAP,PILO) not lying on the symmetry plane, will result into an error.
Applied zero Displacements will also be reflected.
Special attention must be paid when the model to be reflected contains pretension elements (PRETS179)
In this case, the k node of all predefined pretension elements must lie on the symmetry plane(s).
Otherwise the model would not be symmetrc with respect to the pretension elements.

Input arguments:
arg1 = axis name ('x', 'y' or 'z')
arg2 = reflection keyword ('reflect' or ''). If arg2 is 'reflect' then the model is reflected by moving the elements to the symmetric location.
If arg2 is '' then the model is reflected by copying the elements to the symmetric location.
arg3 = Absolute Tolerance when merging coincident nodes on the reflection plane (see argument TOLER of the NUMMRG command) (optional)
arg4 = 1: Symmetry definition with automatic indexing of available nodal components for MESHPARTS (optional).
arg5 = 1 or 2: Symmetry of already rotated nodal coordinate systems. Symmetry is done by rotating the nodal system (optional)
about first (arg5=1) or second (arg5=2) axis of active coordinate system, excluding the axis given in arg1.
For example, if arg1='y', then arg5=1 means 'x' and arg5=2 means 'z'.

Calling example:
ad_fesym,'x'
ad_fesym,'x','reflect'
ad_fesym,'x','reflect',1e-6
ad_fesym,'x','reflect',1e-6,1
ad_fesym,'x',,1e-6,0,1

This macro is not encrypted and has an unlimited license term.

This macro finds all linear components (groups of interconnected elements) based on predefined nonlinear components.
Nonlinear components are elements components which names end with the sufix _NLIN.
Additionaly all nodal components ending with _MASTER are taken into account.

This macro is used by the module MEHSPARTS SUBSTRUCT.


No input arguments needed.

Output variables:
LINCOMPS = string array of predefined or found linear components

The macro also sets the parameter FINDLINCOMPS_DONE=1
This prevents the macro from accidentally searching again.

This macro is encrypted and has a limited license term, depending on your type of MESHPARTS license.

This macro saves graphical orientation of model to AD_GREST.MAC in the working directory.
Graphical orientation can be restored by executing AD_GREST

No input arguments needed.

This macro is not encrypted and has an unlimited license term.

Write selected keypoints and their coordinates to a file arg1.arg2.
The format is same as for defining keypoints (k,number,x,y,z).

Input arguments:
arg1 = file name
arg2 = file extension

Calling example:
ad_geo2apdl,'test','mac'

This macro is not encrypted and has an unlimited license term.

This macro gets the order of element arg1.

Following convention is used for element order:

0D element types [21 71 166 175 201]
1D element types [1 3 4 7 8 9 10 11 12 14 16 17 18 20 23 24 27 31 32 33 34 36
37 38 39 40 44 52 54 59 60 61 68 94 116 124 125 126 129 131
132 138 139 151 153 156 160 161 165 167 169 171 172 176 177
178 179 180 184 188 189 208 209 214 251 288 290]
2D element types [13 25 28 29 35 41 42 43 47 53 55 57 63 67 75 77 78 79
81 82 83 88 91 93 99 106 108 109 110 111 115 118 121 130 131 132
136 138 141 145 146 150 152 154 157 162 163 170 173 174 181 182 183 192 193
202 203 212 213 223 230 252 272 273 281]
3D element types [5 30 45 46 62 65 69 70 80 87 89 90 92 95 96 97 98 107
117 119 120 122 123 127 128 142 147 148 164
168 185 186 187 190 191 194 195 204 205 215 216 217 226 227 231 232
264 265 285]

Input arguments:
arg1 = element number

Output variables:
ELEMORDER = -1 for Not defined, 0 for Point Elements (0D), 1 for Line Elements (1D), 2 for Area Elements (2D), 3 for Volume Elements (3D)
ELEMSHAPE = element shape function = 0 for Not defined, 1 for Linear Elements, 2 for Quadratic Elements
PROBLEDIM = problem dimmensionality = -1 for Not defined, 1 for Axisimmetric Elements, 2 for 2D Elements, 3 for 3D-Elements)

All tree properties of matrix50 super elements are treated as undefined (-1).

This macro is encrypted and has a limited license term, depending on your type of MESHPARTS license.

This macro saves model dimesion (2D or 3D) to string variable RETURN.

No input arguments needed.

This macro is encrypted and has a limited license term, depending on your type of MESHPARTS license.

This macro computes maximum model size (in length units) based on selected Nodes and/or Keypoints.
The model size is saved to parameter RETURN.
An output information is issued, if arg1=0.

Input arguments:
arg1 = boolean (0 or 1)

Output variables:
RETURN = maximul model size (length units)

This macro is not encrypted and has an unlimited license term.

This macro grounds the selected nodes with 1D elements provided by arg1 till arg4 arguments.

Input arguments:
arg1 = element type
arg2 = material property
arg3 = real constant
arg4 = section number
arg5 = offset of ground nodes in x direction
arg6 = offset of ground nodes in y direction
arg7 = offset of ground nodes in z direction

This macro is not encrypted and has an unlimited license term.

This macro defines a helix using lines.

Input arguments:
arg1 = radius of helix
arg2 = pitch of helix
arg3 = number of windings
arg4 = number of lines pro winding

This macro is encrypted and has a limited license term, depending on your type of MESHPARTS license.

This macro computes force-diplacement from Herz theory and saves the information to array parameters Fvect (force) and hvect (displacement).
The contacting bodies are the most general: two contacting ellipsoids.

Input arguments:

Radii of first ellipsoid:
arg1 = r11
arg2 = r12

Radii of second ellipsoid:
arg3 = r21
arg4 = r22

Young modul of first and second ellipsoid:
arg5 = E1
arg6 = E2

Minor Poisson number of first and second ellipsoid:
arg7 = nu1
arg8 = nu2

Angle between first and second ellipsoid (in degree, *afun,deg):
arg9 = phi

Maximum Force in ar41:
ar10 = Fmax

Number of force/displacement points to compute (96 max):
ar11 = npoints

Pretesion (in length units). The displacement curve will be offset with this value.
This option is usefull when pretension effects should be pre considered.
ar12 = hpret

Calling example:
ad_herz,r11,r12,r21,r22,E1,E2,nu1,nu2,phi,Fmax,npoints,hpret

This macro is encrypted and has a limited license term, depending on your type of MESHPARTS license.

This macro computes the force corresponding to displacement ar10
and the displacement corresponding to force ar11 using the Hertz theory.
The computed force is writen to the global parameter ad_herz_force.
The computed displacement is writen to the global parameter ad_herz_displacement.
The contacting bodies are the most general: two contacting ellipsoids.

Input arguments:

Radii of first ellipsoid:
arg1 = r11
arg2 = r12

Radii of second ellipsoid:
arg3 = r21
arg4 = r22

Young modul of first and second ellipsoid:
arg5 = E1
arg6 = E2

Minor Poisson number of first and second ellipsoid:
arg7 = nu1
arg8 = nu2

Angle between first and second ellipsoid (in degree, *afun,deg):
arg9 = phi

The displacement ar10:
ar10 = u

The force ar11:
ar11 = f


Calling example:
ad_herz,r11,r12,r21,r22,E1,E2,nu1,nu2,phi,u,f

This macro is encrypted and has a limited license term, depending on your type of MESHPARTS license.

This macro saves a high resolution screen shot as png file.

Input arguments:
arg1 = resolution (defaults to 2400)

This macro is not encrypted and has an unlimited license term.

This macro searches for the area MATCHAREA that the point with coordinates arg1, arg2, arg3 contains.
If an area is found, it sets a hardpoint arg4 at coordinates arg1, arg2, arg3.
If no area is found, a keypoint is defined arg4 at coordinates arg1, arg2, arg3.

Input arguments:
arg1, arg2, arg3 = x, y, z coordinate of point on area
arg4 = hardpoint number to be defined on area

Caution: The surfaces must have no holes!
Caution: The areas must not be curved!

This macro is encrypted and has a limited license term, depending on your type of MESHPARTS license.

This macro searches a line at the given coordinates (arg1,arg2,arg3).
If a line is found, it sets a hardpoint arg4 at coordinates arg1, arg2, arg3.
If no line is found, a keypoint is defined arg4 at coordinates arg1, arg2, arg3.

Input arguments:
arg1, arg2, arg3 = x, y, z coordinate of point on line
arg4 = hardpoint number to be defined on line

Calling example:
ad_hptline,x0,y0,z0,hpt_nr

This macro is encrypted and has a limited license term, depending on your type of MESHPARTS license.

This macro writes initial location coordinates of selected nodes to file arg1.dat.

Input arguments:
arg1 = file name (input in quotes)

This macro is not encrypted and has an unlimited license term.

This macro connects one arg1 Node with other Slave nodes with line elements or ce's

Input arguments:
arg1 = Master Component Name oder Node Number
arg2 = Slave Component name
arg3 = Connection Method (1: CE's, 2: Line Elements, 3: RBE3, 4: MPC Contact Force, 5: MPC Contact Rigid)
arg4 = Element Type to connect with
arg5 = Real Constant for Connection Elements (just for arg3=2)
arg6 = Real Constant for Connection Elements (just for arg3=2)
arg7 = Section Number for Connection Elements (just for arg3=2)
arg8 = slave DOF (see help on cerig)

This macro is encrypted and has a limited license term, depending on your type of MESHPARTS license.

This macro defines a nodal component for each arg2 to ar19 (node numbers, nodal components, 'all')
Usefull to define more interface nodes for MESHPARTS
The component name will be a strig composed of arg1 and the argument position of argi minus 1
If the first component argument (arg2) represets a single node without attached elements (pilot node), then the interface component name gets the index 0.

Input arguments:
arg1 = string for the name all nodal components to be defined
arg2...arg19 = node numbers, nodal components or keyword 'all'

This macro is encrypted and has a limited license term, depending on your type of MESHPARTS license.

This macro Draws an arrow at the location of node arg1 in direction of DOF arg2.

ad_ioannot,node,dof,io

Input arguments:
arg1 = Input or Output node number
arg2 = DOF of the Input or Output Node ('ux' 'uy' 'uz' 'rx' 'ry' 'rz')
arg3 = Type of Node (Input='i' or Output='o')
arg4 = Type of coordinate System (arg4=0 for global, arg4=1 for nodal, arg4=2 for local)
arg5 = Number of the local coordinate System (if arg4=2)

This macro is not encrypted and has an unlimited license term.

This macro plots all selected volumes in a loop with 1 second pause inbetween.

No input arguments needed.

This macro is not encrypted and has an unlimited license term.

This macro orients lines, so that they have the same projected direction
The projected direction is given by the argument arg1 = 1 (x), 2 (y) or 3 (z)
The lines must have same orientation when meshed with non symmetric beam elements

Input arguments:
arg1, arg2, arg3 = x, y, z coordinates of direction vector

Caution: The algorithm do not allways founds the wright direction of the lines!

This macro is not encrypted and has an unlimited license term.

This macro inserts a Red Dot at Node arg1.
This ist very helpfull when you search for a specific node in the model.

Input arguments:
arg1 = node number

This macro is not encrypted and has an unlimited license term.

This macro inserts a Red Dot at each node of the nodal component arg1.

Input arguments:
arg1 = name of nodal component (input in quotes)

This macro is not encrypted and has an unlimited license term.

This macro inserts a Red Dot at each node of the nodal component arg1.
You can also provide the keyword "all" to mark all selected nodes.

Input arguments:
arg1 = name of nodal component (input in quotes) or keyword 'all'

This macro is not encrypted and has an unlimited license term.

This macro distributes elements evenly with a single node (Mass21) on the selected nodes
The mass element types must be predefined and activated with TYPE command.

Input arguments:
arg1 = number of mass elements

This macro is not encrypted and has an unlimited license term.

This macro defines elements with a single node (Mass21) on each of the selected nodes.
The mass element types must be predefined and activeated with TYPE command.

No input arguments needed.

This macro is not encrypted and has an unlimited license term.

This macro performes inertia relief solution.
Computed mass is saved to variable TOTMASS.

No input arguments needed.

This macro is not encrypted and has an unlimited license term.

This macro converts elasticity modulus in beam section, which is assigned to the selected beam elements.

Input arguments:
arg1 = elasticity modulus corresponding to beam diameter arg2.
arg2 = beam diameter corresponding to elasticity modulus arg1.

This macro is not encrypted and has an unlimited license term.

This macro converts elasticity modulus in plate thickness, which is assigned to the selected shell elements.
The shell thickness is calculated for each FE node individually.

Input arguments:
arg1 = elasticity modulus corresponding to sheet thickness arg2
arg2 = sheet thickness corresponding to elasticity modulus arg1

This macro is not encrypted and has an unlimited license term.

This macro replaces all MATRIX27 with COMBIN14 elements.
The main reason for this macro is, that most FE format conversion software do not support MATRIX27 elements.

Assumption: Real constant for MATRIX27 element was defined using AD_ET27_R.MAC.

No input arguments needed.

This macro is encrypted and has a limited license term, depending on your type of MESHPARTS license.

This macro gets the maximum element order on selected nodes.
Element order is saved into the output parameter MAXELEMORDER,
which is -1 for Not defined, 0 for Point Elements (0D), 1 for Line Elements (1D), 2 for Area Elements (2D), 3 for Volume Elements (3D).
The macro also outputs the parameter MAXELEMSHAPE describing the element shape,
which is 0 for Not defined, 1 for Linear Elements, 2 for Quadratic Elements.

Input arguments:
arg1 = consider only selected elements if arg2=1
arg2 = create output if arg3=0

Output variables:
MAXELEMORDER = maximum element order on node arg1
MAXELEMSHAPE = element shape coresponding to maxelemorder

Calling example:
ad_maxelemorder,nodenumber

This macro is encrypted and has a limited license term, depending on your type of MESHPARTS license.

This macro computes the material damping corresponding to damping ratio arg1, frequency arg2 and Young modulus arg3
computed damping coefficient is saved to the global variable RETURN

Input arguments:
arg1 = damping ratio
arg2 = frequency in Hz
arg3 = Young Modul of Material to be damped

This macro is not encrypted and has an unlimited license term.

This macro calculates for all contact elements with contact state 3 (closed and sticking)
the contact pressure and the element surface.
It is therefore assumed that the contact pressure acts uniform on the surface.
All contacts must have the normal pointing in the global Z direction and the contact formulation must be penalty.

No input arguments needed.

This macro is encrypted and has a limited license term, depending on your type of MESHPARTS license.

This macro merges nodes of source component arg1 with target nodes of component arg2.

The number of source nodes do not have to be equal with the number of target nodes.
The locations of source nodes do not have to match the locations of target nodes.

The algorithm then tries to merge source with target nodes by moving (if necessary) source nodes,
so that they are coincident with nearest target nodes

Generally source sodes should belong to elements with maximum 2 nodes,
in order to avoid bad shaped elements as a result of nodes moving.

Due to ANSYS limitations, nodes belonging to super elements are not merged by NUMMRG the command.
Nevertheless in This macro target nodes ARE allowed on super elements.
In that case node merging is performed by changing node connectivity of source elements using EMODIF command.

The number of merged nodes is returned to the variable RETURN

Input arguments:
arg1=component name of source nodes, e.g. 'sourcenodes'
arg2=component name of target nodes, e.g. 'targetnodes'
arg3=1 or 0. If arg3=1, supress output.

This macro is not encrypted and has an unlimited license term.

This macro sets meshing options.

Input arguments:
arg1 = 'free' or 'mapped' or 'mixed'
arg2 = 'mixed' or 'quad' or 'tri'

This macro is not encrypted and has an unlimited license term.

This macro save one avi animation for each of the first arg2 results sets.
AVI files names are composed by concatenating arg1 string with the result set number.
Last result plot will be used for all animations.

Input arguments:
arg1 = prefix of avi file names (defaults to job name)
arg2 = last result set to be animated (defaults to last result set)
arg3 = number of frames to be used for each animtion (defaults to 10)
arg4 = time delay (seconds) between animation frames (defaults to 0.5)

This macro is not encrypted and has an unlimited license term.

dmprat,0.05
/XRANGE,.01,1
This macro defines a multi-mass oscillator and computes eigenmodes and frequency response.

Input arguments:
arg1 = number of point masses
arg2 = number of mass point where input force will act.
arg3 = number of mass point where first output will be measured.
arg4 = number of mass point where second output will be measured.

This macro is not encrypted and has an unlimited license term.

This macro defines a node at the origin of the coordinate system with reference number "arg1", where the nodal coordinate system matches in orientation the local coordinate system.
The node number can be optionaly given by arg2. If arg2 is empty or zero it will be automaticaly determined.
Optionaly a nodal set name can also be assigned to the node.

Input arguments:
arg1 = coordinate system number (see LOCAL command)
arg2 = node number (optional)
arg3 = nodal set name to be assigned to node (optional, see CM command)

Calling example:
ad_ndoncs,arg1,arg2,arg3
ad_ndoncs,1001,,'mynode'

This macro is not encrypted and has an unlimited license term.

This macro refines selected hexahedral elements at selected nodes.
Only for linear, hexahedral elements (SOLID185).
Surface nodes must be defined prior to calling This macro (nodal set SURFNODES).
After refinement SURFNODES is updated.

When refinement is done in multiple steps, only refine refined elements with all 8 nodes active.
In other words, do not refine elements from the border of refined area.

Input arguments:
arg1 = tolerance for nummrg

This macro is encrypted and has a limited license term, depending on your type of MESHPARTS license.

This macro selects symetric nodes.
Symmetry defined in the active coordinate system

Calling example: ad_nselsym,'RAILR_RUNNER_1',1,1e-6

Input arguments:
arg1 = 'name_of_nodal_component'
arg2 = 1: x symmetry
arg2 = 2: y symmetry
arg2 = 3: z symmetry
arg3 = symmetry tolerance

This macro is not encrypted and has an unlimited license term.

This macro reflects selected nodes along the axis given by arg1 and the active coordinate system.
Optional argument arg2='reflect': Reflect nodes instead of copy

Input arguments:
Calling Examples:
ad_nsym,'x'
ad_nsym,'x','reflect'

This macro is not encrypted and has an unlimited license term.

This macro is primary needed for the ad_toolbar
Turns on/off the numbering for entities expressed by arg1

Input arguments:
arg1 = 'node', 'elem', 'sec', 'type', 'mat', 'real', 'kp', 'line', 'area', 'volu' or 'defa'

This macro is not encrypted and has an unlimited license term.

This macro defines general purpose parameters.

No input arguments needed.

This macro is not encrypted and has an unlimited license term.

This macro is primary needed for the ad_toolbar.
Plots/Hide boundary conditions symbols expressed by arg1

Input arguments:
arg1 = 'u', 'rot', 'cp', 'ce', 'f' or 'all'

This macro is not encrypted and has an unlimited license term.

This macro is needed if you want to import models from ANSYS into ABAQUS.
This macro replaces all surface based constraints (target elements with TSHAPE PILO) with RBE3 or CERIG constraints.
The main reason for this macro is, that ABAQUS do not support surface based constraints.
If arg1=1, then surface based constraints are deleted but no new constraints equations are generated.
This option is usefull, if constraints equations are defined manually in ABAQUS.

Caution: The macro does not take keyoption 4 of target elements into account!

Input arguments:
arg1 = option for Constraint Equation generation (arg1=1 if CE are not generated)

This macro is encrypted and has a limited license term, depending on your type of MESHPARTS license.

This macro creates in the active coordinate system a pipe with rectangular section (arg1 x arg2) and legth by arg3.
The pipe will have wall thickness arg4.
The corners of the rectangular section can be rounded with radius arg5.

One end of the pipe is centred in the active coordinate at [arg6,arg7,arg8] system and oriented with [arg9,ar10,ar11]

Input arguments:
arg1 = width of pipe
arg2 = depth of pipe
arg3 = length of pipe
arg4 = wall thickness of pipe
arg5 = fillet radius

This macro is encrypted and has a limited license term, depending on your type of MESHPARTS license.

This macro creates in the active coordinate system a pipe
with rectangular section (arg1 x arg2) and legth by arg3
The pipe will have wall thickness arg4
The corners of the rectangular section can be rounded with radius arg5

One end of the pipe is centred in the active coordinate system at [0,0,0] and other end at [0,0,arg3]

Input arguments:
arg1 = width of pipe
arg2 = depth of pipe
arg3 = length of pipe
arg4 = wall thickness of pipe
arg5 = fillet radius

This macro is encrypted and has a limited license term, depending on your type of MESHPARTS license.

Compute the runtime of macro 'macro_name'.

Input arguments:
arg1 = 'macro_name'
arg2 to ar18 = macro parameters of 'macro_name'

Calling example:
ad_runtime,'macroname',macroparameters

This macro is not encrypted and has an unlimited license term.

This macro saves a picture of the displayed model to a png file.

Input arguments:
arg1 = name of png file (optional, defaults to job name)

Calling examples:

ad_savepict,'mymodel'
ad_savepict,''
ad_savepict

This macro is not encrypted and has an unlimited license term.

This macro searches, if component name arg1 of type arg2 exists or not.
If found, output parameter RETURN and T is set to 1.
If not found, output parameter RETURN and T is set to 0.

If arg2=1: search for nodes component
If arg2=2: search for elements component
If arg2=6: search for keypoints component
If arg2=7: search for lines component
If arg2=8: search for areas component
If arg2=9: search for volumes component
If arg2=11-15: search for subcomponents (11: subcomponent at level 1 12: subcomponent at level 2 etc.).

Input arguments:
arg1 = component name as string (input in quotes)
arg2 = key for type of component to be searched

Output variables:
RETURN = boolean (0 or 1)

This macro is encrypted and has a limited license term, depending on your type of MESHPARTS license.

This macro searches if a specified file arg1 with extension arg2 exists.
If found, variable return is set to 1
If not found, variable return is set to 0

Input arguments:
arg1 = File name (optionaly inclding path) between quotes
arg2 = File extension between quotes

This macro is encrypted and has a limited license term, depending on your type of MESHPARTS license.

This macro generates a rectangular area of (arg1 x arg2) with rounded corners of radius arg3,
centerd about Working Plane origin.

Input arguments:
arg1, arg2 = dimensions of the rectangular section
arg3 = fillet radius

This macro is encrypted and has a limited license term, depending on your type of MESHPARTS license.

This macro is primary needed for the ad_toolbar

If arg1='next' => read next load step and replot last display
If arg1='prev' => read previous load step and replot last display
If arg1='usum' => plot nodal solution usum

Input arguments:
arg1 = keyword ('next', 'prev' or 'usum')
arg2 = deformation scale (see command /DSCALE)

This macro is not encrypted and has an unlimited license term.

This macro sets active element type (arg1), material number (arg2), real number (arg3), section number (arg4), system number (arg5)

Input arguments:
arg1 = element type number
arg2 = material number
arg3 = real number
arg4 = section number
arg5 = element system number

This macro is not encrypted and has an unlimited license term.

This macro sets Multi-Window properties.

Input arguments:
arg1 = Number of windows to display (1,2,3 or 4)
arg2 = Layout of multi windows ('LR'=Left-Right, 'TB'=Top-Bottom)

This macro is not encrypted and has an unlimited license term.

This macro cumputes strain energy for selected shell elements
Strain energy is divided in membrane (parameter SENESUM_M) and bending (parameter SENESUM_B) energy.

No input arguments needed.

This macro is encrypted and has a limited license term, depending on your type of MESHPARTS license.

This macro replaces all MATRIX27 with COMBIN14 elements.
The main reason for this macro is, that most FE format conversion software do not support MATRIX27 elements.

Assumption: Real constant for MATRIX27 element was defined using AD_ET27_R.MAC.

No input arguments needed.

This macro is encrypted and has a limited license term, depending on your type of MESHPARTS license.

This macro start a static or modal solution.
Solution output is written to jobname_soluinfo.out
Solution time (variable wl_solve) and Total mass (variable totmass) is also written at the end of the output file.

If arg1='static' arg4 is the number of first load case.
If arg1='modal' arg4 is the number of eigenfrequencies to compute.
If arg1='static' arg3 is the number of last load case.
If arg1='modal' arg3 is the lower frequency boundary.
If arg1='static' arg4 is the increment of load case.
If arg1='modal' arg4 is the upper frequency boundary.

If arg5='all' => Element solution is calculated for all elements
If arg5='component_name' => Element solution is calculated for the elements in component 'component_name'

Input arguments:
arg1 = type of analysis ('static' or 'modal')
arg2 to arg4 = options when solving for more load cases (see command LSSOLVE)
arg5 = option for element solution.

Calling example for static solve:
ad_solve,'static',,,,'all'

Calling example for modal solve:
ad_solve2,'modal',100

This macro is not encrypted and has an unlimited license term.

This macro is used after topology optimization of plates with TopoAD.
Converts density in thickness.
Works only after topology optimization with TopoAD or if
the vectors ELEMVECT (item number) and
DENSVECT (relative density for each element in elemvect) are available.

Input arguments:
arg1: number of different equaly distributed sheet thicknesses.

This macro is not encrypted and has an unlimited license term.

This macro is an extension and improvement of the Ansys command "transfer".
Before Transfering nodal coordinate systems are checked and, if necessary, rotated.
Element coordinate systems are also rotated.
This capability is usefull, when the model contains elements, who work on the nodal CSYS.
Local coordinate Systems of pretension sections or MPC184-Joints are also rotatated/translated.
IMPORTANT: Each different section number must have an unique local system asigned to it.

Caution: Please make sure, that MASS21 elements have keyoption(2)=1 set!

Input arguments:
arg1, ..., arg5 = same as for the ansys command "transfer". String arguments must be included in Quotes ('arg')

Calling example:
AD_TRANSFER,KCNTO,INC,NODE1,NODE2,NINC

This macro is encrypted and has a limited license term, depending on your type of MESHPARTS license.

This macro unmerges source nodes arg1 if they are a subgroup of target nodes arg2
The source nodes must belong only to source elements arg3, not to target elements arg4

Input arguments:
arg1 = source elements (component name in quotes)
arg2 = target elements (component name in quotes)
arg3 = source nodes (component name in quotes)
arg4 = target nodes (component name in quotes)

Calling example:
ad_unmrgnodes,'nset1','nset2','eset1','eset2'

This macro is encrypted and has a limited license term, depending on your type of MESHPARTS license.

This macro writes n complex variables (given by integers arg1 till arg'n') to a file with name given by last but two argument and extension .dat.
The KCPLX value for VGET can be optionally input by the last but one argument. If last but one argument equals 2, both real and imaginary parts are writen.
The number of result steps can be optionally input by the last argument. Otherwise, the number of steps is automatically determined.

Input arguments:
arg1 to arg'n' = numbers of /post26 variables
arg'n+1' = file name (input in quotes)
arg'n+2' = option for writing real (0) or imaginary (1) data or both (2)
arg'n+3' = number of result steps to be writen

Caution: Only works if /post1 was active before calling the macro or going to /post26!

Calling examples:

/post26
RFORCE,2,2,F,Y,FY_2
RFORCE,3,2,M,Z,MZ_2

Write real part of variables 2 and 3 to time_force_moment.dat
ad_varwrite,2,3,'time_real'

Write immaginary part of variables 2 and 3 to time_force_moment.dat
ad_varwrite,2,3,'time_imag',1

Write real and imaginary parts of variables 2 and 3 to time_force_moment.dat
ad_varwrite,2,3,'time_real_imag',2

Write real and imaginary parts of variables 2 and 3 to time_force_moment.dat. Take first 200 steps.
ad_varwrite,2,3,'time_real_imag',2,200

This macro is encrypted and has a limited license term, depending on your type of MESHPARTS license.

This macro divides selected volumes by local coordinate sytem plane.

Input arguments:
arg1 = local csys plane to substract from volumes = e.g. 'xy' or 'yx' or 'zx' etc.
arg2 = offset of the local csys plane

This macro is not encrypted and has an unlimited license term.

This macro selects volume entities based on their volume.

Input arguments:
arg1 = lower volume bound
arg2 = upper volume bound

This macro is not encrypted and has an unlimited license term.

This macro removes alls contact and target elements associated with an external node defined in Ansys WB.
The macro must be called only from an command object related to the external node in Ansys WB.
The argument arg1 is a string placed between '', that describes the name of the nodal component that should be assigned to the external node.

This macro is not encrypted and has an unlimited license term.

This macro writes coordinates info about 2 user picked nodes to a file temp.out
Coordinates in active Coordinate System
Projected Distance about the three Axes of active Coordinate System
Coordinates of the middle point of [ar21,ar22] in active Coordinate System
Absolute Distance of Keypoints

Input arguments:
arg1 = number of decimal places
arg2 = a multiplicator of the length unit, it length unit is not meter.
arg3 = a keyword for appending the output to the file or not ('append' or empty)

This macro is not encrypted and has an unlimited license term.

This macro writes coordinates info about 2 user picked nodes to a file temp.out

Data written:
- Coordinates in active Coordinate System
- Projected Distance about the three Axes of active Coordinate System
- Coordinates of the middle point of [ar21,ar22] in active Coordinate System
- Absolute Distance of Nodes

Input arguments:
arg1 = number of decimal places
arg2 = a multiplicator of the length unit, it length unit is not meter.
arg3 = a keyword for appending the output to the file or not ('append' or empty)

This macro is not encrypted and has an unlimited license term.

This macro writes the displacements of selected nodes to a file named arg1_uxyz.dat and the node locations to a file named arg1_nxyz.dat.

Input arguments:
arg1 = file prefix name (input in quotes)

This macro is not encrypted and has an unlimited license term.

This macro writes coordinates of user picked nodes to a file temp.out

Input arguments:
arg1 = number of decimal places
arg2 = a multiplicator of the length unit, it length unit is not meter.
arg3 = a keyword for appending the output to the file or not ('append' or empty)

This macro is not encrypted and has an unlimited license term.

This macro writes coordinates of user picked nodes to a file temp.out

Input arguments:
arg1 = number of decimal places
arg2 = a multiplicator of the length unit, it length unit is not meter.
arg3 = a keyword for appending the output to the file or not ('append' or empty)

This macro is not encrypted and has an unlimited license term.

This macro defines an uncoupled Bandstop Transfer Element for use with the MESHAPRTS CT (Control Toolbox).
Bandstop transfer function: G(s)=(a_1*s^2+a_2*s+a_3)/(b_1*s^2+b_2*s+b_3)

Input arguments:
arg1 = First Node Number (NA)
arg2 = Second Node Number (NB)
arg3 = SPEED_FILTER_BW_NUM
arg4 = SPEED_FILTER_SUPPR_FREQ
arg5 = SPEED_FILTER_BS_FREQ
arg6 = SPEED_FILTER_BANDWIDTH
arg7 = System

This macro is encrypted and has a limited license term, depending on your type of MESHPARTS license.

This macro defines an uncoupled Delay Transfer Element for use with the MESHAPRTS CT (Control Toolbox).
The delay transfer function is modeled with the help of Pade Approximation (which offers the best linearisation method known).

Input arguments:
arg1 = First Node Number (NA)
arg2 = Second Node Number (NB)
arg3 = Delay constant
arg4 = System

This macro is encrypted and has a limited license term, depending on your type of MESHPARTS license.

About us

Our passion is to fully exploit the potential of your machines and your products through the use of specialized software and services. Read more

Contact us

We want to understand your product-related issues and problems, so that we can develop new solutions.