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
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!
Can't find what you're looking for? Ask the community or share your knowledge.