AnsweredAssumed Answered

How to create macro for replacing part of sentence in custom properties

Question asked by Damian Fifielski on Jan 25, 2017
Latest reply on Sep 27, 2017 by Domagoj Brlosic

Hi all.

I have a problem and all the time i am doing it manually. I am losing a lot of time for this so maybe there is faster way to do it. I have found similar subject but without final solution: Drawing Custom Properties Find & Replace. I have tried to edit this macro and run it but without any result.

 

I need macro for finding sentence "-_" and replacing with "-XXX_" in custom properties (*.SLDPRT and *.SLDASM files). It would be nice to update the date ("Design Date" in custom property) also but it is not necessary. The XXX is always different for next assembly. I make few assemblies per day. I attached one file with custom proparties for tests.

 

Here is an example:

 

Before change:     Custom propertie name: "Part number", Value: "NC-G-05-_318"

After change:        Custom propertie name: "Part number", Value: "NC-G-05-308_318"

 

Is it possible? How to make it? And finally: how to use it for all files in folder (with subfolders)?

 

PS. I am using SolidWorks Professional 2015 SP5.0

Outcomes