I have created a new property MyCode in propseed.txt. And by mistake, I have left the type of the property set to Text. I have already defined several components with this new property.
So, each component has this MyCode set as text. But the property type should be Number.
Now, if I change the type of the property in propseed.txt, nothing happens to already created parts. Their type is still set to text. This propseed change affects only new parts.
And, if I want to change the type of the property in already created parts, I have to open each part separately and do this manually (file properties/custom/do the change....)
Is there a way to do this quciker?
What if all the parts are in the same assembly? Is it possible to do this somehow with Property Manager?
Thanks for any info on this.
Solved! Go to Solution.
I dont believe that using property manager to change the property value will change the type.
I even tried the syntax "CDbl(x)" used in coding to convert a "string" (text) to a "number" (double) and this does no seem to work...
This would be a very easy macro to write... maybe someone else on here might be gracious enough and have the time to write a macro to do so.
I can see 3 usefull processes:
1.) edit all files in a directory
2.) edit all occurances at all levles in an assembly
3.) edit the open file only
all the code would need to do is :
test the file to see if the custom propery exsist and if so store the value.
delete the property
add a new property with same name but set type correclty and then paste the value back in
this would aslo add the custoem property should it not already exsist.
Here's a way:
Install Property Remapper from the following website.
Put the following lines at the bottom of the file "propertymap.dat" which will reside in the installation folder.
I tested it so cutting and pasting will probably be the safest.
# Set a new property as numeric
Custom.MyCode2 = 1
# Copy value in MyCode to MyCode2
Custom.MyCode2 = Custom.MyCode
# Delete old MyCode prop
Custom.MyCode = ""
# Create new MyCode = to MyCode2
Custom.MyCode = Custom.MyCode2
# Delete MyCode2
Custom.MyCode2 = ""
Run PropertyRemapper.exe and specify the folder where the parts in question reside.
It's a little convoluted but that will leave the numeric property MyCode containing the old text values as numeric values
That was quick. Fantastic. I have just tested and it works.
If I am write, number 1 in Custom.MyCode2 = 1 means, that the property is set to Number. Custome properties has also text, date and yes/no options. Are those options also defined with some numbers?
Anyway, thanks a lot for this.
Not sure the options have numbers but Ted seems to have mapped them for the purpose of the macro. A well thought out macro and lot of foresight.
You are correct, setting it = 1 made it a numeric prop.
Wasn't sure this program would work when I started.
I'm not sure how you define a date property but text props are done by putting the character string in quotes: "example".
Ted Barham from the Barham Software link for the macro.
Very useful macros but the site seems to have been updated last about 7-8 years ago, Alas, never got to interact with him.
I thought maybe that's what you meant but couldn't find a reference to his first name. I think the site was last touched in '06. (edit: '08)
Some neat tools there. That prop remap tool is the one I've used the most.
Do you know what happened to him?
BTW, I also don't know what you mean by "not sure the options have numbers".
My comment was with reference to SvenBom's line "Are those options also defined with some numbers?"
Initially I thought of the Solid Edge API where there would be some sort of ENUM for the data type of a property, then I realised it must be relating to the settings in the INI file meant to be used with the property remap program.
No idea about Ted Barham; Only wish he was also on this forum, especially now that Jason Newell is also integrated into the Siemens forum, so we could see more macros shared regularly.