几何尺寸与公差论坛

 找回密码
 注册
查看: 608|回复: 0

【转帖】get filename

[复制链接]
发表于 2009-4-13 11:02:10 | 显示全部楼层 |阅读模式
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
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|小黑屋|几何尺寸与公差论坛

GMT+8, 2024-12-23 18:21 , Processed in 0.038349 second(s), 20 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表