创建制图对象示例程序

$$ 此示例程序创建水平制图
$$ 两个之间选择垂直线条是否他们
$$ 在绘图成员视图,直接在绘图上,
$$ 或在模型视图中.
 
entity/obj_1,obj_2

number/pos1(3)

string/view_1(30),view_2(30)
 
$$ 总是选择两个对象并获取每个选择的视图.
$$ 保存当前的光标状态,然后
$$ 将光标的视图设置为任何视图中为选择对象.
 
pk1:
  &vwcurs = &any
 
  mask/3
 
  ident/'Select Line 1',obj_1,resp
jump/lend:,lend:,,,resp
 
  view_1 = &vwsel
 
pk2:
  ident/'Select Line 2',obj_2,resp
  jump/pk1:,lend:,,,resp
 
  view_2 = &vwsel
 
$$ Get screen pick for origin.
$$ Set view of cursor to work view for screen position selection.
 
orig:
  &vwcurs = &work
 
  pos/'annotation origin',pos1(1),pos1(2),pos1(3),resp
  jump/pk2:,lend:,resp
 
$$ We have the lines, views and origin.
  ifthen/view_1 == view_2 and view_1 == &workvw
 
$$ Creation of annotation in work view.
   ldim/horiz,pos1(1),pos1(2),YSMALL,obj_1,YSMALL,obj_2
  else
 
$$ Creation of annotation to objects in drawing views
   ldim/horiz,pos1(1),pos1(2),YSMALL,obj_1,VIEW,view_1,$
       YSMALL,obj_2,VIEW,view_2
  endif
 
  jump/pk1:
 
lend:
 
  halt

 


Copyright ©2015 胡君NX二次开发官网(www.UGapi.com) QQ:85585969 All Rights Reserved.