Message 1 of 4
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I want to run an external rule while the assembly called 'sample.iam' is open.
The content of the external rule is to open a new assembly called 'new.iam' and input the parameter inside 'sample.iam' to the parameter value of 'new.iam'.
However, it does not recognize the parameter of 'new.iam'.
I think it is because 'thisdocument' is 'sample.iam'.
Even if I activate the file of 'new.iam', it says that it cannot find 'new.iam'.
I tried the code below, but it says that it cannot find 'new.iam' itself.
Does anyone know how I can activate the newly opened file?
Sub Main 'Defalt Value Dim oDoc As Document = ThisApplication.ActiveDocument Dim docName As String = ThisDoc.FileName Dim ModelName As String 'Parameter Dim Type As String = Parameter("Type") Dim LoadSize As Integer = Parameter("Size") Dim TravelSize As String = Parameter("Travel") RefDocName = "C:\Temp\new.iam" Dim oRefDoc As Document = ThisApplication.Documents.Open(RefDocName, True) Dim Name As String = oRefDoc.DisplayName
oRefDoc.Activate parameter(Name, "HGR") = LoadSize parameter(Name, "TRV") = TravelSize End Sub
Solved! Go to Solution.