Hi Guys
Using the NewSTAADFile function I am able to provide a location and file name for a new .STD file.
For my current case I need to read a file name from excel and then add it to the path so that I have a file location and name to use with the NewSTAADFile function.
This however does not work.
Please refer to my code and the associated error below.
I am using the Pathlib package to develop the path
Can someone please assist?
Loc = r"C:\Users\mishal.mohanlal\Aurecon Group\GDC ERM - General\1 - Projects\000000 - NE REZ substation automation\Python automation\Staad Pro models\\" Fname = "MM" + ".STD" File_Path = pathlib.PurePath(Loc,Fname) print(File_Path) os.NewSTAADFile(File_Path,4,5)
File "c:\Users\mishal.mohanlal\Aurecon Group\GDC ERM - General\1 - Projects\000000 - NE REZ substation automation\Python automation\Substation (R2).py", line 44, in <module> os.NewSTAADFile(File_Path,4,5) File "<COMObject StaadPro.OpenSTAAD>", line 2, in NewSTAADFileTypeError: must be real number, not PureWindowsPath
Please try with below command
Thank you, I will try and implement it at a later stage. I currently came up with a work around however I will need to focus on naming again