We are using SolidWorks 2007 SP2.2 and we are trying to write some custom code to be able to change the material codes we use in custom props. In our part models, we currently have a custom prop called 'matl'. In the value / text expression field we have code with a text prefix and then a link to a dimension or two. An example would be: MFB"D2@ snipped-for-privacy@A300107.SLDPRT"x"D1@ snipped-for-privacy@A300107.SLDPRT" We want to change this to B-SFB-304-"D2@ snipped-for-privacy@A300107.SLDPRT"x"D1@ snipped-for-privacy@A300107.SLDPRT"
We need to be able to maintain the parametric links to the dimensions and replace the text prefix. Any ideas on how we get to this field of the custom prop so we can copy it? As far as we can see, we can only read the evaluated value through the API.
Using VB6 and a dll called DSOfile.dll, we have managed to write a string with a parametric link string back to a custom prop, but we have to open the file in SW to get the evaluated field to update. Is it possible to update the evaluated field without opening the file in SW? We got DSOfile from here:Another problem we are having is once the string has been written in and the file is opened in SW to update it, the name field that is read through DSOfile.dll dissappears! If you try and read any custom prop with a parametric link in it with DSOfile.dll, the name field is not available.
We need to be able to automate this process because we have approximately 140 000 files to change.