Is there a way to save the original "Filename" instead of "Copy of Filename" when saving parts as virtual components in an assembly?
You should be able to select a virtual component in the tree, then hit the F2 button.
This should start the renaming procedure.
Oh! Being able To Click F2 to rename is nice! Thanks for the tip, but i'm actually looking for a way to prevent the naming change or rename them all in one go. My assembly contains about 100 parts :<
Sounds like you need a macro
edit: Had a spare 30 minutes..
Needs testing.. Use at your own risk
Dim swApp As SldWorks.SldWorks
Dim swModel As SldWorks.ModelDoc2
Dim swAssem As SldWorks.AssemblyDoc
Dim swComponent As SldWorks.Component2
Dim vComp As Variant
Dim ComponentName As String
Const ReplaceText = "Copy of "
Set swApp = Application.SldWorks
Set swModel = swApp.ActiveDoc
Select Case True
Case swModel Is Nothing _
, swModel.GetType() <> swDocumentTypes_e.swDocASSEMBLY
Set swAssem = swModel
For Each vComp In swAssem.GetComponents(TopLevelonly:=True)
Set swComponent = vComp
If swComponent.IsVirtual Then
ComponentName = swComponent.Name2
If Left(ComponentName, Len(ReplaceText)) = ReplaceText Then
ComponentName = Right$(ComponentName, Len(ComponentName) - Len(ReplaceText))
swComponent.Name2 = ComponentName
Jason Soto wrote: Oh! Being able To Click F2 to rename is nice! Thanks for the tip, but i'm actually looking for a way to prevent the naming change or rename them all in one go. My assembly contains about 100 parts :<
Jason Soto wrote:
I wonder if you can import the tree into treehouse and rename them there, then export it.
Another option is pack and go. Run Pack and go, and you will have the option to rename the files when you save them to a new directory.
What Dan Pihlaja said, or slow double-click on the file name.
will it allow it? as he would have a physical file with a name, and then part (internal) with same name? would that not confuse SW - in the same way as loading files with same filename but in different folders?
SW will allow you to rename a virtual part to be the same as the original. Since the virtual part's filename actually includes the parent's filename, it is still different from the original's filename.
Can you work in opposite manner? Start from virtual parts...
Retrieving data ...