Community
Inventor Forum
Welcome to Autodesk’s Inventor Forums. Share your knowledge, ask questions, and explore popular Inventor topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Importing title blocks from other idw

12 REPLIES 12
SOLVED
Reply
Message 1 of 13
InventorPortugal
13863 Views, 12 Replies

Importing title blocks from other idw

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?

Autodesk Product Design Suite 2012 Ultimate
Autodesk Developer Network
http://www.inventorportugal.blogspot.com
Tags (1)
12 REPLIES 12
Message 2 of 13

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

http://inventortrenches.blogspot.com/

Message 3 of 13

Thank you.
Anyway I still think Autodesk should improve title block management in Inventor.

Autodesk Product Design Suite 2012 Ultimate
Autodesk Developer Network
http://www.inventorportugal.blogspot.com
Tags (1)
Message 4 of 13

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

Message 5 of 13
streharg
in reply to: InventorPortugal

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!

PDSU 2016
4790K, 32 Gb ram, GTX 960 ...
Fancy HP LCD
🙂
Message 6 of 13
swhite
in reply to: InventorPortugal

Save the title block you want as a template, and will be available for all future drawings.

Steven White
Lee C. Moore, Inc.
www.lcm-wci.com
Inventor 2011
Intel Dual Xeon E31225 @ 3.1 GHz CPU
16 GB RAM
NVIDIA Quadro 600 GPU
Windows 7 - 64 Bit
Message 7 of 13
ruairi.mulligan
in reply to: streharg

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?

Message 8 of 13
streharg
in reply to: ruairi.mulligan

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 codingCat Very Happy

 

 

 

 

 

 

PDSU 2016
4790K, 32 Gb ram, GTX 960 ...
Fancy HP LCD
🙂
Message 9 of 13
ruairi.mulligan
in reply to: streharg

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.

 

 

Message 10 of 13
streharg
in reply to: ruairi.mulligan

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

PDSU 2016
4790K, 32 Gb ram, GTX 960 ...
Fancy HP LCD
🙂
Message 11 of 13
babijay43
in reply to: Mzurector

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

Message 12 of 13
SBix26
in reply to: babijay43

@babijay43 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
Autodesk_Inventor_Certified_Professional_Badge.png

Message 13 of 13

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.

Post to forums  

Autodesk Design & Make Report