Inventor General Discussion

Inventor General Discussion

Reply
Mentor
waynehelley
Posts: 151
Registered: ‎09-10-2012
Message 1 of 1 (505 Views)

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

505 Views, 0 Replies
11-23-2012 12:31 AM

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 2013
Windows 7 Enterprise, 64-bit
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are You Going To Be @ AU 2014? Feel free to drop by our AU topic post and share your plans, plug a class that you're teaching, or simply check out who else from the community might be in attendance. Ohh and don't forgot to stop by the Autodesk Help | Learn | Collaborate booths in the Exhibit Hall and meet our community team if you get a chance!