By Adam Nagy
You can get the list of drawing sheets from any language/environment that can use the Inventor API: .NET, VBA, iLogic, etc. If you want to store the last selection you could store that in a user parameter or iProperty, maybe an attribute. There is a series of articles on the possibilities:
- http://adndevblog.typepad.com/manufacturing/2013/03/save-extra-data-in-inventor-file-1.html
- http://adndevblog.typepad.com/manufacturing/2013/03/save-extra-data-in-inventor-file-2.html
- http://adndevblog.typepad.com/manufacturing/2013/03/save-extra-data-in-inventor-file-3.html
If you want to show all the sheet names in the Form, then the easiest might be to use a Multi-Value User Parameter.
1) Create a Multi-Value User Parameter (named e.g. Sheets) in the drawing document through Manage>> Parameters, and turn it into a Multi-Value parameter by right-clicking on it and selecting Make Multi-Value - you don't have to set the values, the below rule will do that
2) Create a rule that will keep the values of that parameter up-to-date: Sheets rule
Dim MyArrayList As New ArrayList For Each s In ThisDoc.Document.Sheets MyArrayList.Add(s.Name) Next MultiValue.List("Sheets") = MyArrayList
3) Create a rule that the user can run once selecting the sheet (in this case e.g. print): PrintSheet rule
' We are getting the value through "Parameter"' If we tried to get it from "Sheets" directly' then this rule would run every time' the value of that parameter changed MsgBox("Printing " + Parameter("Sheets"), , "Print Sheet")
4) Create the Form that will have the Sheets parameter and the PrintSheet rule in it
Result of running the Print Form, selecting a sheet and clicking the Print button: