NX Journal ベクトル選択ダイアログ

2021/05/22 categories:NX Journal| tags:NX Journal|Python|

処理内容は以下の通りです。

結果は情報ウィンドウに以下のように表示されます。

<class 'int'> : 13
<class 'list'> : [0.0, 1.0, 0.0]
<class 'list'> : [0.0, 0.0, 0.0]

コード

import NXOpen
from NXOpen import UF

def main():
    theSession  = NXOpen.Session.GetSession()
    lw = theSession.ListingWindow
    lw.Open()

    response, direction, origin = specify_vector('aaaaa')

    lw.WriteLine( str(type(response)) + ' : ' + str(response) )
    lw.WriteLine( str(type(direction)) + ' : ' + str(direction) )
    lw.WriteLine( str(type(origin)) + ' : ' + str(origin) )

def specify_vector(message):
    theUfSession  = NXOpen.UF.UFSession.GetUFSession()
    mode = NXOpen.UF.UFConstants.UF_UI_INFERRED
    displayConehead = NXOpen.UF.UFConstants.UF_UI_DISP_TEMP_VECTOR

    theUI = NXOpen.UI.GetUI()
    theUI.LockAccess()
    response, direction, origin = theUfSession.Ui.SpecifyVector(message, mode, displayConehead)
    theUI.UnlockAccess()

    return response, direction, origin

if __name__ == '__main__':
    main()

Share post

Related Posts

Comments

comments powered by Disqus