Ilogic parameters

Ilogic parameters

bronc3buster842001
Advocate Advocate
464 Views
3 Replies
Message 1 of 4

Ilogic parameters

bronc3buster842001
Advocate
Advocate

How do I use parameters in this code to save as file name. DIAXLENGTH needs to be the value in the parameters. So say 5x11

 

NewFileName = ThisDoc.Path & "\" & "DIAxLENGTH.ipt"

ThisDoc.Document.SaveAs(NewFileName,True)

 

0 Likes
Accepted solutions (1)
465 Views
3 Replies
Replies (3)
Message 2 of 4

Ralf_Krieg
Advisor
Advisor
Accepted solution

Hello

 

If the parameter names are DIA and LENGTH then

NewFileName = ThisDoc.Path & "\" & DIA & "x" & LENGTH & ".ipt"

ThisDoc.Document.SaveAs(NewFileName,True)

R. Krieg
RKW Solutions
www.rkw-solutions.com
0 Likes
Message 3 of 4

bronc3buster842001
Advocate
Advocate

Thank you. Works perfect.

0 Likes
Message 4 of 4

A.Acheson
Mentor
Mentor

And to add to the code by @Ralf_Krieg  which would be for an internal rule, the below are for external rules where you have to refer to the parameter using parameter snippet found here.

 

AAcheson_0-1641146245538.png

NewFileName = ThisDoc.Path & "\" & Parameter("DIA") & "x" & Parameter("LENGTH") & ".ipt"
MessageBox.Show(NewFileName, "Title")
ThisDoc.Document.SaveAs(NewFileName,True)

Or by using variables declared as string you can reuse the parameters and can make it easier to read,navigate and update. 

Dim oDia,oLength As String
oDia = Parameter("DIA")
oLength = Parameter("LENGTH") 

NewFileName = ThisDoc.Path & "\" & oDia & "x" & oLength & ".ipt"
MessageBox.Show(NewFileName, "Title")
ThisDoc.Document.SaveAs(NewFileName,True)

 

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
0 Likes