Hottomson 发表于 2008-6-4 10:28

在一个图中显示多条曲线并导出(宏命令方式)

LinePlot2D是maxwell 2d 11和maxwell 3d 10及对应以前版本后处理宏中的一个函数,LinePlot2D可以实现同一直线上不同的量共同显示,关键是最后一个参数,以下是文档中的介绍:
Creates a 2D line plot from the contents of the top two registers of the
stack. The top of the stack must be a line geometry followed by a scalar
quantity.

Command: Plot/Field, Field Calculator

Syntax: lineplot “Plot name” COLOR WIDTH MARKER_STYLE
LINE_STYLE DRAW_MARKER? DRAW_LINE? NEW_WINDOW?

Note: color: Select a value between 0 and 255.
width: The higher the number the thicker the line.
marker_style: Select from the following types.
Type Marker
0 no marker
6 Triangle
1 .
7 Circle
2x
8 Solid Square
3 +
9 Solid Diamond
4 Square
10 Solid Triangle
5 Diamond
11 Solid Circle
line_style: Select from the following types.
Style Line Form
1 Solid line.
2 Dashed line.
3 Dotted line.
4 Dash-dot line.
5 Dash-dot-dot line.
draw_marker?: 0=No Markers, 1=Draw Markers
draw_line?: 0=No lines, 1=Draw lines
new_window?: 0=Add to current window, 1=New window
————————————————————————————
第一次输出图形最后一个参数为1,后面输出图形最后一个参数为0就可以实现在一个输出图形中包含多条曲线,此时再用Save2DPlot就可以将所有图形中的曲线数据保存在一个文件中了。

如果是统计每一步的某个点计算结果,可以采用如下的方法:
指定,后处理宏,内容如下:
DefinePoint "ptProbe"
Enter "B"
Scalar_Z
EnterPoint "ptProbe"
Value
Evaluate
Assign ptProbeBz GetTopEntryValue
Assign sFileName "..\ProbeZ.txt"
FileWrite sFileName "a" "$$, " {ptProbeBz}
DeletePoint "ptProbe"
分析完成后将在*.pjt目录中看到一个ProbeZ.txt文件,里面是以','(逗号,你可以指定别的)隔开的每一步结果,后面你可以将结果导入excel,matlab等都可以。

wuhdli 发表于 2008-8-22 16:20

谢谢斑竹!:victory: :victory:

yutianda2010 发表于 2009-12-29 21:48

版主你好:
我刚接触宏命令不久,现想在Maxwell 2D中利用宏命令来求每个时间步 气隙圆周的径向气隙磁密,下面是我的宏命令:
# Version 1
CircleCreate 2 41 "circle2" 1 360
ShowCalc
Enter "B"
EnterLine "circle2"
NormalComponent
Undo
LinePlot2D "Graph1" 8 2 3 1 0 1 1
Save2DPlot "b.dat"
现在存在的问题是,宏命令每执行一次就会把上一次的结果“b.dat”覆盖掉,最后只剩下最后一个时刻的结果。我实在是想不到什么办法可以解决,希望版主能不吝赐教。谢谢!

yutianda2010 发表于 2009-12-29 21:51

版主你好:
我刚接触宏命令不久,现想在Maxwell 2D中利用宏命令来求每个时间步 气隙圆周的径向气隙磁密,下面是我的宏命令:
# Version 1
CircleCreate 2 41 "circle2" 1 360
ShowCalc
Enter "B"
EnterLine "circle2"
NormalComponent
Undo
LinePlot2D "Graph1" 8 2 3 1 0 1 1
Save2DPlot "b.dat"
现在存在的问题是,宏命令每执行一次就会把上一次的结果“b.dat”覆盖掉,最后只剩下最后一个时刻的结果。我实在是想不到什么办法可以解决,希望版主能不吝赐教。谢谢!

zgwaiting 发表于 2010-4-1 16:47

新手 学习~~~~~~

simbol 发表于 2010-4-1 19:17

想学可惜看不懂,谁能分享有关宏的资料就好了

kevine250 发表于 2010-4-2 16:41

現在感覺很流行
也是很想學但真
很複雜
页: [1]
查看完整版本: 在一个图中显示多条曲线并导出(宏命令方式)