is there a why to change Promt or not being Promt at all, when running ilogic?

is there a why to change Promt or not being Promt at all, when running ilogic?

Darkforce_the_ilogic_guy
Advisor Advisor
2,698 Views
9 Replies
Message 1 of 10

is there a why to change Promt or not being Promt at all, when running ilogic?

Darkforce_the_ilogic_guy
Advisor
Advisor

is there a why to change Promt or not being Promt at all, when running ilogic?  I have a code that open some drawing. but get block form this 2 dialogboxes ... is there any way around this ? try using ThisApplication.Documents.Open(NewFileName, False)  but it make the program save the 3d assembly as PDF insted of idw of all Drawing.. inventor sliens mode dont seems to work but it might be a promt form vault and not inventor.  

 

 

Darkforce_the_ilogic_guy_0-1726663372325.png

 

0 Likes
Accepted solutions (1)
2,699 Views
9 Replies
Replies (9)
Message 2 of 10

Darkforce_the_ilogic_guy
Advisor
Advisor

this is the setting i need to have when running the ilogic code

Darkforce_the_ilogic_guy_0-1726665136313.png

all other time both are setup to Always prompt  Response = yes.    This is something that is only done maybe ones a month t that why i would like it to be part of the coe

0 Likes
Message 3 of 10

JelteDeJong
Mentor
Mentor
Accepted solution

You could try to disable the vault addin at the beginning of your rule and enable it again when you are finished. Something like this:

Public Class ThisRule

    Private vaultAddinID As String = "{48B682BC-42E6-4953-84C5-3D253B52E77B}"
    Private vaultAddin As ApplicationAddIn

    Sub Main()
        vaultAddin = ThisApplication.ApplicationAddIns.ItemById(vaultAddinID)
        vaultAddin.Deactivate()

        MsgBox("Do you actions here")

        vaultAddin.Activate()
    End Sub
End Class

 

Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Blog: hjalte.nl - github.com

Message 4 of 10

Darkforce_the_ilogic_guy
Advisor
Advisor

it seens to work for this post 🙂

 

 

I still have a lillte problem with my code that on some assembly it stop/ or loop or something.. It keep standing like this

 

Darkforce_the_ilogic_guy_0-1726733474179.png

 

0 Likes
Message 5 of 10

pball
Mentor
Mentor

Just a word of warning, if you disable and enable the Vault addin too many times in succession that can lead to Inventor crashing in my experience. Granted crashes normally occurred during large batch processes doing 50+ separate drawings and thus disabling/enabling Vault at least that many times.

Please vote for the idea post asking for API control over prompts.
https://forums.autodesk.com/t5/inventor-ideas/inventor-vault-prompts-settings-amp-vault-prompts-sett...

Check out my style edits for the Autodesk forums
pball's Autodesk Forum Style

Userscript to edit forum links to jump to first unread post
Jump To First Post Userscript
0 Likes
Message 6 of 10

g.georgiades
Advocate
Advocate

The way to change Vault prompts via the API is already available. It is directly linked to the vault API, it is not managed by the Inventor Vault addin.

 

It is a little different than what I mention in this post as the prompts are handled quite differently.

https://forums.autodesk.com/t5/inventor-programming-ilogic/vaultoption/m-p/12579310/highlight/true#M...

 

Here is an example that will change the File Edit Prompt

ggeorgiades_2-1726753175208.png

Imports Autodesk.DataManagement.Client.Framework.Forms
Imports Autodesk.DataManagement.Client.Framework.Forms.Currency
AddReference "Autodesk.DataManagement.Client.Framework.Forms.dll"


Dim promptDefinitions = Library.PromptService.GetPromptDefinitions()

Dim fileEditPromptDefinition = promptDefinitions.Where(Function(p) p.PromptId = "CheckOutOnFileEdit").First()
Dim fileEditPromptConfig = Library.PromptService.GetConfiguration(fileEditPromptDefinition)

fileEditPromptConfig.UserAnswer = PromptAnswer.No
fileEditPromptConfig.PromptInstruction = PromptInstruction.PromptNever

Library.PromptService.SetConfiguration(fileEditPromptDefinition, fileEditPromptConfig)

 

You can find all of the prompt IDs in the Inventor Vault Application Preferences XML file that I mention in the other post. The prompts are shown under the VDFPrompts section and the prompt ids are the token before the underscores.

 

The process should be basically the same in the vault client with a client extension.

 

ggeorgiades_1-1726752433366.png

 

0 Likes
Message 7 of 10

Darkforce_the_ilogic_guy
Advisor
Advisor

what I did was just do it an the start and the end of the code. I just made 1080 PDF files in under an Hour that it did not crash

0 Likes
Message 8 of 10

pball
Mentor
Mentor

That's the smarter way to do it. I was unloading/loading after each export as my code would download any drawings from Vault if they weren't already downloaded. I could have probably looped through and downloaded anything required and then unloaded Vault and processed everything, but I was lazy and it then it crashed often.

Check out my style edits for the Autodesk forums
pball's Autodesk Forum Style

Userscript to edit forum links to jump to first unread post
Jump To First Post Userscript
0 Likes
Message 9 of 10

Skadborg.NTI
Advocate
Advocate

This is very helpful; thank you.

I have encapsulated it and saved it to my general code library. In case anyone else finds it useful, here’s how it looks:

Option Explicit On
Imports Autodesk.DataManagement.Client.Framework.Forms
Imports Autodesk.DataManagement.Client.Framework.Forms.Currency
AddReference "Autodesk.DataManagement.Client.Framework.Forms.dll"

Sub Main
	VaultPrompts_Disable
	' Undisturbed area
	VaultPrompts_Enable
End Sub

Sub VaultPrompts_Disable
	' Adjust to your needs
	SetVaultPrompt(VaultPromptId.CheckOutOnFileEdit, PromptInstruction.PromptNever, PromptAnswer.No)
	SetVaultPrompt(VaultPromptId.OpenFromVaultNotCheckedOut, PromptInstruction.PromptNever, PromptAnswer.No)
	SetVaultPrompt(VaultPromptId.IDS_ONRESOLVEFROMVAULT_REV, PromptInstruction.PromptNever, PromptAnswer.Yes)
	SetVaultPrompt(VaultPromptId.IDS_CHECKOUT_LOCKED_WARN, PromptInstruction.PromptNever, PromptAnswer.Yes)
End Sub

Sub VaultPrompts_Enable
	' Edit code, so it resets what wass disabled in Sub VaultPrompts_Disable
	SetVaultPrompt(VaultPromptId.CheckOutOnFileEdit, PromptInstruction.PromptAlways, PromptAnswer.Yes)
	SetVaultPrompt(VaultPromptId.OpenFromVaultNotCheckedOut, PromptInstruction.PromptAlways, PromptAnswer.Yes)
	SetVaultPrompt(VaultPromptId.IDS_ONRESOLVEFROMVAULT_REV, PromptInstruction.PromptAlways, PromptAnswer.Yes)
	SetVaultPrompt(VaultPromptId.IDS_CHECKOUT_LOCKED_WARN, PromptInstruction.PromptAlways, PromptAnswer.No)
End Sub


Enum VaultPromptId
	CheckOutProperties					' Some properties may be out of date. Do you want to update properties?
	CheckOutOnFileEdit					' File '{0}' is not checked out. Do you want to check it out?
	OpenFromVaultNotCheckedOut			' File(s) are not checked out. Do you want to check them out?
	DownloadConfirmReplaceCheckedOut	' File '{0}' is checked out to you. Are you sure you want to overwrite it with data from vault?
	IDS_ONRESOLVEFROMVAULT_REV			' File '{0}' is missing from your workspace. Would you like to download it from the vault?
	DownloadConfirmReplaceLocalEdits	' Local file {0} has been modified.
	CheckInOnClose						' File '{0}' is checked out to you. Do you want to check it in?
	CheckInSave							' '{0}' must be saved before it can be checked in. Do you want to save and continue?
	IDS_CHECKOUT_LOCKED_WARN			' '{0}' is currently locked. Do you want to continue editing anyway?  Your changes will not get saved to the vault.
	IDS_CHECKOUT_OTHER_WARN				' '{0}' is checked out to another user. Do you want to continue editing anyway?  Your changes will not get saved to the vault.
	IDS_READONLY_WARN					' '{0}' is not vaulted, and file is read only.  Allow component editing?
	IDS_CHECKOUT_LOCATION_WARN			' '{0}' is checked out to you but at '{1}' Do you want to continue and edit anyway?
	SyncWithRemoteSite					' The file you are attempting to access has not yet been copied to your local server. The file is inaccessible until it has been copied. Wo
End Enum

Sub SetVaultPrompt(Id As VaultPromptId, Instruction As PromptInstruction, Answer As PromptAnswer)
	Dim promptDefinitions = Library.PromptService.GetPromptDefinitions()

	Dim fileEditPromptDefinition = promptDefinitions.Where(Function(p) p.PromptId = Id.ToString).First()
	Dim fileEditPromptConfig = Library.PromptService.GetConfiguration(fileEditPromptDefinition)

	fileEditPromptConfig.UserAnswer = Answer
	fileEditPromptConfig.PromptInstruction = Instruction

	Library.PromptService.SetConfiguration(fileEditPromptDefinition, fileEditPromptConfig)
End Sub	
Message 10 of 10

jake_egley
Advocate
Advocate

Is this code for vb or for ilogic? its all showing up red when I paste into either

Jake Egley
Inventor 2026
0 Likes