Message 1 of 7
Import sketched symbol from a new existing template into an older drawing

Not applicable
09-18-2015
09:59 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
We have redesigned the format of our drawings, so we've created a new title block and sketched symbols, etc.
The problem is that we have to update all the old drawings to use the new format as well. I've figured out how to reliably import the new title block, but I'm trying to get a tolerance block from the new template inserted into the old drawing. Here's the code I have:
SyntaxEditor Code Snippet
FileLocation = "C:\Vault\TEMPLATES\CURRENT TEMPLATE TEST\" ThisDrawing.ResourceFileName = FileLocation + "IPS Machined Comp.idw" ThisDrawing.KeepExtraResources = True ActiveSheet.TitleBlock = "MKS IPS" '========================================================='vvv this section isn't working vvv'========================================================= Dim oDrawDoc As DrawingDocument oDrawDoc = ThisDrawing.Document Dim oSketchedSymbolDef As SketchedSymbolDefinition oSketchedSymbolDef = oDrawDoc.SketchedSymbolDefinitions.Item("TIGHT TOLERANCE BLOCK") Dim oSheet As Sheet oSheet = oDrawDoc.ActiveSheet Dim sPromptStrings(0) As String sPromptStrings(0) = "A" oSheet.SketchedSymbols.Add(oSketchedSymbolDef, _ ThisApplication.TransientGeometry.CreatePoint2d(ActiveSheet.Width - 8.9, 2.16),0, 1, sPromptStrings) '========================================================='^^^ this section isn't working ^^^'========================================================= If ActiveSheet.Size < "C" Then ' "A"<"B"<"C"<"D" ActiveSheet.ChangeSize("C", MoveBorderItems := True) End If