Hello anyone have a rule that will copy a specific sheet from a specific drawing and insert it into the active drawing? I am trying to get around some of the limitations with Inventor Template files
thank you in advanced
Solved! Go to Solution.
Solved by J-Camper. Go to Solution.
Solved by JhoelForshav. Go to Solution.
Regards,
Arthur Knoors
Autodesk Affiliations:
Autodesk Software:Inventor Professional 2024 | Vault Professional 2022 | Autocad Mechanical 2022
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: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 !
This is what i originally tried but i was having difficulty getting it to work
I am probably missing something stupid, i am new to ilogic
the drawing i want the sheet copied from is C:\_VAULT_WORKSPACE\JOBS\Templates\tag Testing (Tony).idw
The Sheet I want is called "Tags" on the above drawing
If ThisApplication.ActiveDocumentType <> DocumentTypeEnum.kDrawingDocumentObject Then MsgBox("This rule '" & iLogicVb.RuleName & "' only works for Drawing Documents.",vbOK, "WRONG DOCUMENT TYPE") Return End If Dim oDDoc As DrawingDocument = ThisDrawing.Document Dim oOtherDocPath As String = "C:\_VAULT_WORKSPACE\JOBS\Templates\tag Testing (Tony).idw" Dim oOtherDrawing As DrawingDocument = ThisApplication.Documents.Open(oOtherDocPath,False) For Each oSheet As Sheet In oDDoc.Sheets If oSheet.Name.Contains("Tags") Then oSheet.CopyTo(oOtherDrawing) End If Next
It looks like you just got the two drawing documents mixed up.
Is this what you want? 🙂
If ThisApplication.ActiveDocumentType <> DocumentTypeEnum.kDrawingDocumentObject Then MsgBox("This rule '" & iLogicVb.RuleName & "' only works for Drawing Documents.",vbOK, "WRONG DOCUMENT TYPE") Return End If Dim oDoc As DrawingDocument = ThisDoc.Document Dim oOtherDocPath As String = "C:\_VAULT_WORKSPACE\JOBS\Templates\tag Testing (Tony).idw" Dim oOtherDrawing As DrawingDocument = ThisApplication.Documents.Open(oOtherDocPath, False) For Each oSheet As Sheet In oOtherDrawing.Sheets If oSheet.Name.StartsWith("Tags") Then oSheet.CopyTo(oDoc) Next oDoc.Update ThisApplication.Documents.CloseAll(True)
Jhoel Forshav
Download my free Inventor Addin - Hole Projector
LinkedIn | Ideas | Contributions | Blog posts | Website
It was pretty simple, you just needed to swap with drawing to look through and which drawing to copy to:
If ThisApplication.ActiveDocumentType <> DocumentTypeEnum.kDrawingDocumentObject Then
MsgBox("This rule '" & iLogicVb.RuleName & "' only works for Drawing Documents.",vbOK, "WRONG DOCUMENT TYPE")
Return
End If
Dim oDDoc As DrawingDocument = ThisDrawing.Document
Dim oOtherDocPath As String = "C:\_VAULT_WORKSPACE\JOBS\Templates\tag Testing (Tony).idw"
Dim oOtherDrawing As DrawingDocument = ThisApplication.Documents.Open(oOtherDocPath,False)
For Each oSheet As Sheet In oOtherDrawing.Sheets
If oSheet.Name.Contains("Tags") Then
oSheet.CopyTo(oDDoc)
End If
Next
Hahah, sorry @J-Camper , but at least both our answers got accepted as solutions 😄
Jhoel Forshav
Download my free Inventor Addin - Hole Projector
LinkedIn | Ideas | Contributions | Blog posts | Website
Yeah no worries @JhoelForshav , I thought it was funny to happen twice within the hour haha
Can't find what you're looking for? Ask the community or share your knowledge.