Пример #1
0
def run():
    """
Do not place the fake vitesse file at python path.
Place it at 'external libraries' of eclipse is recommended
"""
    names = [i.__name__ for i in modList]
    res, action = kcs_ui.string_select(
        'fake vitesse generator',
        'Please select the module you want to generate fake vitesse py.',
        'Press option to generate for all modules.', names)
    if res == kcs_util.ok():
        mod = modList[action - 1]
        des = kcs_ui.string_req('Where do you want to place the file?',
                                r'C:\temp')
        if des[0] == kcs_util.ok():
            #         des = os.path.join(os.path.join(os.getcwd(), "FakeVitesse"))
            fname = des[1] + "\\" + mod.__name__ + ".py"
            GenPy(mod, fname)
    elif res == kcs_util.options():
        des = kcs_ui.string_req('Where do you want to place the file?',
                                r'C:\temp')
        if des[0] == kcs_util.ok():
            for mod in modList:
                fname = des[1] + "\\" + mod.__name__ + ".py"
                GenPy(mod, fname)
Пример #2
0
def run():
    """
Do not place the fake vitesse file at python path.
Place it at 'external libraries' of eclipse is recommended
"""
    names = [i.__name__ for i in modList]
    res, action = kcs_ui.string_select(
        "fake vitesse generator",
        "Please select the module you want to generate fake vitesse py.",
        "Press option to generate for all modules.",
        names,
    )
    if res == kcs_util.ok():
        mod = modList[action - 1]
        des = kcs_ui.string_req("Where do you want to place the file?", r"C:\temp")
        if des[0] == kcs_util.ok():
            #         des = os.path.join(os.path.join(os.getcwd(), "FakeVitesse"))
            fname = des[1] + "\\" + mod.__name__ + ".py"
            GenPy(mod, fname)
    elif res == kcs_util.options():
        des = kcs_ui.string_req("Where do you want to place the file?", r"C:\temp")
        if des[0] == kcs_util.ok():
            for mod in modList:
                fname = des[1] + "\\" + mod.__name__ + ".py"
                GenPy(mod, fname)
Пример #3
0
            ee=kcs_draft.element_child_first_get(hNote)
            txt=Text()
            if kcs_draft.element_is_text(ee):
                txt=kcs_draft.text_properties_get(ee,txt)
                sList.AddString(noteName+" : "+txt.GetString())
                continue
            while True:
                ee=kcs_draft.element_sibling_next_get(ee)
                if kcs_draft.element_is_text(ee):
                    txt=kcs_draft.text_properties_get(ee.txt)
                    sList.AddString(noteName+" : "+txt.GetString())
                    break
        except Exception,e:
            kcs_ui.message_noconfirm(e.message)
    sList.StrList=sList.StrList[1:]
    res=kcs_ui.string_select("批注","批注列表","请选择批注",sList) #显示批注列表
    if res[0]==kcs_util.ok():
        index=res[1]
        hNote=hNoteList[index-1]
        rect=kcs_draft.element_extent_get(hNote) #缩放
        factor=50
        rect.SetCorner1(Point2D(rect.Corner1.X-factor,rect.Corner1.Y-factor))
        rect.SetCorner2(Point2D(rect.Corner2.X+factor,rect.Corner2.Y+factor))
        kcs_draft.dwg_zoom(rect)
                    
    
def GetID(hSubView):
    """获得批注编号"""
    index=1
    try:
        comp=kcs_draft.element_child_first_get(hSubView)