Example #1
0
def run():
    stat=KcsStat_point2D_req.Stat_point2D_req()
    ct=CursorType()
    
    CursorTypes = {'CrossHair' : 1, 'RubberBand' : 2, 'RubberRectangle' : 3, 'RubberCircle' : 4, 'DragCursor' : 5}
    
    actions=CursorTypes.keys()
    
    bs=ButtonState()
    bs.EnableLock(1)
    bs.SetCheckedLock('V')
    
    pt=Point2D(2,3)
    while True:
        res=kcs_ui.choice_select('title','header',actions)
        if res[0]==kcs_util.ok():
            #msg("%s:%s"%(res[1],CursorTypes.keys()[res[1]-1]))
            if res[1]==1:
                ct.SetCrossHair()
            elif res[1]==2:
                ct.SetRubberBand(pt)
            elif res[1]==3:
                ct.SetRubberRectangle(pt)
            elif res[1]==4:
                ct.SetRubberCircle(pt)
            elif res[1]==5:
                pass
            stat.SetCursorType(ct)
            stat.SetDefMode('ModeMidPoint')
            stat.SetHelpPoint(Point2D(0,0))
            msg(ct)
            res,pt2=kcs_ui.point2D_req('msg',pt,stat,bs)
            msg(pt2)
        else:
            break
def run():
    res,action=kcs_ui.choice_select('User response','Choices',
        ['Print all','Response of point2D_req'])
    if res==util.ok():
        if action==1:
            PrintAll()
        elif action==2:
            PrintUserResponse()
def run():
    res, action = kcs_ui.choice_select(
        'User response', 'Choices', ['Print all', 'Response of point2D_req'])
    if res == util.ok():
        if action == 1:
            PrintAll()
        elif action == 2:
            PrintUserResponse()
Example #4
0
def GetPosition():
    actions = ('X', 'Y', 'Z')
    (res, index) = kcs_ui.choice_select('select', \
                                     'Please select line position', actions)
    if res == kcs_util.ok():
        (res, d) = kcs_ui.real_req('Please enter the number')
        if res == kcs_util.ok():
            if index == 1:
                return ('X', d)
            elif index == 2:
                return ('Y', d)
            elif index == 3:
                return ('Z', d)
    else:
        return 0
Example #5
0
def run():
    stat = KcsStat_point2D_req.Stat_point2D_req()
    ct = CursorType()

    CursorTypes = {
        'CrossHair': 1,
        'RubberBand': 2,
        'RubberRectangle': 3,
        'RubberCircle': 4,
        'DragCursor': 5
    }

    actions = CursorTypes.keys()

    bs = ButtonState()
    bs.EnableLock(1)
    bs.SetCheckedLock('V')

    pt = Point2D(2, 3)
    while True:
        res = kcs_ui.choice_select('title', 'header', actions)
        if res[0] == kcs_util.ok():
            #msg("%s:%s"%(res[1],CursorTypes.keys()[res[1]-1]))
            if res[1] == 1:
                ct.SetCrossHair()
            elif res[1] == 2:
                ct.SetRubberBand(pt)
            elif res[1] == 3:
                ct.SetRubberRectangle(pt)
            elif res[1] == 4:
                ct.SetRubberCircle(pt)
            elif res[1] == 5:
                pass
            stat.SetCursorType(ct)
            stat.SetDefMode('ModeMidPoint')
            stat.SetHelpPoint(Point2D(0, 0))
            msg(ct)
            res, pt2 = kcs_ui.point2D_req('msg', pt, stat, bs)
            msg(pt2)
        else:
            break
Example #6
0
def run():
    actions=['View','Subview','Component','Element']
    res,act=kcs_ui.choice_select('View info','Select the type',actions)
    if res==kcs_util.ok():
        pt=Point2D()
        if act==1:
            ees=ktDraft.GetViews()
            printElements(ees)
        elif act==2:
            kcs_ui.point2D_req('Select',pt)
            hd=kcs_draft.view_identify(pt)
            ees=ktDraft.GetSubviews(hd)
            printElements(ees)
        elif act==3:
            kcs_ui.point2D_req('Select',pt)
            hd=kcs_draft.subview_identify(pt)
            ees=ktDraft.GetComponents(hd)
            printElements(ees)
        elif act==4:
            kcs_ui.point2D_req('Select',pt)
            hd=kcs_draft.component_identify(pt)
            ees=ktDraft.GetSubElements(hd)
            printElements(ees)