File name of a new file before saving

I notice that the method ModelDoc2.GetPathName () returns an empty string if the file hasn't been saved yet. Ok, I understand that - no save, no path. But then how do I assign a config specific custom property of the Mass to a part that hasn't yet been saved? If you do it manually, SW puts in the mass property such as "SW-mass@@ snipped-for-privacy@Part2.SLDPRT". How do I capture the "Part2.sldprt" without using the GetPathName?

WT

Reply to
Wayne Tiffany
Loading thread data ...

Try Part::GetTitle

Reply to
Corey Scheich

Hmm, interesting. That worked and built the mass property properly for it to evaluate to a value. But when I then saved the file, it didn't update that property to the new name as it does when you do it manually.

WT

Reply to
Wayne Tiffany

Now it seems to be doing something a bit different, but I maybe also didn't notice it. When I run the program on a brand new part, it picks up the title, but doesn't evaluate the string as the mass because the title doesn't come in with the file extension on it. Back to the drawing board.

WT

the

Reply to
Wayne Tiffany

PolyTech Forum website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.