There is a difference between how vb Rhinoscript and Python rhinoscriptsyntax work here… VB returns just the path to the folder where the document is located, whereas Python returns the path plus the file name in one string. Both also have the command DocumentName to get just the filename.
Problem is if one wants just the folder, it’s a bit more difficult to get at in Python - something like:
Hi Mitch,
It should probably be consistent between Rhinoscript and Python. In the meantime if you need to do a lot of path or file name parsing you might find the System.IO.Path class useful:
OK, thanks guys, I only suggested adding a switch in Python so as to possibly not invalidate existing scripts using that method… If it’s the same between the vb rhinoscript and Python it’s even better as far as I’m concerned…
I also fixed it but I’m just noticing now that you said “for me to fix”.
I added ‘’ or ‘/’ at the end of the path to be consistent with RhinoScript but I guess that wouldn’t matter when using: full_path = System.IO.Path.Combine(directory_name, file_name)
Changes have been made in the code. rs.DocumentPath() and rs.DocumentName() now work just like in RhinoScript. This also means that when in a new/unsaved document the methods return null.