Monday 3 April 2017

Drawing Resource Transfer Wizard 2017 - Incorrect Font

Short and sweet again. No time for prelude.

If you use Drawing Resource Transfer Wizard 2017 to update title blocks for multiple drawings, text fonts would be changed incorrectly.

It is a known issue in 2017 and on Release 3 Update 1 still not working. 

Release 4 is around the corner (April release) and I was told it's fixed but till then or if we have a regression and this bug returns here is an ilogic code to automate this.

The Knowledge Base Article recommends updating manually each drawing ....hmmm... we can do better:

Dim oDestinationDocument As DrawingDocument
oDestinationDocument = ThisApplication.ActiveDocument

Dim oSourceDocument As DrawingDocument
oSourceDocument = ThisApplication.Documents.Open("D:\ADS\CAD\TEMPLATE.idw")
' Get the new source title block definition.
Dim oSourceTitleBlockDef As TitleBlockDefinition
oSourceTitleBlockDef = oSourceDocument.TitleBlockDefinitions.Item("TITLEBLOCK_NAME")
' Get the new title block definition.
Dim oNewTitleBlockDef As TitleBlockDefinition
oNewTitleBlockDef = oSourceTitleBlockDef.CopyTo(oDestinationDocument,True)'true to replace existing
' Iterate through the sheets, replace tibleblock with the one newly added.
Dim oSheet As Sheet
For Each oSheet In oDestinationDocument.Sheets
 Call oSheet.AddTitleBlock(oNewTitleBlockDef)
Use code Injector from here:
to update multiple files at once. There is no point to run it from the assembly (not in my case) because not all files are part of the same assembly.
photo credit: PeterThoeny Space and time warp (license)

No comments:

Post a Comment