几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量  


返回   几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量 » 仿射空间:CAX软件开发(三)二次开发与程序设计 » CAD二次开发 » SolidWorks二次开发
用户名
密码
注册 帮助 会员 日历 银行 搜索 今日新帖 标记论坛为已读


回复
 
主题工具 搜索本主题 显示模式
旧 2009-04-13, 11:03 AM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】get write access button

get write access button
trying to make a button on my toolbar to get write access. every time i open a part now we have it set to open everything read only. i am sick of going "file, get write access". i just want to click a button. i also failed at making a macro for it.
any advice?
modeldoc2::setreadonlystate
got it working with a easy little button now. i don't know how you knew that. where can i look up stuff like that in the future?

help --> solidworks and addins api help
would you be so kind as to pass the macro on or post how you did it?
we have the same situation everything is read only and we have to change the status if we need to update something.
grant
applications engineer
sw2008 x64 sp 3.1
dell precision t5400
nvidia quadro fx 5600
xeon 2.5ghz quad core, 4gb ram
xp pro x64 sp2.0

^ of course. no problem! i will upload the button i made too
dim swapp as object
dim part as object
dim boolstatus as boolean
dim longstatus as long
dim annotation as object
dim gtol as object
dim datumtag as object
dim featuredata as object
dim feature as object
dim component as object
dim retval as variant
dim readonlystate as boolean 'true= only, false = not
sub main()
set swapp = application.sldworks
set part = swapp.activedoc
readonlystate = part.isopenedreadonly()
if readonlystate = false then readonlystate = true else readonlystate = false
boolstatus = part.setreadonlystate(readonlystate)
end sub
--------------------------------
let me know how it works for you

working great thanks this will help save a few clicks!!
grant
applications engineer
sw2008 x64 sp 3.1
dell precision t5400
nvidia quadro fx 5600
xeon 2.5ghz quad core, 4gb ram
xp pro x64 sp2.0

why are you required to open read only? company policy? be careful that you are not gaining write access to a file someone else has open read/write.
^ yep. my policy.
we had "employee a" open an assembly. that assembly contained a part that "employee b" had open. employee b would make a change to the part and save it. employee a had write access to it in the assembly, when he would save it it would over write what b did.
now, everything is set to open read only. if you want w/a to it, you have to ask for it. if someone else already has w/a to it, it tells you the name of the person who has write access.
made the change a year ago after problem after problem. now, not a single problem since.
we have no pdm.
articcatmatt,
i do not see how a person opening an assembly that contains a read only file (open on another machine) could be able to overwrite it. windows locks the file whenever someone opens it. is your server non-windows? we do not use pdm, and have done extensive checking that once a user has read/write permissions, no one else can write, until it is suppressed and the assembly is saved so someone else can grab it.
gerald
^ i don't know how to explain it.
someone would open something and it would be read only. someone else would open it read only and get write access, make a change, and save. the original person still had it on their scree in the old state and would get write access and save it, thus overwriting the changes the second person made.
thats the best i can explain it.
making everything default open to read only fixed the problem. been that way for 2 years now. i tested it with it off and on and the only way to avoid it was to have it on.
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)
回复


主题工具 搜索本主题
搜索本主题:

高级搜索
显示模式

发帖规则
不可以发表新主题
不可以回复主题
不可以上传附件
不可以编辑您的帖子

vB 代码开启
[IMG]代码开启
HTML代码关闭

相似的主题
主题 主题发起者 论坛 回复 最后发表
【转帖】make x button exit macro yang686526 SolidWorks二次开发 0 2009-04-12 09:44 PM
【转帖】how to grey out a customized macro button yang686526 SolidWorks二次开发 0 2009-04-12 09:20 PM
【转帖】how to grey out a customized macro button yang686526 SolidWorks二次开发 0 2009-04-12 06:36 PM
【转帖】VC6.0 控件Radio Button的使用 huangyhg vc编程 0 2009-03-22 10:29 PM


所有的时间均为北京时间。 现在的时间是 02:04 PM.


于2004年创办,几何尺寸与公差论坛"致力于产品几何量公差标准GD&T | GPS研究/CAD设计/CAM加工/CMM测量"。免责声明:论坛严禁发布色情反动言论及有关违反国家法律法规内容!情节严重者提供其IP,并配合相关部门进行严厉查处,若內容有涉及侵权,请立即联系我们QQ:44671734。注:此论坛须管理员验证方可发帖。
沪ICP备06057009号-2
更多