Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

Copy component drawing sheets to assembly drawing

mbreed5XTGY
Explorer

Copy component drawing sheets to assembly drawing

mbreed5XTGY
Explorer
Explorer

Hello! I am currently trying to create an iLogic rule that runs on a drawing of an assembly, goes through all of the components of that assembly, then copy and pastes the drawing sheets of those components into the main assembly drawing to make a packet that can be printed all at once.

 

The issue I am running into is how to best access the component drawing file paths - Currently, my idea was to use the parts list to get the component part numbers, but I cannot figure out how to access their file paths without prompting the user to explicitly type out each one, which is a huge pain when an assembly has a lot of components.

 

Assume that all of the drawings are downloaded locally on the user's computer and they are in the same folder as the part files for easier referencing (i.e. Item 1.ipt and Item 2.idw are in the same folder.)

 

Thanks in advance!

0 Likes
Reply
Accepted solutions (1)
230 Views
2 Replies
Replies (2)

A.Acheson
Mentor
Mentor
Accepted solution

Hi @mbreed5XTGY 

If the assembly is in the drawing then you can access the BOM or Document references of the assembly then produce a list. Once you get that far then you need to check if you have a drawing at that filepath, open and copy sheet etc. 

 

ModelDocument ilogic API help page

All Referenced Documents Inventor Api Help Page

 

 

Dim partsList as New List (Of String)
Dim modelDoc As AssemblyDocument = ThisDoc.ModelDocument
For Each doc As Document In modelDoc.AllReferencedDocuments

   If doc.DocumentType = DocumentTypeEnum.kPartDocumentObject _ 'Part
   AndAlso doc.IsModifiable  Then 'Not read only CC/Library document
    partsList.add(Doc.FullFileName)
   End If 
Next
d0 = InputListBox("Prompt", partsList, d0, Title := "Title", ListName := "List")

 

 

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
0 Likes

mbreed5XTGY
Explorer
Explorer
Perfect! This is exactly what I needed, thanks!
0 Likes