MaxScript 一些结构的记录

Posted trykle

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了MaxScript 一些结构的记录相关的知识,希望对你有一定的参考价值。

struct maxFormBuilderStruct
(
    
    theFrm = dotNetObject "MaxCustomControls.MaxForm"
    ,theBtn = dotNetObject "System.Windows.Forms.Button"
    ,fn theFunc = messageBox "123"
    
    ,on create do
    (
        DotNet.AddEventHandler this.theBtn "click" this.theFunc
        
        this.theFrm.controls.add this.theBtn
        this.theFrm.Show(theHwnd)
    )
)
--maxFormBuilderStruct()
------------------------------------------------------------

rollout maxFormBuilderRoll ""
(
    local theFrm = dotNetObject "MaxCustomControls.MaxForm"
    local theBtn = dotNetObject "System.Windows.Forms.Button"
    
    fn theFunc = messageBox "456"
    
    fn init =
    (
        DotNet.AddEventHandler theBtn "click" theFunc
        theFrm.controls.add theBtn
        theFrm.Show(theHwnd)
    )
)

--maxFormBuilderRoll.init()
------------------------------------------------------------
fn maxFormBuilderFunc = 
(
    local controls = #()
    local theFrm = dotNetObject "MaxCustomControls.MaxForm"; append controls theFrm
    local theBtn = dotNetObject "System.Windows.Forms.Button"; append controls theBtn
    theFrm.controls.add theBtn

    thePtr = DotNetObject "System.IntPtr" (windows.getMAXHWND())
    theHwnd = (dotNetObject "System.Windows.Forms.NativeWindow").FromHandle thePtr
    
    fn theFunc = messageBox "789"
    DotNet.AddEventHandler theBtn "click" theFunc
    
    theFrm.Show(theHwnd)
    return controls
)

--maxFormBuilderFunc()

以上是关于MaxScript 一些结构的记录的主要内容,如果未能解决你的问题,请参考以下文章

MaxScript重启3dsMax的重新思考

提效小技巧——记录那些不常用的代码片段

3D MAXScript

转MaxScript.Net接收本地端口的消息执行

RexNet片段记录

RexNet片段记录