Right now I'm copying it from one file to the other... but I'm sure there is some other way. Are title blocks saved anywhere other than embebed in the file?
Solved! Go to Solution.
Solved by Curtis_Waguespack. Go to Solution.
Hi Rubenfreire,
The titleblock definition resides in the drawing file itself, so you can't copy it in from an external source file, other than doing it as you have been doing. By a simply using Copy and Paste from a drawing that contains the version of the titleblock you want to use.
However, if you have the need to change the titleblock for many files at once, Autodesk provides a utility called the Drawing Resource Transfer Wizard to do so. This utility installs with Inventor and can be accessed by first closing Inventor, and then going to:
Start menu > Programs > Autodesk > Autodesk Inventor [version] > Tools > Drawing Resource Transfer Wizard
Once the Drawing Resource Transfer Wizard is open you will choose a source file and then select the file or files you want to copy to. You can use this to copy sketched symbols, borders and page layouts as well.
I hope this helps.
Good luck with all of your Inventor pursuits,
Curtis
Thank you.
Anyway I still think Autodesk should improve title block management in Inventor.
Hello. Yes there is a way to import title blocks. When having an idw file active go to Manage - Title block - ACAD (Insert tab). I use Inventor 2012
Autodesk should improbe this, yes.....
But, if you know iLogic, here's some:
Sub Main()
If ThisApplication.ActiveDocument Is Nothing Or ThisApplication.ActiveDocumentType <> kDrawingDocumentObject Then
MsgBox ("Please open a Drawing to work on.")
Exit Sub
End If
'reference template
ThisDrawing.ResourceFileName = "\\vault\Inventor\Templates\template.idw"
ThisDrawing.KeepExtraResources = False
Dim oDrawingDoc As Inventor.DrawingDocument: oDrawingDoc = ThisApplication.ActiveDocument
Dim SheetNumber As Integer
'Clear out the old Titleblocks & Sheetformats
For SheetNumber = 1 To oDrawingDoc.Sheets.Count
oDrawingDoc.Sheets(SheetNumber).Activate
If Not oDrawingDoc.ActiveSheet.TitleBlock Is Nothing Then
oDrawingDoc.ActiveSheet.TitleBlock.Delete
End If
Next SheetNumber
'Delete the previous title blocks as the API does not support replacing Sheet Formats.
'DeleteSheetFormatsAll (oDrawingDoc)
'DeleteBorders (oDrawingDoc)
DeleteTitleBlocks (oDrawingDoc)
Dim resu1t As String="Result"
Dim T1TLE As New ArrayList
T1TLE.Add("titleblockA")
T1TLE.Add("titleblockB")
resu1t=InputListBox("Select Drawing Title Block", T1TLE, resu1t, _
Title := "Title Block", ListName := "Title Blocks from Template")
'Set iProperties based On the selection.
If resu1t="titleblockA" Then
ActiveSheet.TitleBlock = "titleblockA"
' 'End If
ElseIf resu1t="titleblockB" Then
ActiveSheet.TitleBlock = "titleblockB"
' 'End If
End If
End Sub
Sub DeleteTitleBlocks(oActiveDoc As Inventor.DrawingDocument)
'Iterate through the collection deleting any titleblocks that are not referenced by the drawing object
Dim oTitle As TitleBlockDefinition
For Each oTitle In oActiveDoc.TitleBlockDefinitions
If oTitle.IsReferenced = False Then
oTitle.Delete
End If
Next
End Sub
It's not the most beautiful, but it does work. But someone more experience in iLogic is welcome to improve it, and share it back here!
Hi Streharg,
Thanks for sharing your code. It works great but I was wondering is it possible to make a small adjustment to import multiple title blocks? We use 3 title blocks for assemblies, sheet metal parts & solid parts.
If I had multiple sheets in a drawing and decided to wipe all the title blocks, it will only replace the active sheet with the replacement title block selected.
I used your code and added a second rule that would allow me to import a different title block for a specific sheet. However, this is not ideal, as I need to have 3 sheets and to import all title blocks individually.
Is it possible to simultaneously import the 3 title blocks we have in our default template?
Hey ruairi.mulligan!
It is possible to import multiple title blocks. At work we have 2 title blocks, and when ilogic rule is triggered, dialog is displayed, and you can choose which title block you want to insert. You can do it sheet by sheet (from first to last one), or all sheets in one go. With little bit of complication it's possible to automate the process.
So you want to import 3 title blocks, and then manually put a title block on a sheet?
If so, I can look for the code on Monday, I have nothing at home, and know nothing by heart, since I'm a noobie in coding
Thanks Streharg,
Yeh, I'm looking to import all our title block versions and then be able to define the specific title block.
I'm hoping to sandardise all the drawing files in this manner.
Here's the code i use. I did get it on this forum, but tweaked it a little.
Sub Main()
'Check if the document is drawing
If ThisApplication.ActiveDocument Is Nothing Or ThisApplication.ActiveDocumentType <> kDrawingDocumentObject Then
MsgBox ("Please open a Drawing to work on.")
Exit Sub
End If
Dim oDrawingDoc As Inventor.DrawingDocument: oDrawingDoc = ThisApplication.ActiveDocument
Dim SheetNumber As Integer
'TITLEBLOCK
result = MessageBox.Show("Do You wish to Insert new Title block?", "Insert Title block", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
If result = "6" Then
'Clear out the old Titleblocks
For SheetNumber = 1 To oDrawingDoc.Sheets.Count
oDrawingDoc.Sheets(SheetNumber).Activate
If Not oDrawingDoc.ActiveSheet.TitleBlock Is Nothing Then
oDrawingDoc.ActiveSheet.TitleBlock.Delete
End If
Next SheetNumber
'Delete the previous title blocks as the API does not support replacing Sheet Formats.
DeleteTitleBlocks (oDrawingDoc) 'CALLING SUBROUTINE
'reference template
ThisDrawing.ResourceFileName = "\\vault\Inventor\Templates\Standard.idw"
ThisDrawing.KeepExtraResources = False
For Each oSheet In oDrawingDoc.Sheets
oSheet.Activate
Dim result1 As String="Result"
Dim TITLE As New ArrayList
TITLE.Add("Weldment")
TITLE.Add("Assembly")
result1=InputListBox("Select Drawing Title Block", TITLE, result1, _
Title := "Title Block", ListName := "Title Blocks from Template")
'Set iProperties based On the selection.
If result1="Weldmend" Then
ActiveSheet.TitleBlock = "Weldmend"
ElseIf result1="Assembly" Then
ActiveSheet.TitleBlock = "Assembly"
End If
Next
iLogicVb.UpdateWhenDone = True
ActiveSheet = ThisDrawing.Sheet("Sheet:1")
ThisApplication.ActiveView.Fit
End If
End Sub
'subroutine
Sub DeleteTitleBlocks(oActiveDoc As Inventor.DrawingDocument)
'Iterate through the collection deleting any titleblocks that are not referenced by the drawing object
Dim oTitle As TitleBlockDefinition
For Each oTitle In oActiveDoc.TitleBlockDefinitions
If oTitle.IsReferenced = False Then
oTitle.Delete
End If
Next
End Sub
This code delete all title blocks, and then, sheet per sheet, asks you which (new) title block you want to place.
You can add as many title blocks you want.
Greg
My apologies for replying to such an old post. Was curious to know if you had some insight on importing assemblies into Inventor 2012 from other cad programs? Im doing that now and am having issues with not all subassemblies and part drawings importing. Have you experienced any issues similar to this?
Candace
@Anonymous please start a new topic. What you're asking has nothing at all to do with the topic of this thread, so it just confuses things.
Edit: never mind, I see that you did...
Sam B
Inventor Professional 2016 R3 SP1 Update 1
Vault Basic 2016 SP1
Windows 7 Enterprise 64-bit, SP1
Hi All
Im only new to Inventor. I have found a iLogic rule to import the title block from a template but it wont import the border I created in the template also. can someone please help
here it the rule that is working so far.
SyntaxEditor Code Snippet
Sub Main() If ThisApplication.ActiveDocument Is Nothing Or ThisApplication.ActiveDocumentType <> kDrawingDocumentObject Then MsgBox ("Please open a Drawing to work on.") Exit Sub End If 'reference template ThisDrawing.ResourceFileName = "D:\Inventor\AWE Drawing.idw" ThisDrawing.KeepExtraResources = False Dim oDrawingDoc As Inventor.DrawingDocument: oDrawingDoc = ThisApplication.ActiveDocument Dim SheetNumber As Integer 'Clear out the old Titleblocks & Sheetformats For SheetNumber = 1 To oDrawingDoc.Sheets.Count oDrawingDoc.Sheets(SheetNumber).Activate If Not oDrawingDoc.ActiveSheet.TitleBlock Is Nothing Then oDrawingDoc.ActiveSheet.TitleBlock.Delete End If Next SheetNumber 'Delete the previous title blocks as the API does not support replacing Sheet Formats.'DeleteSheetFormatsAll (oDrawingDoc)'DeleteBorders (oDrawingDoc) DeleteTitleBlocks (oDrawingDoc) Dim resu1t As String="Result" Dim T1TLE As New ArrayList T1TLE.Add("AWE Title Block") resu1t=InputListBox("Select Drawing Title Block", T1TLE, resu1t, _ Title := "Title Block", ListName := "Title Blocks from Template") 'Set iProperties based On the selection. If resu1t="AWE Title Block" Then ActiveSheet.TitleBlock = "AWE Title Block" ' 'End If End If End Sub Sub DeleteTitleBlocks(oActiveDoc As Inventor.DrawingDocument) 'Iterate through the collection deleting any titleblocks that are not referenced by the drawing object Dim oTitle As TitleBlockDefinition For Each oTitle In oActiveDoc.TitleBlockDefinitions If oTitle.IsReferenced = False Then oTitle.Delete End If Next End Sub
Can't find what you're looking for? Ask the community or share your knowledge.