thread559-133945 - Macro to rename ass, sub-ass, parts, drawings... of
thread559-133945 - Macro to rename ass, sub-ass, parts, drawings... of
(OP)
Good day all,
Upon review of the archived subjects I ran across this thread regarding bulk renaming of SolidWorks parts, assy's & drawings.
By chance does anyone know if there has been more progress in this area? This is an area of GREAT interest for not only myself but my empoyer as well.
I would be very greatful if someone could enlighten me on this matter.
BTW, yes we use SWX Explorer & yes we us PDMWx.
We desperatly need the files renamed prior to being deposited into PDMWx. Hence my request for illumination in this area.
We have on the extreme, machine layouts of 5000+ parts, but average around 1500.
Thanks ahead of time for pondering this,
Regards,
rdeand
Upon review of the archived subjects I ran across this thread regarding bulk renaming of SolidWorks parts, assy's & drawings.
By chance does anyone know if there has been more progress in this area? This is an area of GREAT interest for not only myself but my empoyer as well.
I would be very greatful if someone could enlighten me on this matter.
BTW, yes we use SWX Explorer & yes we us PDMWx.
We desperatly need the files renamed prior to being deposited into PDMWx. Hence my request for illumination in this area.
We have on the extreme, machine layouts of 5000+ parts, but average around 1500.
Thanks ahead of time for pondering this,
Regards,
rdeand






RE: thread559-133945 - Macro to rename ass, sub-ass, parts, drawings... of
This is what we have. Never, since I've worked, have I seen a company do this….but we do. We've talked to companies about PDM/PLM's and they are always puzzled as to why we do this. If we do go to a document management software, I'm afraid we'll also have to rename our 45,000 files. I'd like come across a utility that will remove anything after the initial p/n (example - 123456<remove>R02<remove>.sldprt)
And sorry I didn't have a solution for you readnd. But I posted to show additional interest in this issue
Adam
Solidworks 2005 SP01.1
Windows 2000
RE: thread559-133945 - Macro to rename ass, sub-ass, parts, drawings... of
Now, I would create a folder in PDMW to check in all the files. Name the folder so you know they are old files. Rename as you go and change folders as they are renamed.
Chris
Systems Analyst, I.S.
SolidWorks Pro 06/PDMWorks 06
AutoCAD 06
ctopher's home site (updated 06-21-05)
FAQ559-1100
FAQ559-716
RE: thread559-133945 - Macro to rename ass, sub-ass, parts, drawings... of
As an example we would receive a machine layout with all parts, assy's & drw's assigned unique 7-digit part numbers.
Our hope would be to add as a prefix our own in-house 4-digit project i.e.: 5678_(original p/n here).
Honestly using PDMWorks has greatly helped with regards to revision and design history tracking. Would be happy to pass along what we had to overcome with pitfalls and success' at length if you like.
Let me know if you are interested and we can converse directly and then post our tale here.
rdeand
RE: thread559-133945 - Macro to rename ass, sub-ass, parts, drawings... of
Sub TraverseComponent(swComp As SldWorks.Component2, strFPath as String, strPfx as String)
Dim vChildComp As Variant
Dim swChildComp As SldWorks.Component2
Dim swCompConfig As SldWorks.Configuration
Dim i As Long
vChildComp = swComp.GetChildren
If UBound(vChildComp) >= 0 Then
For i = 0 To UBound(vChildComp)
Set swChildComp = vChildComp(i)
If swChildComp.IsSuppressed() = False Then
Set ModDoc = swChildComp.GetModelDoc()
PrtName = ModDoc.GetPathName
ShortName = Left(PrtName, Len(PrtName) - 7)
If ModDoc.GetType = swDocPART Then
ModDoc.SaveAs2 strFpath & strPfx & Shortname & ".SLDPRT", 0, True, False
swApp.CloseDoc (strFpath & strPfx & Shortname & ".SLDPRT")
End If
If ModDoc.GetType = swDocAEESMBLY Then
ModDoc.SaveAs2 strFpath & strPfx & Shortname & ".SLDASM", 0, True, False
swApp.CloseDoc (strFpath & strPfx & Shortname & ".SLDASM")
End If
TraverseComponent(swChildComp, strFPath, strPfx)
End If
Next i
End If
End Sub
Sub main()
Dim swApp As SldWorks.SldWorks
Dim swModel As SldWorks.ModelDoc2
Dim swAssy As SldWorks.AssemblyDoc
Dim swConf As SldWorks.Configuration
Dim swRootComp As SldWorks.Component2
Set swApp = CreateObject("SldWorks.Application")
Set swModel = swApp.ActiveDoc
If swModel Is Nothing Then
MsgBox "No model loaded."
Else
If swModel.GetType = swDocASSEMBLY Then
Set swConf = swModel.GetActiveConfiguration
Set swRootComp = swConf.GetRootComponent
PrtName = swModel.GetPathName
ShortName = Left(PrtName, Len(PrtName) - 7)
MessageIn = "Enter full path i.e. C:\Temp\ <- DON'T FORGET LAST BACKSLASH"
TitleIn = "Path to save Solidworks Files"
DefaultIn = "C:\Temp\"
strFpath = InputBox(MessageIn, TitleIn, DefaultIn)
MessagePfx = "Enter Prefix to add"
TitlePfx = "Prefix to add to Files"
DefaultPfx = "XXXX-"
strPfx = InputBox(MessagePfx, TitlePfx, DefaultPfx)
nRet = TraverseComponent(swRootComp, strFPath, strPfx)
swModel.SaveAs2 strFpath & strPfx & Shortname & ".SLDASM", 0, True, False
swApp.CloseDoc (strFpath & strPfx & Shortname & ".SLDASM")
Else
MsgBox "Active file is not an assembly."
End If
End If
End Sub
RE: thread559-133945 - Macro to rename ass, sub-ass, parts, drawings... of
Helpful SW websites FAQ559-520
How to get answers to your SW questions FAQ559-1091
RE: thread559-133945 - Macro to rename ass, sub-ass, parts, drawings... of
Good suggestion though,
TY CorB
RE: thread559-133945 - Macro to rename ass, sub-ass, parts, drawings... of
Flores
SW06 SP4.1
RE: thread559-133945 - Macro to rename ass, sub-ass, parts, drawings... of
Chris
Systems Analyst, I.S.
SolidWorks Pro 06/PDMWorks 06
AutoCAD 06
ctopher's home site (updated 06-21-05)
FAQ559-1100
FAQ559-716
RE: thread559-133945 - Macro to rename ass, sub-ass, parts, drawings... of
Helpful SW websites FAQ559-520
How to get answers to your SW questions FAQ559-1091
RE: thread559-133945 - Macro to rename ass, sub-ass, parts, drawings... of
- Search Subfolders
- Look for assemblies and drawings
- Look for derived/mirrored parts
- Look for models defined in this assembly
FloresSW06 SP4.1
RE: thread559-133945 - Macro to rename ass, sub-ass, parts, drawings... of
Could you not use CopyProject to copy and rename the files? There is a option in CopyProject to rename files when you copy a project. It will change a file name to something different. Just a thought.
Cheers,
Ralph Wright, CSWP
SolidWorks 2005, SP5.0
P4, 2.53Ghz
1.5 Gb RAM
ATI Fire GL8800 Card
Windows 2000 Pro
RE: thread559-133945 - Macro to rename ass, sub-ass, parts, drawings... of
I don't know ... unfortunately, I don't have PDMWorks & have never had the chance to use it.
Helpful SW websites FAQ559-520
How to get answers to your SW questions FAQ559-1091