Skip to content

Commit 320cb6d

Browse files
germa89clatapie
andauthored
Adding new commands (#2432)
* Adding slashline * Adding /LARC * Adding dscale * adding /type * Adding missing kwargs * Setting navigation with keys to False --------- Co-authored-by: Camille <[email protected]>
1 parent bc762fe commit 320cb6d

File tree

3 files changed

+247
-0
lines changed

3 files changed

+247
-0
lines changed

src/ansys/mapdl/core/_commands/graphics_/annotation.py

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,78 @@ def anum(self, num="", type_="", xhot="", yhot="", **kwargs):
185185
command = f"/ANUM,{num},{type_},{xhot},{yhot}"
186186
return self.run(command, **kwargs)
187187

188+
def slashlarc(self, xcentr="", ycentr="", xlrad="", angle1="", angle2="", **kwargs):
189+
"""Creates annotation arcs (GUI).
190+
191+
APDL Command: /LARC
192+
193+
Parameters
194+
----------
195+
xcentr
196+
Arc X center location (-1.0 < X < 1.0).
197+
198+
ycentr
199+
Arc Y center location (-1.0 < Y < 1.0).
200+
201+
xlrad
202+
Arc radius length.
203+
204+
angle1
205+
Starting angle of arc.
206+
207+
angle2
208+
Ending angle of arc. The arc is drawn counterclockwise from the
209+
starting angle, `angle1`, to the ending angle, `angle2`.
210+
211+
Notes
212+
-----
213+
This command defines annotation arcs to be written directly onto the
214+
display at a specified location. The command is generated by the Graphical
215+
User Interface (GUI) and will appear in the log file (`Jobname.LOG`) if
216+
annotation is used. It is not intended to be typed in directly in a
217+
Mechanical APDL session (although it can be included in an input file
218+
for batch input or for use with the `/INPUT` command).
219+
All arcs are shown on subsequent displays unless the annotation is
220+
turned off or deleted. Issueu `/LSPEC` to set the attributes
221+
of the arc.
222+
223+
This command is valid in any processor.
224+
"""
225+
command = f"/LARC, {xcentr}, {ycentr}, {xlrad}, {angle1}, {angle2}"
226+
return self.run(command, **kwargs)
227+
228+
def slashline(self, x1="", y1="", x2="", y2="", **kwargs):
229+
"""Creates annotation lines (GUI).
230+
231+
APDL Command: /LINE
232+
233+
Parameters
234+
----------
235+
X1
236+
Line X starting location (-1.0 < X < 2.0).
237+
Y1
238+
Line Y starting location (-1.0 < Y < 1.0).
239+
X2
240+
Line X ending location (-1.0 < X < 2.0).
241+
Y2
242+
Line Y ending location (-1.0 < Y < 1.0).
243+
244+
Notes
245+
-----
246+
This command defines annotation lines to be written directly onto the
247+
display at a specified location. The command is generated by the Graphical
248+
User Interface (GUI) and appears in the log file (`Job-name.LOG`) if
249+
annotation is used. It is not intended to be typed in directly in a
250+
Mechanical APDL session (although it can be included in an input file
251+
for batch input or for use with the `/INPUT` command). All lines are
252+
shown on subsequent displays unless the annotation is turned off or
253+
deleted. Issue `/LSPEC` to set the attributes of the line.
254+
255+
This command is valid in any processor.
256+
"""
257+
command = f"/LINE, {x1}, {y1}, {x2}, {y2}"
258+
return self.run(command, **kwargs)
259+
188260
def lspec(self, lcolor="", linstl="", xlnwid="", **kwargs):
189261
"""Specifies annotation line attributes (GUI).
190262

src/ansys/mapdl/core/_commands/graphics_/scaling.py

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,69 @@
11
class Scaling:
2+
def slashdscale(self, wn="", dmult="", **kwargs):
3+
"""Sets the displacement multiplier for displacement displays.
4+
5+
APDL Command: /DSCALE
6+
7+
Parameters
8+
----------
9+
wn
10+
Window number (or ALL) to which command applies (defaults to 1).
11+
12+
dmult
13+
AUTO or 0
14+
Scale displacements automatically so that maximum displacement
15+
(vector amplitude) displays as 5 percent of the maximum model
16+
length, as measured in the global Cartesian X, Y, or Z
17+
directions.
18+
19+
1
20+
Do not scale displacements (that is, scale displacements by 1.0,
21+
true to geometry). Often used with large deflection results.
22+
23+
FACTOR
24+
Scale displacements by numerical value input for `FACTOR`.
25+
26+
OFF
27+
Remove displacement scaling (that is, scale displacements by 0.0,
28+
no distortion).
29+
30+
USER
31+
Set `dmult` to that used for last display (useful when last `dmult`
32+
value was automatically calculated).
33+
34+
Notes
35+
-----
36+
37+
**Command Default**
38+
39+
The default value is AUTO or 0 except when:
40+
41+
* Large deflection effects are included (`NLGEOM,ON`) and it is not a
42+
modal analysis; then the default is 1.
43+
44+
* It is a spectrum analysis (`ANTYPE,SPECTR`); then the default is `OFF`.
45+
46+
* The amplitude of a time-harmonic solution is computed using the `HRCPLX`
47+
command (`OMEGAT ≥ 360°`); then the default is `OFF`.
48+
49+
* The amplitude of a complex modal or harmonic solution is stored into
50+
the database using the `SET` command (`KIMG = AMPL`); then the default
51+
is `OFF`.
52+
53+
If Multi-Plots are not being displayed, and the current device is a 3D
54+
device (`/SHOW,3D`), then the displacement scale in all active windows
55+
will be the same, even if separate `/DSCALE` commands are issued for
56+
each active window. For efficiency, the program maintains a single data
57+
structure (segment) containing only one displacement scale. The program
58+
displays the same segment (displacement scale) in all windows. Only the
59+
view settings will be different in each of the active windows.
60+
61+
This command is valid in any processor.
62+
63+
"""
64+
command = f"/DSCALE, {wn}, {dmult}"
65+
return self.run(command, **kwargs)
66+
267
def iclwid(self, factor="", **kwargs):
368
"""Scales the line width of circuit builder icons.
469

src/ansys/mapdl/core/_commands/graphics_/style.py

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -531,6 +531,116 @@ def shade(self, wn="", type_="", **kwargs):
531531
command = f"/SHADE,{wn},{type_}"
532532
return self.run(command, **kwargs)
533533

534+
def slashtype(self, wn="", type_="", **kwargs):
535+
"""Defines the type of display.
536+
537+
APDL Command: /TYPE
538+
539+
Parameters
540+
----------
541+
wn
542+
Window number (or ALL) to which command applies (defaults to 1).
543+
544+
type_
545+
Display type. Defaults to `ZBUF` for raster mode displays or `BASIC`
546+
for vector mode displays:
547+
548+
BASIC or 0
549+
Basic display (no hidden or section operations).
550+
551+
SECT or 1
552+
Section display (plane view). Use the `/CPLANE` command to
553+
define the cutting plane.
554+
555+
HIDC or 2
556+
Centroid hidden display (based on item centroid sort).
557+
558+
HIDD or 3
559+
Face hidden display (based on face centroid sort).
560+
561+
HIDP or 4
562+
Precise hidden display (like `HIDD` but with more precise checking).
563+
Because all facets are sorted, this mode can be extremely slow,
564+
especially for large models.
565+
566+
CAP or 5
567+
Capped hidden display (same as combined `SECT` and `HIDD` with
568+
model in front of section plane removed).
569+
570+
ZBUF or 6
571+
Z-buffered display (like `HIDD` but using software Z-buffering).
572+
573+
ZCAP or 7
574+
Capped Z-buffered display (same as combined `SECT` and `ZBUF`
575+
with model in front of section plane removed).
576+
577+
ZQSL or 8
578+
`QSLICE` Z-buffered display (same as `SECT` but the edge lines
579+
of the remaining 3D model are shown).
580+
581+
HQSL or 9
582+
`QSLICE` precise hidden display (like `ZQSL` but using precise hidden).
583+
584+
Notes
585+
-----
586+
**Command Default:** `ZBUF` for raster mode displays; `BASIC` for vector
587+
mode displays.
588+
589+
Defines the type of display, such as section display or hidden-line
590+
display. Use the `/DEVICE` command to specify either raster or
591+
vector mode.
592+
593+
The `SECT`, `CAP`, `ZCAP`, `ZQSL`, and `HQSL` options produce section
594+
displays. The section or "cutting" plane is specified on the `/CPLANE `
595+
command as either normal to the viewing vector at the focus point
596+
(default), or as the working plane.
597+
598+
When you use PowerGraphics, the section display options (`Section`,
599+
`Slice`, and `Capped`) use different averaging techniques for the
600+
interior and exterior results. Because of the different averaging
601+
schemes, anomalies may appear at the transition areas. In many cases,
602+
the automatically computed `MIN` and `MAX` values will differ from the
603+
full range of interior values. You can lessen the effect of these
604+
anomalies by issuing` AVRES,,FULL` (Main Menu> General Post Proc>
605+
Options for Outp). This command sets your legend's automatic contour
606+
interval range according to the minimum and maximum results found
607+
throughout the entire model.
608+
609+
With PowerGraphics active (`/GRAPHICS,POWER`), the averaging scheme for
610+
surface data with interior element data included (`AVRES,,FULL`) and
611+
multiple facets per edge (`/EFACET,2` or `/EFACET,4`) will yield
612+
differing minimum and maximum contour values depending on the Z-
613+
Buffering options (`/TYPE,,6` or `/TYPE,,7`). When the Section data is
614+
not included in the averaging schemes (`/TYPE,,7`), the resulting
615+
absolute value for the midside node is significantly smaller.
616+
617+
The `HIDC`, `HIDD`, `HIDP`, `ZBUF`, `ZQSL`, and `HQSL` options produce
618+
displays with "hidden" lines removed. Hidden lines are lines obscured
619+
from view by another element, area, etc. The choice of non-Z-buffered
620+
hidden-line procedure types is available only for raster mode
621+
(`/DEVICE`) displays. For vector mode displays, all non-Z-buffered
622+
"hidden-line" options use the same procedure (which is slightly
623+
different from the raster procedures). Both geometry and postprocessing
624+
displays may be of the hidden- line type. Interior stress contour lines
625+
within solid elements can also be removed as hidden lines, leaving only
626+
the stress contour lines and element outlines on the visible surfaces.
627+
Midside nodes of elements are ignored on postprocessing displays.
628+
Overlapping elements will not be displayed.
629+
630+
The `ZBUF`, `ZCAP`, and `ZQSL` options use a specific hidden-line
631+
technique called software Z-buffering. This technique allows a more
632+
accurate display of overlapping surfaces (common when using Boolean
633+
operations or `/ESHAPE` on element displays), and allows smooth shaded
634+
displays on all interactive graphics displays. Z-buffered displays can
635+
be performed faster than `HIDP` and `CAP` type displays for large
636+
models. See also the `/LIGHT`, `/SHADE`, and `/GFILE` commands for
637+
additional options when Z-buffering is used.
638+
639+
This command is valid in any processor.
640+
"""
641+
command = f"/TYPE,{wn},{type_}"
642+
return self.run(command, **kwargs)
643+
534644
def trlcy(self, lab="", tlevel="", n1="", n2="", ninc="", **kwargs):
535645
"""Specifies the level of translucency.
536646

0 commit comments

Comments
 (0)