⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 create-plane.grs

📁 UG二次开发很好的东西 需要的朋友可以下载来看看 很好用啊
💻 GRS
字号:
$$
$$    子程序create-plane,用于镜像平面的确定。
$$    输入参数:无。
$$    输出参数:judge、operate、pl。
$$    输入文件:无。
$$    输出文件:无。
$$


$$实体变量申明。
proc/judge,operate,pl
entity/pl,pl1,pt(3),cur,ln(2)

$$选择镜像平面生成方式,含义如前所述。
l10:
judge=0
operate=0
choose/'Choose plane method','Existing Plane','three points',$
       'Arc or Conic','Two Line','Point,Perpendicular Curve',$
       'Parallel Plane through Point','Perpendicular Plane through Line',$
       'Principal Planes',resp
jump/l10:,trm:,,,l20:,l30:,l70:,l90:,l120:,l150:,l180:,l210:,resp

$$选择存在的一个平面作为镜像平面。
l20:
operate=1
ident/'Select plane',pl,resp
jump/l10:,trm:,retu:,resp

$$选择三个点生成镜像平面。
l30:
gpos/'Point 1',x1,y1,z1,resp
jump/l10:,trm:,,resp
l40:
gpos/'Point 2',x2,y2,z2,resp
jump/l30:,trm:,,resp
l50:
gpos/'Point 3',x3,y3,z3,resp
jump/l40:,trm:,,resp
l60:
pt(1)=point/x1,y1,z1
blank/pt(1)
pt(2)=point/x2,y2,z2
blank/pt(2)
pt(3)=point/x3,y3,z3
blank/pt(3)
pl=plane/pt
delete/pt(1..3)
jump/retu:

$$选择圆弧或二次曲线生成镜像平面。
l70:
ident/'Select curve',cur,resp
jump/l10:,trm:,,resp
l80:
pl=plane/cur
jump/retu:

$$选择两条直线生成镜像平面。
l90:
ident/'Select line 1',ln(1),resp
jump/l10:,trm:,,resp
l100:
ident/'Select line 2',ln(2),resp
jump/l90:,trm:,,resp
l110:
pl=plane/ln(1),ln(2)
jump/retu:

$$过点且垂直于曲线生成镜像平面。
l120:
ident/'Select curve',cur,resp
jump/l10:,trm:,,resp
l130:
gpos/'Select point',x,y,z,resp
jump/l120:,trm:,,resp
l140:
pt(1)=point/x,y,z
pl=plane/perpto,cur,thru,pt(1)
delete/pt(1)
jump/retu:

$$过点且平行于某平面生成镜像平。
l150:
ident/'Select plane',pl1,resp
jump/l10:,trm:,,resp
l160:
gpos/'Select point',x,y,z,resp
jump/l150:,trm:,,resp
l170:
pt(1)=point/x,y,z
pl=plane/parlel,pl1,thru,pt(1)
delete/pt(1)
jump/retu:

$$过直线且垂直于某平面生成镜像平面。
l180:
ident/'Select plane',pl1,resp
jump/l10:,trm:,,resp
l190:
ident/'Select line',ln(1),resp
jump/l180:,trm:,,resp
l200:
pl=plane/perpto,pl1,thru,ln(1)
jump/retu:

$$基准平面。
l210:
param/'Enter distance','Distance',dis,resp
jump/l10:,trm:,,resp
l220:
choose/'Select principal plane','XYpalne','YZplane','ZXplane',resp
jump/l210:,trm:,,,l230:,l240:,l250:,resp
l230:
pl=plane/xyplan,dis
jump/retu:
l240:
pl=plane/yzplan,dis
jump/retu:
l250:
pl=plane/xzplan,dis
jump/retu:

$$程序返回。
retu:
judge=1
return

$$程序结束。
trm:
halt





⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -