RPS & windows Form

57 views
Skip to first unread message

dynamo.u...@gmail.com

unread,
Jan 24, 2018, 5:07:37 PM1/24/18
to RevitPythonShell
Hi All,

I've trying to build a form to create and delete print Sets.

I've 2 main issues:

I'm able to create a print set but I cannot access it's content unless I restart the Form. I get the errors below (depending if I'm defining the view_set variable or not)


This is the code of the function:

 def DisplaySheetsInSet (self, sender, args):
 
 
self.curItem = CurrentSetsListBox.SelectedItem
 
 
PrintSetForm_Load
 
 
try:

 
#view_set=[]
 
for i in PrintSetForm.ViewSets:
 
 
if i.Name == str(self.curItem):
 view_set
= i
 
else:
 
continue
 
 
Sheets=[sheet.Name for sheet in view_set.Views]
 
 
SheetsLb.BeginUpdate()
 
SheetsLb.Items.Clear()
 
 
for sheet in Sheets:
 
SheetsLb.Items.Add(sheet)
 
 
SheetsLb.EndUpdate()
 
 
except Exception as e:
 popup
(str(e))


2) I'm able to delete print sets once. If I try do delete another one I get the following error and I need to restart the form ( code for the function that deletes the print sets shown below)





I've tried to build a function to restart/refresh the Form but it doesn't work (below):


Any ideas or suggestions?

Thank you.


Manage Print Sets.gif

Callum

unread,
Jan 25, 2018, 3:53:49 PM1/25/18
to RevitPythonShell
These are good questions mate - Ive replied to the Stack Overflow post with some ideas. Let me know if they help!
Reply all
Reply to author
Forward
0 new messages