几何尺寸与公差论坛

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

【转帖】changing api input units

[复制链接]
发表于 2009-4-13 09:39:54 | 显示全部楼层 |阅读模式
changing api input units
hi, i am trying to change the input units from metric to imperial and from radians to degrees.
i have tried using the swmodeldoc.setuserpreferenceintegervalue and that changes the units in the document properties just fine.
however that seems to be just for manually inserted sketches (using mouse), and when i try to create a sketch though the api it still draws in metric/rad.
ex:
swmodel.createline2 0,0,0,1,0,0
creates a line from origin 1 meter long and i need it to be 1 inch long.
the values i was using are:
swunitsangular & swunitsystem
is there more i need to change
currently i have setup some constants to handle the conversions, but the code is rather ugly and i'm trying to clean it up.
chris,
as far as i understand it, the api only and always works in metric.
kevin bennett
kevinsbennett@navitech.us
serious?
well that's just uncool.
originally posted by: chris usselman
serious? well that's just uncool.
chris,
kevin is right. internally solidworks (and in api) works in meters and radians.
jorn bjarning
cswp
cad & plm consultant
sw2008 sp5 / sw2009 sp2
hmm, oh well, thanks for the quick replies fellas.
check out userunit, it is an api object that converts units to system units.
quick
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-12-24 08:47 , Processed in 0.039177 second(s), 20 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2023 Discuz! Team.

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