- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I would like create a Global Form with a bespoke set of parameters whose values can be captured for use in creation of new drawing files.
I attempted to do this by firing a rule from the form that creates a new part document; populates it with the appropriate parameters; and then relaunches the form after activating the new part document.
'[Creates a temporary document for parameters used in the "Fabrication 'Drawing Creation Tool" form. 'Dim oDoc As Document = ThisDoc.Document Dim oTempDoc As PartDocument oTempDoc = ThisApplication.Documents.Add(DocumentTypeEnum.kPartDocumentObject) oUserParameters = oTempDoc.ComponentDefinition.Parameters.UserParameters oTempDoc.Activate SharedVariable("oTempDoc") = oTempDoc '] '[Add drawing templates to an array list Dim Templates As New ArrayList Dim FileLocation As System.IO.DirectoryInfo = _ New System.IO.DirectoryInfo("C:\Vault\CAD Support\Inventor\Templates\") Dim FileInfo As System.IO.FileInfo() = FileLocation.GetFiles("*" & ".idw") For Each oFile As System.IO.FileInfo In FileInfo Templates.Add(oFile.Name) Next '] '[Creates and sets parameters that are used for the "Fabrication Drawing 'Creation Tool" form. oUserParameters.AddByValue("Template", "", UnitsTypeEnum.kTextUnits) 'MultiValue.List("Template") = Templates 'Parameter("Template") = "Standard.idw" oUserParameters.AddByValue("CreateBaseView", True, UnitsTypeEnum.kBooleanUnits) oUserParameters.AddByValue("CreateBaseViewProjs", True, UnitsTypeEnum.kBooleanUnits) oUserParameters.AddByValue("CreatePcDetails", True, UnitsTypeEnum.kBooleanUnits) oUserParameters.AddByValue("JobNo", "", UnitsTypeEnum.kTextUnits) oUserParameters.AddByValue("Detailer", "", UnitsTypeEnum.kTextUnits) oUserParameters.AddByValue("Checker", "", UnitsTypeEnum.kTextUnits) oUserParameters.AddByValue("Approver", "", UnitsTypeEnum.kTextUnits) oUserParameters.AddByValue("Date", "", UnitsTypeEnum.kTextUnits) '] iLogicForm.CloseGlobal("Fabrication Drawing Creation Tool") oTempDoc.Activate iLogicForm.ShowGlobal("Fabrication Drawing Creation Tool", FormMode.Modal)
Because--as seem to be the case, 'iLogicForm.ShowGlobal' does not care which document is active, only which one it was run from-- I cannot get the form to see the parameters that are available after running 'Activate Value Input', I was wondering if there was a way to call the form specifically from the oTempDoc that the rule has created.
Solved! Go to Solution.