|
import kcs_gui
import kcs_util
import basic_design_menu
#
# All user interface changes must be done in the post-trigger.
# When the pre-trigger fires, Windows has not yet created the
# necessary objects we depend on.
#
def post(*args):
#
# Add menu(s)
#
try:
if kcs_util.app_basic_design():
basic_design_menu.add(10)
except:
print "Failed adding menu(s): ",kcs_gui.error
#
# 加载通用快捷键
#
try:
kcs_gui.accelerators_obsolete_add()
common_std_tbar() # 向原有工具条中添加
common_tbar()
except:
print "Failed accelertor key : Please update M2SP2 ",kcs_gui.error
#
# 加载平面建模扩展工具条
#
try:
if kcs_util.app_planar_hull() or kcs_util.app_curved_hull():
planar_tbar()
except:
print "加载扩展工具条失败...",kcs_gui.error
#
# 加载套料扩展工具条
#
try:
if kcs_util.app_nesting():
nest_tbar()
except:
print "加载扩展工具条失败...",kcs_gui.error
#
# 加载 STRUCTURE 扩展工具条
#
try:
if kcs_util.app_structure():
except:
print "加载扩展工具条失败...",kcs_gui.error
#
# 加载 Ventilation 扩展工具条
#
try:
if kcs_util.app_ventilation():
Pipe_Support_Add()
except:
print "加载扩展工具条失败...",kcs_gui.error
#
# 加载 Pipe 扩展工具条
#
try:
if kcs_util.app_pipe():
Pipe_add_std_tBar()
except:
print "加载扩展工具条失败...",kcs_gui.error
return kcs_util.trigger_ok()
def Pipe_add_std_tBar():
tbar_group_1 = kcs_gui.toolbar_add("Pipe Model-Group")
kcs_gui.toolbar_button_std_add(tbar_group_1,0,33307,"C:\\Tribon\\M3\\Vitesse\\Icon\\transform.ico","Group Transform","To move a group of parts...")
kcs_gui.toolbar_button_std_add(tbar_group_1,1,33308,"C:\\Tribon\\M3\\Vitesse\\Icon\\rotate.ico","Group Rotate","To rotate a group of parts...")
kcs_gui.toolbar_button_std_add(tbar_group_1,2,33309,"C:\\Tribon\\M3\\Vitesse\\Icon\\addconn.ico","Group Add to Conn","To move a group of parts to a connection...")
kcs_gui.toolbar_button_std_add(tbar_group_1,3,33310,"C:\\Tribon\\M3\\Vitesse\\Icon\\length.ico","Group Change Length","To change a length of a part...")
kcs_gui.toolbar_button_std_add(tbar_group_1,4,33311,"C:\\Tribon\\M3\\Vitesse\\Icon\\rename.ico","Group Rename","To move parts from another pipe to current pipe...")
tbar_group_2 = kcs_gui.toolbar_get(196)
kcs_gui.toolbar_button_std_add(tbar_group_2,5,-1)
kcs_gui.toolbar_button_std_add(tbar_group_2,6,33301,"C:\\Tribon\\M3\\Vitesse\\Icon\\connect.ico","Pipe Mode 2-Connect","To connect two parts...")
kcs_gui.toolbar_button_std_add(tbar_group_2,7,33303,"C:\\Tribon\\M3\\Vitesse\\Icon\\disconnect.ico","Pipe Mode 2-Disconnect","To disconnect two parts...")
kcs_gui.toolbar_button_std_add(tbar_group_2,8,33302,"C:\\Tribon\\M3\\Vitesse\\Icon\\bossconn.ico","Pipe Mode 2-Boss connect","To change connection type of a boss...")
kcs_gui.toolbar_button_std_add(tbar_group_2,9,34369,"C:\\Tribon\\M3\\Vitesse\\Icon\\pipe.ico","Pipe Mode 2-Resize pipe","To resize a pipe...")
kcs_gui.toolbar_button_std_add(tbar_group_2,10,34370,"C:\\Tribon\\M3\\Vitesse\\Icon\\branch.ico","Pipe Mode 2-Resize Branch","To resize a branch...")
tbar_group_3 = kcs_gui.toolbar_add("Pipe Model-Part")
kcs_gui.toolbar_button_std_add(tbar_group_3,0,33297,"C:\\Tribon\\M3\\Vitesse\\Icon\\flip.ico","Part Flip","To flip a part...")
kcs_gui.toolbar_button_std_add(tbar_group_3,1,33300,"C:\\Tribon\\M3\\Vitesse\\Icon\\split.ico","Part Split","To split a straight pipe part...")
kcs_gui.toolbar_button_std_add(tbar_group_3,2,33329,"C:\\Tribon\\M3\\Vitesse\\Icon\\information.ico","Part Info","To give information on a pipe part info...")
tbar_group_4 = kcs_gui.toolbar_add("Pipe Model-Bent")
kcs_gui.toolbar_button_std_add(tbar_group_4,0,33286,"C:\\Tribon\\M3\\Vitesse\\Icon\\Create.ico","Bend Create","To create a frame bend on a straight frame part...")
kcs_gui.toolbar_button_std_add(tbar_group_4,1,33287,"C:\\Tribon\\M3\\Vitesse\\Icon\\movefree.ico","Bend Move Free","To move a frame bend...")
kcs_gui.toolbar_button_std_add(tbar_group_4,2,33291,"C:\\Tribon\\M3\\Vitesse\\Icon\\moveangle.ico","Bend Move Angle","To move a frame bend to a given angle...")
kcs_gui.toolbar_button_std_add(tbar_group_4,3,33292,"C:\\Tribon\\M3\\Vitesse\\Icon\\detelebends.ico","Bend Delete o-Bends","To delete zero-angled frame bends...")
kcs_gui.toolbar_button_std_add(tbar_group_4,4,33293,"C:\\Tribon\\M3\\Vitesse\\Icon\\display.ico","Bend Display Bends","To display all frame bends...")
tbar_group_5 = kcs_gui.toolbar_get(198)
kcs_gui.toolbar_button_std_add(tbar_group_5,4,-1)
kcs_gui.toolbar_button_std_add(tbar_group_5,5,33319,"C:\\Tribon\\M3\\Vitesse\\Icon\\spoollimitset.ico","Pipe Production 2-Spool Limit Set","To set a spool limit...")
kcs_gui.toolbar_button_std_add(tbar_group_5,6,33320,"C:\\Tribon\\M3\\Vitesse\\Icon\\spoollimitreset.ico","Pipe Production 2-Spool Limit Reset","To delete a spool limit...")
kcs_gui.toolbar_button_std_add(tbar_group_5,7,33321,"C:\\Tribon\\M3\\Vitesse\\Icon\\spoollimitdisplay.ico","Pipe Production 2-Spool Limit Display","To display spool limit...")
tbar_group_6 = kcs_gui.toolbar_add("Pipe Production-Check")
kcs_gui.toolbar_button_std_add(tbar_group_6,0,33436,"C:\\Tribon\\M3\\Vitesse\\Icon\\checkbend.ico","Check Bend","To check pipe bending and welding...")
kcs_gui.toolbar_button_std_add(tbar_group_6,1,33437,"C:\\Tribon\\M3\\Vitesse\\Icon\\checkexcess.ico","Check Excess","To check pipe excess...")
kcs_gui.toolbar_button_std_add(tbar_group_6,2,33440,"C:\\Tribon\\M3\\Vitesse\\Icon\\checkframe.ico","Check Frame","To check pipe frames...")
kcs_gui.toolbar_button_std_add(tbar_group_6,3,33441,"C:\\Tribon\\M3\\Vitesse\\Icon\\checklength.ico","Check Length","To dcheck pipe length...")
kcs_gui.toolbar_button_std_add(tbar_group_6,4,33444,"C:\\Tribon\\M3\\Vitesse\\Icon\\checkspoolname.ico","Check Spool Name","To check positions names...")
tbar_group_7 = kcs_gui.toolbar_add("Pipe Group")
kcs_gui.toolbar_button_std_add(tbar_group_7,0,33453,"C:\\Tribon\\M3\\Vitesse\\Icon\\1.ico","Pipe Group Move","To move a group of files...")
kcs_gui.toolbar_button_std_add(tbar_group_7,1,33711,"C:\\Tribon\\M3\\Vitesse\\Icon\\2.ico","Pipe Group Move Parts","To move parts in a group of pipes...")
kcs_gui.toolbar_button_std_add(tbar_group_7,2,33454,"C:\\Tribon\\M3\\Vitesse\\Icon\\3.ico","Pipe Group Duplicate","To deplicate a group of pipes...")
kcs_gui.toolbar_button_std_add(tbar_group_7,3,33455,"C:\\Tribon\\M3\\Vitesse\\Icon\\4.ico","Pipe Group Rename","To rename pipes or parts of pipes...")
kcs_gui.toolbar_button_std_add(tbar_group_7,4,33451,"C:\\Tribon\\M3\\Vitesse\\Icon\\5.ico","Pipe Group Color","To change color for a group of pipes...")
kcs_gui.toolbar_button_std_add(tbar_group_7,5,33458,"C:\\Tribon\\M3\\Vitesse\\Icon\\6.ico","Pipe Group Delete","To delete a group of pipes...")
kcs_gui.toolbar_button_std_add(tbar_group_7,6,33710,"C:\\Tribon\\M3\\Vitesse\\Icon\\7.ico","Pipe Group Release","Pipe Group Release...")
def common_std_tbar():
standard_tbar = kcs_gui.toolbar_get(149)
kcs_gui.toolbar_button_usr_add(standard_tbar,2,'OpenProductionDrawing',"C:\Tribon\M3\Vitesse\Icon\Open_Prod_DWG.ico","Open Production Drawing","打开生产设计图纸...")
subp_tbar = kcs_gui.toolbar_get(191)
kcs_gui.toolbar_button_std_add(subp_tbar,1,32943,"C:\Tribon\M3\Vitesse\Icon\Save.ico","Save SuBPIc","Save subppicture..")
kcs_gui.toolbar_button_std_add(subp_tbar,7,-1)
kcs_gui.toolbar_button_std_add(subp_tbar,8,32942,"C:\Tribon\M3\Vitesse\Icon\Insert_subpic.ico","Insert Subpic","Insert subppicture..")
dim_tbar = kcs_gui.toolbar_get(221)
kcs_gui.toolbar_button_std_add(dim_tbar,20,-1)
kcs_gui.toolbar_button_std_add(dim_tbar,21,32896,"C:\Tribon\M3\Vitesse\Icon\dim_leader.ico","Leader Dimension","Dimension 3D distance to plane leader..")
def common_tbar():
delete_toolbar = kcs_gui.toolbar_add("删除")
kcs_gui.toolbar_button_std_add(delete_toolbar,0,32884,"C:\Tribon\M3\Vitesse\Icon\Dim_Delete.ico","标注","删除标注..")
kcs_gui.toolbar_button_std_add(delete_toolbar,1,32980,"C:\Tribon\M3\Vitesse\Icon\Pos_delete.ico","Position No","删除零件号..")
modify_toolbar = kcs_gui.toolbar_add("修改")
kcs_gui.toolbar_button_std_add(modify_toolbar,1,32910,"C:\Tribon\M3\Vitesse\Icon\Trim.ico","Trim","Trim To entity..")
kcs_gui.toolbar_button_std_add(modify_toolbar,2,32904,"C:\Tribon\M3\Vitesse\Icon\ModifyLine.ico","Line Type","Line type..")
kcs_gui.toolbar_button_std_add(modify_toolbar,3,32909,"C:\Tribon\M3\Vitesse\Icon\Stretch.ico","Stretch","Modify stretch..")
annotate_toolbar = kcs_gui.toolbar_add("注释")
kcs_gui.toolbar_button_std_add(annotate_toolbar,1,33120,"C:\Tribon\M3\Vitesse\Icon\Pos_note.ico","Pos_Note","Hull note pos no..")
kcs_gui.toolbar_button_std_add(annotate_toolbar,2,33770,"C:\Tribon\M3\Vitesse\Icon\Symbol1.ico","Symbol1","General restricion symbol..")
def planar_tbar():
planar_toolbar = kcs_gui.toolbar_add("平面建模")
kcs_gui.toolbar_button_std_add(planar_toolbar,0,33085,"C:\Tribon\M3\Vitesse\Icon\Scheme_input.ico","Scheme_Input","Scheme Input..")
kcs_gui.toolbar_button_std_add(planar_toolbar,1,33088,"C:\Tribon\M3\Vitesse\Icon\Scheme_show.ico","Scheme_Show","Scheme Show..")
kcs_gui.toolbar_button_std_add(planar_toolbar,2,33087,"C:\Tribon\M3\Vitesse\Icon\Scheme_edit.ico","Scheme_Edit","Scheme Edit..")
kcs_gui.toolbar_button_std_add(planar_toolbar,3,33097,"C:\Tribon\M3\Vitesse\Icon\Model_modify.ico","Model_Modify","Model Modify..")
kcs_gui.toolbar_button_std_add(planar_toolbar,4,33114,"C:\Tribon\M3\Vitesse\Icon\View_create.ico","View_Create","View Create..")
kcs_gui.toolbar_button_std_add(planar_toolbar,5,33115,"C:\Tribon\M3\Vitesse\Icon\View_detail.ico","View_Detail","View Detail..")
kcs_gui.toolbar_button_std_add(planar_toolbar,6,33116,"C:\Tribon\M3\Vitesse\Icon\View_recreate.ico","View_Recreate","View Recreate..")
kcs_gui.toolbar_button_std_add(planar_toolbar,7,33117,"C:\Tribon\M3\Vitesse\Icon\View_modify.ico","View_Modify","View Modify..")
kcs_gui.toolbar_button_usr_add(planar_toolbar,8,'hol',"C:\Tribon\M3\Vitesse\Icon\hol.ico","add hole grid","添加隔栅..")
def nest_tbar():
nesting_toolbar = kcs_gui.toolbar_add("套料")
kcs_gui.toolbar_button_std_add(nesting_toolbar,1,33173,"C:\Tribon\M3\Vitesse\Icon\New_nest.ico","New_Nest","Nest job new..")
kcs_gui.toolbar_button_std_add(nesting_toolbar,2,33172,"C:\Tribon\M3\Vitesse\Icon\Open_nest.ico","Open_Nest","Nest job open..")
kcs_gui.toolbar_button_std_add(nesting_toolbar,3,33174,"C:\Tribon\M3\Vitesse\Icon\Save_nest.ico","Save_Nest","Nest job save..")
kcs_gui.toolbar_button_std_add(nesting_toolbar,4,33175,"C:\Tribon\M3\Vitesse\Icon\Job_rename.ico","Job_Rename","Nest job rename..")
kcs_gui.toolbar_button_std_add(nesting_toolbar,5,33181,"C:\Tribon\M3\Vitesse\Icon\Parts_trans.ico","Parts_Trans","Nesting parts transform..")
kcs_gui.toolbar_button_std_add(nesting_toolbar,6,33190,"C:\Tribon\M3\Vitesse\Icon\Bridge.ico","Bridge","Nesting tools bridge..")
kcs_gui.toolbar_button_std_add(nesting_toolbar,7,33191,"C:\Tribon\M3\Vitesse\Icon\Start_burn.ico","Start_Burn","Nesting tools start burn..")
kcs_gui.toolbar_button_std_add(nesting_toolbar,8,33192,"C:\Tribon\M3\Vitesse\Icon\Start_mark.ico","Start_Mark","Nesting tools start mark..")
kcs_gui.toolbar_button_std_add(nesting_toolbar,9,33195,"C:\Tribon\M3\Vitesse\Icon\Start_move.ico","Start_Move","Nesting tools start move..")
kcs_gui.toolbar_button_std_add(nesting_toolbar,10,33196,"C:\Tribon\M3\Vitesse\Icon\Sequence.ico","sequence","Nesting tools start sequence..")
kcs_gui.toolbar_button_std_add(nesting_toolbar,11,33234,"C:\Tribon\M3\Vitesse\Icon\Del_bridge.ico","Del_Bridge","Delete bridge..")
kcs_gui.toolbar_button_std_add(nesting_toolbar,12,33235,"C:\Tribon\M3\Vitesse\Icon\Del_start.ico","Del_Start","Delete start..")
kcs_gui.toolbar_button_std_add(nesting_toolbar,13,33236,"C:\Tribon\M3\Vitesse\Icon\Del_part.ico","Del_Part","Delete part..")
kcs_gui.toolbar_button_std_add(nesting_toolbar,14,33238,"C:\Tribon\M3\Vitesse\Icon\Del_sketch.ico","Del_Sketch","Delete sketch..")
def Pipe_Support_Add():
main_menu = kcs_gui.menu_get(None,0)
my_menu = kcs_gui.menu_add(main_menu,15,"Vent S&upport")
kcs_gui.menu_item_usr_add(my_menu,0,"Clamp &Parameters","Clamp_Parameter","Set clamp parameters for vent support modeling")
kcs_gui.menu_item_std_add(my_menu,1,"Vent &Support",33469)
try:
tbar_group_2 = kcs_gui.toolbar_get(191)
kcs_gui.toolbar_button_std_add(tbar_group_2,0,33301,"C:\\Tribon\\M3\\Vitesse\\Icon\\pipe.ico","AAAAAA" ,"AAAAAA" )
except:
pass |
|