Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X
Hi SolidWorkers,
I'd be interested to hear ideas or experiences of the following.
There's a requirement to change content in several hundreds - ie, active products - SolidWorks drawings or preferably only the published pdf of them. This is company logo and other information which does need to go through revisioning. Embedded in the .slddrw as block / .sldblk. A couple of different template sizes are used.
Currently we have wvs worker for SolidWorks setup to publish pdf and dxf at checkin, state change etc. There's no watermarking capabilities used. (11.1 M020, Creo View Adapters 8.1 on a virtual Win 10).
The pdf-files must be stored to the server, Creo View watermarking on the fly is not an option.
Discussed so far:
- implement pdf watermark solution to 'print over' the existing and republish
- use CustomTools Reload to change template. Here you'd need a script to rename the files in WC File vault to .slddrw, then run the CustomTools utility to change template, again rename back to WC file name.... then run republish. Does not sound really feasible or stress free 😅 though CustomTools -part worked fine for some files manually searched (sql) and renamed, even opened correctly in WWGM / SW after renaming back to what it's supposed to be in vault.
Appreciate your input.
Its been a bit since I had Solidworks data in my system. I've been through lots of company and logo changes in my years. If it works like Creo, the format which holds the logo will be referenced by the drawing and there should be an as-stored baseline created for publishing. I assume you are publishing as-stored which means if you update the format, publishing will still pull the original iteration of the format.
You could clear the history on that format which will force the publisher to pull the latest iteration and cause the new logo to be present. You will want to have the custom publish actions implemented to make this easier:
https://www.ptc.com/en/support/article/CS211115?source=search
This way, you can search on the drawings and trigger a republish job for them from a Search result. Does that work?
Thanks for the input! The article about the publish actions should come handy, had forgot about that already.
However, I've understood that SW does not work like Creo. Even though the path to the .sldblk-file containing the logo is referenced in the drawing sheet block properties the logo does not update to the drawings if the block was edited. You need to open each drawing to make a change. I'm not a SW user at all, don't really know the exact terms to use...
What I noticed though was that even though the original path to the .sdlblk has been changed - nobody really knows why - this has caused no issues. The old obsolete path was referenced in the drawing templates as well as all the existing drawings, but no complaints in SW when creating a new one or opening an old one.
Hi,
You can have an add-in that checks for drawing template version and update drawing sheets when necessary. We have it as a semi-manual action with checks upon drawing save, but I'm almost sure that it can be made automatic:
Dim Document As DrawingDoc
Document = iModel
'Sheet
Dim DRW_Sheet As Sheet
Dim vSheet As Object
Dim Sheet_Prop As Object
Dim Width As Double
Dim ConfigProp As CustomPropertyManager
ConfigProp = iModel.Extension.CustomPropertyManager("")
'Integer
Dim i As Integer
'Get Names of Sheets in Drawing
vSheet = Document.GetSheetNames
'Loop Through all Sheets
For i = 0 To UBound(vSheet)
'Activate Sheet
Document.ActivateSheet(vSheet(i))
'Get Sheet Properties
DRW_Sheet = Document.GetCurrentSheet 'Select Sheet
Sheet_Prop = DRW_Sheet.GetProperties() 'Read all Properties
Width = Sheet_Prop(5) 'Read Width
'Change Sheet Template
'Note: the format is changed to a temporary format with a unique name so that the sheet template actually updates
Try
If Width > 0.2 And Width < 0.23 Then 'A4
Document.SetupSheet5(vSheet(i), swDwgPaperSizes_e.swDwgPapersUserDefined, swDwgTemplates_e.swDwgTemplateCustom, Sheet_Prop(2), Sheet_Prop(3), False, SwAddin.ApplicationSharedLocaction & "\Non-preffered\A4 Drawing.slddrt", Sheet_Prop(5), Sheet_Prop(6), "Default", True)
ElseIf Width > 0.405 And Width < 0.435 Then 'A3
Document.SetupSheet5(vSheet(i), swDwgPaperSizes_e.swDwgPapersUserDefined, swDwgTemplates_e.swDwgTemplateCustom, Sheet_Prop(2), Sheet_Prop(3), False, SwAddin.ApplicationSharedLocaction & "Our Settings\A3 Drawing.slddrt", Sheet_Prop(5), Sheet_Prop(6), "Default", True)
ElseIf Width > 0.579 And Width < 0.609 Then 'A2
Document.SetupSheet5(vSheet(i), swDwgPaperSizes_e.swDwgPapersUserDefined, swDwgTemplates_e.swDwgTemplateCustom, Sheet_Prop(2), Sheet_Prop(3), False, SwAddin.ApplicationSharedLocaction & "Our Settings\Non-preffered\A2 Drawing.slddrt", Sheet_Prop(5), Sheet_Prop(6), "Default", True)
ElseIf Width > 0.825 And Width < 0.855 Then 'A1
Document.SetupSheet5(vSheet(i), swDwgPaperSizes_e.swDwgPapersUserDefined, swDwgTemplates_e.swDwgTemplateCustom, Sheet_Prop(2), Sheet_Prop(3), False, SwAddin.ApplicationSharedLocaction & "Our Settings\Non-preffered\A1 Drawing.slddrt", Sheet_Prop(5), Sheet_Prop(6), "Default", True)
ElseIf Width > 1.174 And Width < 1.204 Then 'A0
Document.SetupSheet5(vSheet(i), swDwgPaperSizes_e.swDwgPapersUserDefined, swDwgTemplates_e.swDwgTemplateCustom, Sheet_Prop(2), Sheet_Prop(3), False, SwAddin.ApplicationSharedLocaction & "Our Settings\Non-preffered\A0 Drawing.slddrt", Sheet_Prop(5), Sheet_Prop(6), "Default", True)
End If
Catch ex As Exception
End Try
Next i
'Rebuild drawing to update title block properties
iModel.EditRebuild3()
ConfigProp.Add3("Template_Version", swCustomInfoType_e.swCustomInfoText, SwAddin.LatestDrawingTemplateVersion, swCustomPropertyAddOption_e.swCustomPropertyDeleteAndAdd)
TitleBlockUpdate.ForeColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(142, Byte), Integer), CType(CType(179, Byte), Integer))
This should work on the CAD Worker side, but I didn't check (we run our CAD workers without any customizations).
We also run Wincom watermarker, which can easily replace logos. However, you may want to flatten your PDF after watermarking in case of logos (otherwise the new logo will live on a separate layer and can be hidden). Also, in case of any watermarking issues you will get old logos popping out unexpectedly.
What about .dxf files...? 🙄
is there any quick solutions for them? With 'quick' I mean something similar as watermark for pdf-files. Without open & edit in SolidWorks to avoid iteration...