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


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


 
 
主题工具 搜索本主题 显示模式
旧 2009-05-06, 02:48 PM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】how to get the units of a drawing file

how to get the units of a drawing file
how to get the units of a drawing file
i'd like to get the linear, area, volume, and angular unit of a drawing file. which function would allow me to achieve this?
thanks,
-ky
oddbdatabse::getmeasurement() tells if the drawing is english or metric.
sergey slezkin

what i need are the values that the users can set through the drawing setup dialog in autocad (via 'units' command in autocad), in which the user can specify drawing units such as 'inches', 'feet', 'meters', 'centimeters', etc, and area units such as 'square feet', 'square meters', and so on. how should i get these settings through dd?
by the way, though this is not what i need right now, i cannot find oddbdatabase:getmeasurement(). i guess i'm missing some thing? i'm using version 1.11.01.00, 6/03/2004.
thanks for any further help.
-ky
oddbdatabase::getmeasurement() function prototype is generated from sysvardefs.h container so it do not present in oddbdatabase.h
measurement variable says if the drawing is english or metric.
starting with r14 insunits variable was introduced (millimeters, kilometers, microinches etc.) but it effects only scaling during drag-and-drop operations between 2 different drawings.
lunits and aunits variables effect only the displaying of linear and angular units in autocad.
aunits:
0 decimal degrees
1 degrees/minutes/seconds
2 gradians
3 radians
4 surveyor's units
lunits:
sets linear units.
1 scientific
2 decimal
3 engineering
4 architectural
5 fractional
they do not effect values stored in file and/or returned by api functions. for example angles are always stored and returned in radians.
sergey slezkin
what i need is quite straight forward. for example, if i have a value of 100 for the lengh of a line in the drawing, i would like to know if it represents 100 meters or 100 inches in the user's mind. the autocad user would have set it through the 'units' command in autocad with 'drawing units' combo box. i would think it would be a logical thing for the dd library to expose this information through dd apis.
if i understand you correctly, there is currently no way to get this information in a value of insunits (e.g. millimeters, kilometers, etc) from dd. is there any plan to implement a function that exposes this information?
(by the way, good to know how to use getmeasurement(). thanks.)
-ky
via dd api you have access to all autocad system variables stored in drawing.
autocad's "units" dialog displays and modifies values of
insunits, lunits, aunits
oddbdatabase::getinsunits() returns unitsvalue enum defined in dbdatabase.h
getlunits() and getaunits() return int values.
but insunits variable appeared in ac r14. so for r12, r13 drawings in will be set to inches or millimeters depending on measurement.
sergey slezkin

ok, now i understand. getinsunits is what i need and it works great. thank you so much!
-k
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)
 


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

高级搜索
显示模式

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

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

相似的主题
主题 主题发起者 论坛 回复 最后发表
【转帖】drawing number system - do you still indicate dwg sie in the yang686526 American standards 0 2009-04-29 07:45 PM
【转帖】asme - where to star yang686526 American standards 0 2009-04-29 07:28 PM
【转帖】how to save to dxf in active drawing file location yang686526 SolidWorks二次开发 0 2009-04-12 09:23 PM
【转帖】how to save to dxf in active drawing file location yang686526 SolidWorks二次开发 0 2009-04-12 06:38 PM


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


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