Vault Lifecycle State of model through drawing

Edward_Lowe
Enthusiast

Vault Lifecycle State of model through drawing

Edward_Lowe
Enthusiast
Enthusiast

Good Afternoon Fellow Designers, 

 

I came across the following code that extracts the vault lifecycle state of a part (.ipt) or assembly (.iam) from the model file. 

  AddReference "Autodesk.Connectivity.WebServices.dll"
Imports AWS = Autodesk.Connectivity.WebServices
AddReference "Autodesk.DataManagement.Client.Framework.Vault.dll"
Imports VDF = Autodesk.DataManagement.Client.Framework
AddReference "Connectivity.Application.VaultBase.dll"
Imports VB = Connectivity.Application.VaultBase

Dim mVltCon As VDF.Vault.Currency.Connections.Connection
mVltCon = VB.ConnectionManager.Instance.Connection
 
If  mVltCon Is Nothing Then
     Messagebox.Show("Not Logged In to Vault! - Login first and repeat executing this rule.")
     Exit Sub
End If

Dim VaultPath As String = ThisDoc.PathAndFileName(True)
VaultPath = VaultPath.Replace("C:\$WorkingFolder\", "$/")
'flip the slashes
VaultPath = VaultPath.Replace("\", "/")

Dim VaultPaths() As String = New String() {VaultPath}
 
Dim wsFiels() As AWS.File = mVltCon.WebServiceManager.DocumentService.FindLatestFilesByPaths(VaultPaths)
 
Dim mFileIt As VDF.Vault.Currency.Entities.FileIteration = New VDF.Vault.Currency.Entities.FileIteration(conn,wsFiels(0))
Dim lifeCycleInfo As VDF.Vault.Currency.Entities.FileLifecycleInfo = mFileIt.LifecycleInfo

Messagebox.Show(lifeCycleInfo.Statename)

 

Source: Connecting vault and accessing vault file status through Inventor iLogic

By Chandra shekar Gopal

 

Could one of my fellow coder's tell me how to modify this code so that I can see the state of the model from the drawing file? 

Thank you

Regards,

Edward

0 Likes
Reply
1,234 Views
16 Replies
Replies (16)

bradeneuropeArthur
Mentor
Mentor
If you use Vault basic, this is not supported by the API.
With Vault workgroup and professional this is possible to do.
Please let me know if it makes sense to start this and what version of vault you use.

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background
Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


EESignature

Edward_Lowe
Enthusiast
Enthusiast

Hello bradeneuropeArthur,

 

I keep forgetting to put my software into my posts.  I'm operating Inventor Professional 2020 and Vault Workgroup 2020.  I get the impression you have experience and possibly a solution to my question.  I look forward to your reply, Regards,

Edward

bradeneuropeArthur
Mentor
Mentor

Will have a look!

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background
Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


EESignature

bradeneuropeArthur
Mentor
Mentor

Is this what you need to see in Inventor?

bradeneuropeArthur_0-1668894260197.png

Regards,

Arthur Knoors

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background
Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


EESignature

Edward_Lowe
Enthusiast
Enthusiast

Hello Arthur,

 

I have taken a screenshot from my version of vault.  I think essentially you are correct in so much as it is the vault lifecycle state that I need to extract from the model via (through) the drawing.  Here is my screenshot: 

Edward_Lowe_0-1668902289563.png

Thank you for your help,

Regards,

Edward

0 Likes

bradeneuropeArthur
Mentor
Mentor
Keep on reading.
I will create you an addin.
Regards,
Arthur Knoors

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background
Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


EESignature

bradeneuropeArthur
Mentor
Mentor

Hi @Edward_Lowe ,

While programming for you add-in I was thinking.

You can achieve that also without programming if you want, with the use of Vault.

Would this be ok for you too?

Before I proceed an put effort in the add-in I am curious if this is sufficient for you.

 

Regards,

 

Arthur

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background
Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


EESignature

Edward_Lowe
Enthusiast
Enthusiast

Good Morning bradeneuropeArthur,

I would like to be greedy and ask for you to show me both ways.  The ilogic route may be preferable from the point of view I want to start the rule via the ‘Open document’ event trigger.  Secondly the rule must be able to hand over to the next rule.  I would be interested to know the non-programming route from my own personal learning.  If you can tell me the non-programming route can achieve the same outcome and is the better route to take then I’ll happily use this method.  I sent you a private message yesterday to outline what I am trying to achieve.  If you have any further questions please get back to me? Regards, Edward

0 Likes

bradeneuropeArthur
Mentor
Mentor

@Edward_Lowe I have the add-in ready.

Is it fine to use these properties:

bradeneuropeArthur_0-1670006115430.png

I read now from the model in the drawing the Vault status into the:

Status

Designs State

Please let me know if this is ok.

Regards,

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background
Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


EESignature

0 Likes

Edward_Lowe
Enthusiast
Enthusiast

Good Morning Arthur,

It looks to me like you have created some code that transposes the lifecycle status from vault into status and design status in the iproperties in inventor.

The company I represent has a unique design process.  At the start of the order process a generic model is used to pictorially represent the product the customer is purchasing.  The annotations provide the specific details.  Based on this drawing the customer will approve the order which becomes live.  The design team use the design state in iproperties to confirm the customer approval status.  

Is it possible to use just the status iproperty for the purpose of this task?

Thanks and Regards,

Edward

0 Likes

bradeneuropeArthur
Mentor
Mentor

So only fill in the status I property in the drawing based on the status of the model behind the drawing, correct?

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background
Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


EESignature

0 Likes

Edward_Lowe
Enthusiast
Enthusiast

Correct 😊

0 Likes

bradeneuropeArthur
Mentor
Mentor
I will update and share it

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background
Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


EESignature

0 Likes

bradeneuropeArthur
Mentor
Mentor

@Edward_Lowe 

as promised, please try the following Add-in.

It will run as requested on file-open drawing file.

 

Place the complete unziped folder in:

C:\Users\"USERNAME"\AppData\Roaming\Autodesk\ApplicationPlugins

 

Let me know if you have further questions.

 

Regards,

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background
Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


EESignature

0 Likes

Edward_Lowe
Enthusiast
Enthusiast

Good Morning Arthur,

 

I have just sent you a private message.  I can't open rar files on this work pc.  Would it be possible to compress the code into a zip file?  I know I can open this type of file,

 

Thanks and Regards,

 

Edward

0 Likes

bradeneuropeArthur
Mentor
Mentor

Sure.

Hope this add-in works for you.

 

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background
Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


EESignature