|
get filename
i'm trying to understand vb and i'm having trouble getting the current filename to default in an inputbox. i have a routine that does a saveascopy to send files to our cnc programmer. it works as is, but i would like to go one step further. as it is now, an inputbox comes up with the input field blank. i would like to set the default to the filename. i may or may not change the name before sending it to the cnc, but most of the time i would keep the same name. i tried strtitl = modeldoc2.gettitle(), but i get an error. can you help me? thanks.
mike closson - cswa
sw 2009 sp3.0 x64
intel xeon e5345 dual 2.33ghz + 4gb ram
nvidia quadro fx 1500
vista business x64 sp1
3dconnexion spacepilot
you cannot call the function gettitle from the static modeldoc2 object, it needs to be aquired using swapp.activedoc or similar.
also, that function will return the title displayed at the top of the model in solidworks, not its filename; for that you need getpathname
thanks, luke. i've got it working now. in the future, i might try to tweak it more where it calls up the standard save as dialog box instead of just an input box. i think there would be times i would like to see what's already in the cnc folder as i'm sending new files to them.
mike closson - cswa
sw 2009 sp3.0 x64
intel xeon e5345 dual 2.33ghz + 4gb ram
nvidia quadro fx 1500
vista business x64 sp1
3dconnexion spacepilot
quick |
|