Hi,
I have several hundred drawings all exactly the same text in my title block. I would like to change the specific text in my drawing to something different.
I have tried recording a macro but i am not very proficient with looping and editing VBA. Could any body help me?
Here is what I have recorded so far which should indicate which text I want to edit.
Dim swApp As Object
Dim Part As Object
Dim boolstatus As Boolean
Dim longstatus As Long, longwarnings As Long
Sub main()
Set swApp = _
Application.SldWorks
Set Part = swApp.ActiveDoc
Dim myModelView As Object
Set myModelView = Part.ActiveView
myModelView.FrameState = swWindowState_e.swWindowMaximized
boolstatus = Part.Extension.SelectByID2("Model", "SHEET", 0.21782274744649, 0.115453914514345, 0, False, 0, Nothing, 0)
Part.EditTemplate
Part.EditSketch
Part.ClearSelection2 True
boolstatus = Part.Extension.SelectByID2("DetailItem105@SF1", "NOTE", 0.227379598659814, 0.019531444928762, 0, False, 0, Nothing, 0)
Part.ClearSelection2 True
End Sub
SolidworksDrawings And Detailing
Kieran,
I took a much larger macro I have for when I did a major set of changes to our templates and tried to remove anything not required for what you are looking to do. This will batch through any drawing in a directory and all sub folders that you specify in the BatchDrwFiles call. This should at least get you started.
Paul
I tried running this and it would not run (SW 2015)
I'm also trying to make a macro that will add text to the Drawn By and Drawn by Date, and then change the font size for many files (hence the need for batch). Any help would be greatly appreciated.
I'm only mildly versed in macros, seizing the moment to improve my understanding. I have a conceptual question, perhaps it could help the issue, else please don't let me distract the question too much.
For something like this could you create a new drawing template file with the change you are making, then macro to load this template into each of your several hundred drawing files? If so would that be easier or not necessarily?