Changing title block
Changing title block
(OP)
My company has recently changed the title block format.
I would like to use some of the old drawings and replace the
old title block with the new one without losing any information, and eventually automatize this process. I know how to do this in AutoCAD (Autolisp) but not in SolidWorks.
Andrew (Netshop21)
andrew@netshop21.com
I would like to use some of the old drawings and replace the
old title block with the new one without losing any information, and eventually automatize this process. I know how to do this in AutoCAD (Autolisp) but not in SolidWorks.
Andrew (Netshop21)
andrew@netshop21.com






RE: Changing title block
If you are using the File/Properties for parts and assemblies, and are linking notes to them in the drafting environment, you can do the following;
Create your new drafting template. When you save this file, make sure that you ALSO click on File/Save Sheet Format. Now when you go into your existing drawings, you will have to edit the properties of each sheet. When you do, there is a dialog box. In the middle of the dialog box, you will see "Sheet Format". In the pull down, make sure that it says "Custom". In the field below, make sure that is pointing to your new template file, which in this case is actually the sheet format that you saved earlier. Click Ok.
This should change your sheet background. Unless you are not using the File/Properties for the parts and assemblies. If you are not, then sorry. I can't help you.
Jim Smithie, Webmaster
http://www.midrangecad.com
Free CAD evaluation kits and comparisons
RE: Changing title block
'-----------------------------------------------
' Swap Title Blocks
'-----------------------------------------------
Option Explicit
Dim swApp As Object
Dim Part As Object
Dim Sheet As Object
Sub Main()
Dim sSheetName As String, paperSize As Long, templateIn As Long
Dim scale1 As Double, scale2 As Double, firstAngle As Boolean
Dim templateName As String, width As Double, height As Double
Dim propertyViewName As String, ret1, ret2 As Boolean
Dim sTemplatePath As String
Set swApp = CreateObject("SldWorks.Application")
Set Part = swApp.ActiveDoc
Set Sheet = Part.GetCurrentSheet
'Get Current Properties
ret1 = Sheet.GetProperties
paperSize = ret1(0)
templateIn = ret1(1)
scale1 = ret1(2)
scale2 = ret1(3)
firstAngle = ret1(4)
width = ret1(5)
height = ret1(6)
sSheetName = Sheet.GetName
'Set New Template
sTemplatePath = "E:\Program Files\SolidWorks\data\Title-A.slddrt"
ret2 = Part.SetupSheet4(sSheetName, paperSize, templateIn, scale1, scale2, firstAngle, sTemplatePath, width, height, propertyViewName)
If ret2 = False Then
swApp.SendMsgToUser "Sheet Setup Failed"
End If
Set Sheet = Nothing
Set Part = Nothing
Set swApp = Nothing
End Sub
Hope this helps!
DimensionalSolutions@Core.com
While I welcome e-mail messages, please post all thread activity in these forums for the benefit of all members.
RE: Changing title block
Andrew
RE: Changing title block
1. Create a new drawing with Title1.slddrt
2. Add a custom property to the drawing
3. Save document
4. Run the program to switch to Title2.slddrt
The custom property for the drawing (file > properties) was still there.
Is there a setup difference between the two title blocks?
You can send me a sample if you wish. I may be able to look at it this week (by Wednesday).
DimensionalSolutions@Core.com
While I welcome e-mail messages, please post all thread activity in these forums for the benefit of all members.
RE: Changing title block
Andrew
RE: Changing title block
Viewer:
While “drawings” opened with the full SolidWorks Program will reflect changes made to the “part”, drawings opened with the SolidWorks Viewer will reflect the last saved “drawing” state.
If the SolidWorks Viewer is going to be used for viewing or printing drawings (desirable for cost and drawing control considerations) all linked drawing files must be opened and resaved after any changes to a part file, and/or drawing template file, to prevent reading or printing an outdated drawing. Use of the Viewer, in effect, defeats the associativity that is one of the strengths of the program.
Bottom line: I do not recommend using (or permitting the use of) the Viewer.
Template Changes:
In a similar vein, changes made to SolidWorks Drawing Template Files are not reflected in drawing files using that template, even after opening these files with the full SolidWorks Program and manually “forcing” a drawing “rebuild”.
This is an apparent “bug” in the program; I don’t know if it’s been addressed in 98 Plus. Template files in drawings can be replaced, however at the next drawing rebuild, all “Custom Properties” associated with the drawing will be overwritten. Changing the template causes the custom properties of the drawing to be overwritten with those associated with the particular drawing open at the last time the replacement template was saved. Options: 1) See if 98 Plus addresses this issue, or, 2) Don’t update templates, or, 3) Be aware that any custom properties in drawings will have to be manually re-entered and saved (tedious and error-prone).
RE: Changing title block
The surface finish in my title block is a note linked to custom property setup in the part. That note did show up after the swap. I looked at the differences between this note and the others. They were on a different layer:the note for surface finish was on Title text1 layer, all the others were on Title text2. I moved all of them on Title text1 and now they show up correctly after the swap.
Why the notes didn't show up when they were on Title text2 layer is still a mistery to me. If anybody has an explanation I would be happy to hear it.
There are still some weird things going on with this swap issue. I added to my program an option to replace a drawing with the sheet to none to my custom sheet format. The swap is done but the drawing is not updated untill I reload the sheet format. Anybody has an ideea why? And how to fix it?
Andrew/Netshop21