lang#
- Lines.lang(nl1='', p3='', ang='', phit='', locat='', **kwargs)#
Generates a straight line at an angle with a line.
Mechanical APDL Command: LANG
- Parameters:
- nl1
str Number of the line to be hit (touched by the end of the new line). If negative, assume
P1(see below) is the second keypoint of the line instead of the first. IfNL1= P, graphical picking is enabled and all remaining command fields are ignored (valid only in the GUI).- p3
str Keypoint at which generated line must end.
- ang
str Angle of intersection of generated line
PHIT-P3with tangent to lineP1-P2atPHIT. If 0 (default), the generated line is tangent toNL1toward end P1; if 90, the generated line is perpendicular toNL1. If 180, the generated line is tangent to NL1 toward end P2.ANGcan be any value, but is adjusted to the corresponding acute angle with respect toLOCAT. See LANG_notes for a discussion of accuracy.- phit
str Number to be assigned to keypoint generated at hit location (defaults to lowest available keypoint number ( numstr )).
- locat
str Approximate location of
PHITin terms of the ratio of the distance along the line (NL1) to the length of the line.LOCATcan range from 0 to 1. IfLOCATis blank, the point will be located with less speed and accuracy, and an arbitrary location may result.
- nl1
- Returns:
intLine number of the generated line.
Notes
Generates a straight line (
PHIT-P3) at an angle (ANG) with a lineNL1(P1-P2). The location ofPHITon the line is automatically calculated. LineP1-P2becomesP1-PHITand new linesPHIT-P2andPHIT-P3are generated. Line divisions are set to zero (use lesize, etc. to modify).PHITis positioned closest toLOCATfor the given angle,ANG. To ensure better performance, it is recommended thatLOCATbe input, even if it is 0.The program uses an iterative procedure to position
PHIT. The procedure is not exact, with the result that the actual value ofANGwill sometimes differ slightly from the specified value.Examples
Create a line from a line from (0, 0, 0) to (1, 0, 0) to a keypoint at (1, 1, 1) at an angle of 60 degrees.
>>> k0 = mapdl.k("", 0, 0, 0) >>> k1 = mapdl.k("", 1, 0, 0) >>> lnum = mapdl.l(k0, k1) >>> k2 = mapdl.k("", 1, 1, 0) >>> lnum = mapdl.lang(lnum, k2, 60) >>> lnum 2