iCAx开思工具箱
标题:
【求助】SW的二次开发,帮忙看看
[打印本页]
作者:
hearts
时间:
2004-8-23 17:23
标题:
【求助】SW的二次开发,帮忙看看
我写了一段程序,但运行就出错,帮忙分析一下吧。初学SW的二次开发,大家别见笑
LPMODELDOC m_ModelDoc = NULL;
HRESULT hres = NOERROR;
hres = (TheApplication->GetSWApp())->get_IActiveDoc( [$m_ModelDoc )] // Retrieve IModelDoc pointer
if( m_ModelDoc == NULL )
return;
LPCONFIGURATION m_config = NULL;
hres = m_ModelDoc->IGetActiveConfiguration([$m_config)]
LPCOMPONENT2 m_component = NULL;
LPMATHTRANSFORM m_math = NULL;
double *p = new double[3];
p[0] = 0;
p[1] = 0;
p[2] = 0;
LPMATHUTILITY MathUtility;
(TheApplication->GetSWApp())->IGetMathUtility([$MathUtility)]
LPMATHPOINT* point;
MathUtility->ICreatePoint(p, point);
p[0] = 1;
p[1] = 0;
p[2] = 0;
LPMATHVECTOR* vector;
MathUtility->ICreateVector(p, vector);
double angle;
LPMATHTRANSFORM transform;
MathUtility->ICreateTransformRotateAxis ( *point, *vector, 10* 3.14159 /180, [$transform )]
VARIANT_BOOL retval;
if(m_config->IGetRootComponent2(&m_component) == S_OK )
{
m_component->SetTransformAndSolve2(transform, [$retval)]
}
m_ModelDoc->Release();
m_config->Release();
m_component->Release();
欢迎光临 iCAx开思工具箱 (https://t.icax.org/)
Powered by Discuz! X3.3