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 PrintUserResponse():
    while True:
        pt=Point2D()
        res=kcs_ui.point2D_req('Esc to quit.',pt)
        if res[0]==util.cancel():
            break
        else:
            msg('Your response is: %s'%res[0])
def PrintUserResponse():
    while True:
        pt = Point2D()
        res = kcs_ui.point2D_req('Esc to quit.', pt)
        if res[0] == util.cancel():
            break
        else:
            msg('Your response is: %s' % res[0])
Example #4
0
def run():
    info="""欢迎使用iknot插件。
若有任何建议或需求,您可以通过以下方式联系我:
网站:www.iknot.org
邮箱:[email protected]
微信公众号:iknot
qq:2826779289
"""
    msg(info)
    
Example #5
0
def PrintLinetypes():
    tps = KcsLinetype.GetLinetypes()
    pos = 0
    for i in range(len(tps)):
        msg(i)
        tp = tps.keys()[i]
        name = KcsLinetype.GetSystemName(tp)
        lt = KcsLinetype.Linetype(name)
        kcs_draft.linetype_set(lt)

        p1 = Point2D(0, pos)
        p2 = Point2D(100, pos)
        ln = Rline2D(p1, p2)
        kcs_draft.line_new(ln)
        kcs_draft.text_new(name, Point2D(p2.X + 20, p2.Y))

        pos += 20
Example #6
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 PrintAll():
    msg("ok():%s" % util.ok())
    msg("cancel():%s" % util.cancel())
    msg("quit():%s" % util.quit())
    msg("options():%s" % util.options())
    msg("operation_complete():%s" % util.operation_complete())
    msg("yes():%s" % util.yes())
    msg("no():%s" % util.no())
    msg("all():%s" % util.all())
    msg("undo():%s" % util.undo())
    msg("reject():%s" % util.reject())
    msg("exit_function():%s" % util.exit_function())
def PrintAll():
    msg("ok():%s" % util.ok())
    msg("cancel():%s" % util.cancel())
    msg("quit():%s" % util.quit())
    msg("options():%s" % util.options())
    msg("operation_complete():%s" % util.operation_complete())
    msg("yes():%s" % util.yes())
    msg("no():%s" % util.no())
    msg("all():%s" % util.all())
    msg("undo():%s" % util.undo())
    msg("reject():%s" % util.reject())
    msg("exit_function():%s" % util.exit_function())