Community
Vault Customization
Share your knowledge, ask questions, and explore popular Vault API, Data Standard, and VBA topics related to programming, creating add-ins, or working with the Vault API.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Use ilogic/VBA to check a list of drawings into Vault

3 REPLIES 3
Reply
Message 1 of 4
waynehelley
1183 Views, 3 Replies

Use ilogic/VBA to check a list of drawings into Vault

Hi there,

 

I have a large set of drawings which are all very similar as they were created from the same iassembly factory.  I have been using ilogic to go through the set of drawings and make changes.  In the example below I have used ilogic to delete the current parts list and replace it with a corrected version:

DimiAsInteger
DimoMemberFileAsString

'Enter the last four digits of iAssembly members for which drawings will be generated
Fori=4982To5018

'Get the full file name of iAssembly member
oMemberFile="C:\ARTICULATE\09\090\09090GT0000023\09090G0010"&CStr(i)

ThisDoc.Launch(oMemberFile&".idw")

DimoDrawingDocAsDrawingDocument
oDrawingDoc=ThisApplication.ActiveDocument

DimoSheetAsSheet
oSheet=oDrawingDoc.ActiveSheet

'Delete the current parts list
DimoPartsListAsPartsList
oPartsList=oDrawingDoc.ActiveSheet.PartsLists.Item(1)
oPartsList.Delete

' Set a reference to the first drawing view on
' the sheet. This assumes the first drawing
' view on the sheet is not a draft view.
DimoDrawingViewAsDrawingView
oDrawingView=oSheet.DrawingViews(1)

' Set a reference to the sheet's border
DimoBorderAsBorder
oBorder=oSheet.Border

DimoPlacementPointAsPoint2d

xrev=oBorder.RangeBox.MaxPoint.X
yrev=oBorder.RangeBox.MaxPoint.Y

oPlacementPoint=ThisApplication.TransientGeometry.CreatePoint2d(xrev, yrev)

' Create the parts list.
DimoPartsList1AsPartsList
oPartsList1=oSheet.PartsLists.Add(oDrawingView, oPlacementPoint)
oPartsLis1t=oDrawingDoc.ActiveSheet.PartsLists.Item(1)
oPartsList1.Sort("ITEM", 1)

'Save copy as one new idw using the member name
oDrawingDoc.Save
oDrawingDoc.Close

Next

I want to add a line of code so that once the document has been saved, it will then be checked into Vault.  Is this possible using ilogic or would I have to use the VBA?

 

Thanks,

 

Wayne

Wayne Helley
Inventor 2013 Certified Professional

Autodesk Inventor Professional 2023
Visual Studio 2022
Windows 10 Pro, 64-bit
Tags (3)
3 REPLIES 3
Message 2 of 4
Cris_Davis
in reply to: waynehelley

Wayne, did you find a solutions for this request?

Message 3 of 4
waynehelley
in reply to: waynehelley

I didn't find a solution for this. To my understanding, it is not possible to access the commands of the Vault add-in from within an iLogic script.

It may be possible to achieve by accessing the Vault API, which will probably be a lot easier to do through a .NET application than iLogic or VBA.
Wayne Helley
Inventor 2013 Certified Professional

Autodesk Inventor Professional 2023
Visual Studio 2022
Windows 10 Pro, 64-bit
Message 4 of 4
psaarloos
in reply to: waynehelley

Hi,

 

What could be an easy approach is using the code as shown below in your iLogic code. It will basically just trigger the Check In command of the Vault Inventor add-in. If you check the 'Check In dialog' option in the 'Dialog Suppression' of the Vault Option, the check-in dialog won't be shown and the iLogic code will able to add or check in the document.

 

Dim controlDefAddFiles As ControlDefinition = ThisApplication.CommandManager.ControlDefinitions.Item("VaultCheckinTop")  'VaultAddFiles(")")
controlDefAddFiles.Execute()

Hope it helps!

Regards,
Pim Saarloos
Product Manager
If my post answers your question, please click the "Accept as Solution" button. Kudos are much appreciated!

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report