找回密码 注册 QQ登录
一站式解决方案

iCAx开思网

CAD/CAM/CAE/设计/模具 高清视频【积分说明】如何快速获得积分?快速3D打印 手板模型CNC加工服务在线3D打印服务,上传模型,自动报价
查看: 21925|回复: 10
打印 上一主题 下一主题

solidworks 二次开发困扰很久 的一个问题!!!!

[复制链接]
跳转到指定楼层
1
发表于 2006-6-8 19:35:01 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

马上注册,结交更多同行朋友,交流,分享,学习。

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

x
在装配体中插入了两个零件,点击其中一个零件零件,点击工具栏里的旋转零件,然后选择“由三角形x,y,z”,然后在三个输入框里任意输入三个角度,应用后,零件旋转。但是如果将这个操作录成宏,再执行,零件并没有旋转,因为打开宏可以看到语句是:
Part.RotateComponent

就是说旋转的角度参数在这个语句中并没有。那么旋转应该用什么语句呢,还是在sw的执行函数中没有这个?

请教高手!

3ks
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 分享淘帖 赞一下!赞一下!
2
发表于 2006-11-27 08:42:29 | 只看该作者
你好
我也在研究这个问题。
我也想对运动进行二次开发
我的QQ号是460431336
3
发表于 2007-5-24 16:36:38 | 只看该作者
你们好,我这方面的新手,我不知道你们问题的解决方法。我现有一个问题,如何得到三维图形的尺寸?
4
发表于 2007-7-31 11:00:02 | 只看该作者
顶一下!~  同问此问题   我也被这个困扰好久了~  有没有高人知道阿……
5
发表于 2007-7-31 13:54:11 | 只看该作者
下面时我录的部分,应该由另外的语句记录了角度之类的参数, 接着是执行这个动作。


Set swApp = Application.SldWorks

Set Part = swApp.ActiveDoc
Set SelMgr = Part.SelectionManager
swApp.ActiveDoc.ActiveView.FrameState = 1
Part.ClearSelection2 True
boolstatus = Part.Extension.SelectByID2("拉伸1", "SOLIDBODY", -0.008353456370571, 0.009631396338079, 0.01000000000005, True, 0, Nothing, 0)
boolstatus = Part.Extension.SelectByID2("上视基准面", "PLANE", 0, 0, 0, True, 0, Nothing, 0)
boolstatus = Part.Extension.SelectByID2("", "FACE", -0.01463440088054, 0.02764117647052, 0.006059731040523, True, 0, Nothing, 0)
Dim Component As Object
Dim FeatureData As Object
Part.ClearSelection2 True
boolstatus = Part.Extension.SelectByID2("拉伸1", "SOLIDBODY", -0.008353456370571, 0.009631396338079, 0.01000000000005, False, 1, Nothing, 0)
Set Feature = Part.FeatureManager.InsertMoveCopyBody2(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, False, 1)
Set FeatureData = Feature.GetDefinition
boolstatus = Part.Extension.SelectByID2("上视基准面", "PLANE", 0, 0, 0, False, 1, Nothing, 0)
boolstatus = Part.Extension.SelectByID2("", "FACE", -9.338235294118E-04, 0.02764117647059, 0.005, True, 1, Nothing, 0)
FeatureData.AddMate Empty, 6, 1, 0, 0.8901179185171, longstatus
Feature.ModifyDefinition FeatureData, Part, Component

End Sub
6
发表于 2007-7-31 15:58:23 | 只看该作者
look up the help file first



To move an assembly component, you can use

the DragOperator object. This allows you to

apply a transform to an assembly component

or set of assembly components.

The DragOperator object is a powerful and functional

API. It has the ability to detect

collisions and monitor dynamic clearances.

This functionality is the user-interface equivalent of

interactively dragging assembly components.

As such, this API honors all mates in the

assembly.



In some cases, this may be too much functionality.

For example, to animate exploding an assembly,

you want to set each component transform and

ignore all assembly mates.

A presentation transform is a graphical representation.

This blindly applies a transformation to the

graphical display of an assembly component. The

underlying transform of the model data is not affected.
7
发表于 2007-7-31 15:58:54 | 只看该作者
help has almost everything you need
8
发表于 2007-8-1 11:04:34 | 只看该作者
geminilele:
     Many Thanks! I got it~   and I Recognized the important of the Help Files......   Thanks again for your help.  ^^
9
发表于 2007-8-1 14:33:45 | 只看该作者
Very glad you can catch that : ), I'm also been taught as this. Look up your help, you may get almost everything .
10
发表于 2007-8-31 14:02:21 | 只看该作者
二次开发群:24750291
您需要登录后才可以回帖 登录 | 注册

本版积分规则

3D打印手板模型快速制作服务,在线报价下单!

QQ 咨询|手机版|联系我们|iCAx开思网  

GMT+8, 2024-12-20 02:43 , Processed in 0.027166 second(s), 12 queries , Gzip On, Redis On.

Powered by Discuz! X3.3

© 2002-2024 www.iCAx.org

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