几何尺寸与公差论坛

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

【转帖】data storage in sw docs

[复制链接]
发表于 2009-4-13 10:11:52 | 显示全部楼层 |阅读模式
data storage in sw docs
i am looking for a way to write data (just some plain text) to a solidworks document (sldprt, sldasm, slddrw) in such a way so that the data cannot be accessed or manipulated by the end user. we would prefer that the user does not even know the data exists. today we are writing data to various custom properties but that has become somewhat problematic because we think the users are manipulating that data (outside of using our program) that is causing some problems and we have also found that there is a character limitation in custom properties that prevents us from writing all the data that we would like to write.
we tried writing the data to an excel spreadsheet that was contained in the design binder but that caused problems because once opened the spreadsheet would not close and of course that data is accessible to the user for manipulation.
i have also thought about using a general table and hiding the table so that it cannot be seen in the drawing window but it is still visible in th feature tree.
does anyone know how to insert a general table but not have it show in the feature tree?
so in summary here is what we are wanting to do:
1. store unlimited amounts of text data inside of a sw document (sldprt, sldasm, slddrw) via the api.
2. the data should only be accessible via the api, the user should not be able to access or manipulate the data.
thanks for any suggestions, and if you like you can just laugh at me for asking the question...
take a look at modeldoc2::iget3rdpartystorage in the api help.
look up "attributes" in sw api help.
michael, this looks like exactly what we want to do.
thanks...
glad someone pointed that out. i was about to mention tagging data on to the end of the native file after the terminating \0, which gives you unlimited storage, however it can be tricky to access, and can be picked up as a trojan by some av
luke,
that idea would lead to the crash of sw,because the total size counter and checksum would be damaged and i an not sure sw is not so delicate to handle that bugs correctly
regards, basil
"and when you loose control,
you'll reap the harvest you have sown..." (c) pink floyd
solidworks 2008 x64 sp5.0 (production)
solidworks 2009 x64 sp2.0 (testing)
windows xp x64 sp2
core2quad 6600, 4gb ram, 500gb sata, ati firegl v7700 1024mb (softmodded from hd3850), 19" tft
depends how it gets its own file size. some programs simply check by running a count of bytes up until \0, but others (such as anti-virus) software check total bytes regardless of termination characters, this is how they are able to detect possible virii so quickly.
nevermind, the other idea sounds better anyway.
i think rolands way is easiest to handle. write hidden attributes to model so user can not change them unless he/she is familiar with solidworks api.
it does not need big problem, if it is in your head
quick
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-12-24 09:55 , Processed in 0.037237 second(s), 19 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2023 Discuz! Team.

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