Quantcast
Channel: Scripting - McNeel Forum
Viewing all articles
Browse latest Browse all 5938

I want remember the position of the panel,Who can help me

$
0
0

I want the position of the panel can remember the position of the last move. The next time it appears in the last position
The position can also be memorized when the panel exits directly

# -*- coding: utf-8 -*-  
import Eto as e
import rhinoscriptsyntax as rs
import Rhino
import scriptcontext as sc
class aa(e.Forms.Dialog):
    def __init__(self):
        self.Title = '【纵 横】'
#        第1个框
        layout1 = e.Forms.DynamicLayout()
#        按钮1
        def OnLine1(sender,e):
#            self.Visible = False
            self.cl1('A1')
            rs.Command('_Lock')
#            self.Visible = True
        layout1.AddRow(e.Forms.Button(Text='锁 定',Height=25,ID='A1',BackgroundColor=e.Drawing.Color(123,123,1) ,click = OnLine1))
#        按钮2
        def OnLine2(sender,e):
#            self.Visible = False
            self.cl1('A2')
            rs.Command('_UnlockSelected')
#            self.Visible = True
        layout1.AddRow(e.Forms.Button(Text='解锁选取',Height=25,ID='A2',click = OnLine2))
        
#        按钮3
        def OnLine3(sender,e):
#            self.Visible = False
            self.cl1('A3')
            rs.Command('_Unlock')
#            self.Visible = True
        layout1.AddRow(e.Forms.Button(Text='解 锁',Height=25,ID='A3',click = OnLine3))
#         第2个框
        layout2 = e.Forms.DynamicLayout()
#        按钮1
        def OnLine1(sender,e):
#            self.Visible = False
            self.cl1('B1')
            rs.Command('_InterpcrvOnSrf')
#            self.Visible = True
        layout2.AddRow(e.Forms.Button(Text='曲面上曲线',Height=25,ID='B1',BackgroundColor=e.Drawing.Color(255,1,0) ,click = OnLine1))
#        按钮2
        def OnLine2(sender,e):
#            self.Visible = False
            self.cl1('B2')
            rs.Command('_Sweep1')
#            self.Visible = True
        layout2.AddRow(e.Forms.Button(Text='单 轨',Height=25,ID='B2',click = OnLine2))
        
#        按钮3
        def OnLine3(sender,e):
#            self.Visible = False
            self.cl1('B3')
            rs.Command('_Sweep2')
#            self.Visible = True
        layout2.AddRow(e.Forms.Button(Text='双 轨',Height=25,ID='B3',click = OnLine3))
        
        
        layout = e.Forms.DynamicLayout()
        layout.AddRow(layout1,layout2)
        self.AbortButton = e.Forms.Button(Text = 'Esc',Height=25,click = self.cl2,BackgroundColor=e.Drawing.Color(1,1,0))
#        self.AbortButton.Click += self.OnCloseButtonClick

        layout2.AddRow(self.AbortButton)
        try:
            layout.FindChild(sc.doc.Notes).Focus()
        except:
            pass
        self.Content = layout
        
        
        
    def cl1(self,bid):
        sc.doc.Notes=bid
        self.Close()
    def cl2(self,sender,e):
        self.Close()
    def jj(self,sender,e):
        self.Close()
a = aa()
rc = a.ShowModal(Rhino.UI.RhinoEtoApp.MainWindow)

2 posts - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 5938

Trending Articles