在别的地方找到的,希望对大家有用。
$$ Program: dim.grs
$$
$$
entity/dims,pnt(2),bpnt,dpnt
string/menu(2,24)
number/opnt(3)
$$ Mask for only lines, arcs, and solids
mask/3,72
crsmod=&vwcurs
&vwcurs=&any
$$ Prompt the user to select from Horizontal or Vertical
lab10:
k=0 $$ 确定标注是否偏移 0不偏移,<>0偏移
choose/'选择标注类型:',$
'水平标注',$
'垂直标注',dtyp
jump/lab10:,term:,,,,,dtyp
$$ dtyp=5,水平标注,dtyp=6 垂直标注
lab20:
param/'输入标注偏置距离:',$
'偏置距离:',dis,resp
jump/lab10:,term:,,resp
ident/'选择基准线',bpnt,resp
jump/lab20:,term:,,resp
$$ Get view name of the last selection
menu(1)=&vwsel
lab30:
&vwcurs=&any
ident/'选择目标线',dpnt,resp
jump/lab20:,term:,,resp
$$ Get view name of the last selection
menu(2)=&vwsel
$$
if/k<>0,jump/lab40:
&vwcurs=&work
pos/'尺寸标注点:',opnt,resp
jump/rset:,term:,,resp
lab40:
ifthen/k<>0
ifthen/dtyp==5
opnt(2)=opnt(2)+dis
else
opnt(1)=opnt(1)+dis
endif
endif
xold=&txarr
&txarr=&auto
draw/on
$$
ifthen/dtyp==5
dims=ldim/HORIZ,opnt(1),opnt(2),$
YLARGE,bpnt,VIEW,menu(1),YLARGE,dpnt,VIEW,menu(2)
else
dims=ldim/VERT,opnt(1),opnt(2),$
XLARGE,bpnt,VIEW,menu(1),XLARGE,dpnt,VIEW,menu(2)
endif
k=1
jump/lab30:
rset:
&vwcurs=&any
jump/lab30:
term:
&txarr=xold
&vwcurs=crsmod
halt
[ 本帖最后由 fys325aa 于 2006-12-10 18:22 编辑 ] |