查看单个帖子
旧 2009-04-13, 01:34 PM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】problem for getting coordinate system axes components

problem for getting coordinate system axes components
hello,
first, thanks for reading this message.
i use solidworks 2006 and its api.
i'd like to get 3 axes components of an user-defined coordinate system.
this coordinate system is made by the function of 'reference geometry'.
this coordinate system is included in a 'part'.
i succeeded to get the 'reference geometry' feature object.
1) different from 'refaxis' or 'refpoint', i don't know how to get the specific feature for 'coordsys' object.
i could know whether a feature is 'coordsys' or not by using 'feature->gettypename' function.
so, i got the interface of 'coordsys' object in the form of
'ccomptr'.
'refaxis' or 'refpoint' objects can be accessed in the form of
'ccomptr' or 'ccomptr'.
i don't know the difference between them.
i could not find it in the help file.
2) so, i defined a function to get the components of a coordinate
system.

variant_bool cswassembly::get_coordinatesystemtransform(ccombstr
bstrcoordsysname, ccomptr& pmathtransform)
{
hresult hres ;
ihres = m_swmodeldocext->getcoordinatesystemtransformbyname(bstrcoordsysname,
&pmathtransform);
return hres;
}

because, i found the function 'getcoordinatesystemtransformbyname'.
aforementioned, i got the name of 'coordsys' type feature. so i
thought that i could use the function 'getcoordinatesystemtransformbyname'.
but, the return value, 'pmathtransform' does not include any
information at all.
i'm not good at solidworks api.
please give me your advice. thanks in advance.
sincerely
moonki jung
edited: 10/20/2008 at 10:09 pm by moonki jung
quick
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)