Titleblock with Prompted Texts got error when switch

Titleblock with Prompted Texts got error when switch

kevinNSZML
Contributor Contributor
367 Views
2 Replies
Message 1 of 3

Titleblock with Prompted Texts got error when switch

kevinNSZML
Contributor
Contributor

Hello, when I use the following iLogic code as my external rule, I got an error when I switch to other title blocks. If I delete all prompt entries from title blocks, then it works perfectly.

 

ThisDrawing.ResourceFileName = "D:\Inventor_Template\A4_Template.idw"
ActiveSheet.ChangeSize("A4")
ActiveSheet.ChangeSize(211,297)
ActiveSheet.TitleBlock = "AX_H"
ActiveSheet.Border = "A4_H"
ThisApplication.ActiveView.Fit


I have been using this code for more than a year, recently I added prompt texts to all title blocks. After I added it, I can't use illogic code to quickly switch. It always says an error occurred on this row: ActiveSheet.TitleBlock = "AX_H"
But, manually switching titleblocks is fine. Does anyone have an idea to figure out this problem? Thanks

 

(To be clear, prompt texts here means, https://help.autodesk.com/view/INVNTOR/2023/ENU/?guid=GUID-708CC945-36C4-4402-AB99-4403FFAB1878)

 

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

A.Acheson
Mentor
Mentor
Accepted solution

Hi @kevinNSZML 

From the activesheet you should have access to the "SetTitleBlock" method. This is where you can set the prompted entry titles. See ilogic API help here

Dim titleBlockName As String = "TitleBlockName"
Dim sPromptStrings(1) As String sPromptStrings(0) = "String 1" sPromptStrings(1) = "String 2"
ActiveSheet.SetTitleBlock(titleBlockName,sPromptStrings)

 

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

kevinNSZML
Contributor
Contributor
It works perfectly, thank you so much!