Solidworks二次开发-05-装配体中插入零部件

Solidworks二次开发--装配体中插入零部件

 

 

在往装配体中插入零部件时,我们使用addcomponent 函数。如果需要选定零部件的配置,则需要使用addcomponent4

先学习下语法:

 

addcomponent4

retval = AssemblyDoc.AddComponent4 ( compName, configName, x, y, z)

 

Input:         (BSTR) compName                    Path name of a loaded part or assembly to add as a component

Input:         (BSTR) configName                   Name of the configuration from which to load the component

Input:        (double) x                                      X coordinate of the component center

Input:         (double) y                                      Y coordinate of the component center

Input:        (double) z                                      Z coordinate of the component center

Output:     (LPCOMPONENT2) retval          Pointer to the Component2 object

 

需要注意的是:参数1为文件的全名(包括路径);参数2为文件的配置名称;当函数执行成功购返回一个指向该零件的指针。

于是我们可以如下写一个小程序,用来给

  • 0
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值