ETO Rhino.UI.EtoExtensions.PushPickButton(self, self.OnOKButton)

I have run into a problem…I created a python program that uses an ETO Dialog for user input - Class Dialog(forms.Form). I used the event:

def OnPushOkButton(self, sender, e):
        Rhino.UI.EtoExtensions.PushPickButton(self, self.OnOKButton)

to execute the program while allowing me to select blocks and to be able to hide the dialog while selecting objects but keep it open when doing modeling tasks. The program modifies selected block definitions.

The problem I have is that in the viewport window the block definitions don’t show the updates in the viewport until I either press the “Ok” button again and restart the program which prompts fo user input rs.GetObjects. I made another push button “Refresh View” and the only way I could get it to update the viewport was to use a “Get” command i.e. rs.GetObjects, which is not desired. I have tried rs.EnableRedaw(True), sc.doc,View.Redraw and whatever else I could think of to get either the display to update or for the block attributes to take effect, not sure which is the problem?

I was just wondering if anyone had any advise or things to try to be able to get the blocks to display correctly in the viewport or without pressing “OK” and running the program again, the blocks display when the dialog is closed either? Thanks in advance

Rhino.UI.EtoExtensions.PushPickButton(self, self.OnRefreshViewButton)

Hi @patskorut,

Without the full code, so we can run here, its hard to say. But perhaps after you update the instance definition, you just need to redraw the document?


– Dale

Thanks for the advise, I tried that and rs.EnableRedaw(True). I would post my code but the dialog and program code are quite a bit of code and I don’t think that would help anyway as it’s a bit confusing and not very simple…plus I still need to comment everything. I was messing with it the past couple of days though and I’m pretty sure it’s due to some problem with the blocks not updating, because I can run rs.Command(“!_-BlockManager _Enter _Cancel _Enter”, False) and it refreshes the blocks and updates the display. The issue is that opening and closing the BlockManager all the time is pretty compute intensive and slows everything down.

Is there a python command that would refresh the blocks without opening the BlockManager???