Message 1 of 5
Importing drawing resources
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Inventor 9 (not 2009)...
I have an old drawing, and I want to replace the Title block with that from our newer template.
If i just say :
Set oTitleBlock = oSheet.AddTitleBlock(oSourceFile.TitleBlockDefinitions("HCTitleBlock Metric")) then the correct titleblock is not added to the titleblock collection, and the text is formatted and placed incorrectly.
So how do "copy" drawing resources from one idw to another?
I have an old drawing, and I want to replace the Title block with that from our newer template.
Private Sub BorderTitleBlock()
Dim oIDWDoc As DrawingDocument
Set oIDWDoc = ThisApplication.ActiveDocument
Dim oSourceFile As DrawingDocument
Dim oSheet As Sheet
Dim oTitleBlock
Dim SourceFileName As String
Dim ActiveTitleBlockName As String
Dim oTBDef As TitleBlockDefinition
Dim bFound As Boolean
For Each oSheet In oIDWDoc.Sheets
Set oTitleBlock = oSheet.TitleBlock
ActiveTitleBlockName = oTitleBlock.Definition.Name
If ActiveTitleBlockName <> "HCTitleBlock Metric" Then
oTitleBlock.Delete
For Each oTBDef In oIDWDoc.TitleBlockDefinitions
If oTBDef.Name = "HCTitleBlock Metric" Then
bFound = True
Set oTitleBlock = oSheet.AddTitleBlock(oIDWDoc.TitleBlockDefinitions.Item("HCTitleBlock Metric"))
Exit For
End If
Next
If Not bFound Then
SourceFileName = "\\brisbane-fs01\CAD_SERV\Inventor\Templates9\Standard.idw"
Set oSourceFile = ThisApplication.Documents.Open(SourceFileName, False)
oIDWDoc.TitleBlockDefinitions.Add (oSourceFile.TitleBlockDefinitions("HCTitleBlock Metric")) 'this is incorrect... What should i have here?
Set oTitleBlock = oSheet.AddTitleBlock("HCTitleBlock Metric")
oSourceFile.Close
Set oSourceFile = Nothing
End If
End If
Next
End Sub
If i just say :
Set oTitleBlock = oSheet.AddTitleBlock(oSourceFile.TitleBlockDefinitions("HCTitleBlock Metric")) then the correct titleblock is not added to the titleblock collection, and the text is formatted and placed incorrectly.
So how do "copy" drawing resources from one idw to another?
=============================================
This is my signature, not part of my post.
This is my signature, not part of my post.