iCAx开思工具箱

 找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 25277|回复: 0
打印 上一主题 下一主题

【求助】SW的二次开发,帮忙看看

[复制链接]
跳转到指定楼层
楼主
发表于 2004-8-23 17:23:56 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

马上注册登录,享用更多网站功能!

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
我写了一段程序,但运行就出错,帮忙分析一下吧。初学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();
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 分享淘帖 支持支持
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手板模型制作,在线3D打印服务

QQ|小黑屋|手机版|开思工具箱 CAD工具箱_CAM工具箱  

GMT+8, 2024-5-17 21:16 , Processed in 0.014379 second(s), 8 queries , Gzip On, Redis On.

Powered by Discuz! X3.3

© 2002-2024 www.iCAx.org

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