![]() |
【转帖】changing api input units
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 |
所有的时间均为北京时间。 现在的时间是 10:57 AM. |