iCAx开思网

标题: solidworks 二次开发困扰很久 的一个问题!!!! [打印本页]

作者: aicer    时间: 2006-6-8 19:35
标题: solidworks 二次开发困扰很久 的一个问题!!!!
在装配体中插入了两个零件,点击其中一个零件零件,点击工具栏里的旋转零件,然后选择“由三角形x,y,z”,然后在三个输入框里任意输入三个角度,应用后,零件旋转。但是如果将这个操作录成宏,再执行,零件并没有旋转,因为打开宏可以看到语句是:
Part.RotateComponent

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

请教高手!

3ks
作者: gu355    时间: 2006-11-27 08:42
你好
我也在研究这个问题。
我也想对运动进行二次开发
我的QQ号是460431336
作者: tiger6818    时间: 2007-5-24 16:36
你们好,我这方面的新手,我不知道你们问题的解决方法。我现有一个问题,如何得到三维图形的尺寸?
作者: merlin_yfa    时间: 2007-7-31 11:00
顶一下!~  同问此问题   我也被这个困扰好久了~  有没有高人知道阿……
作者: ant    时间: 2007-7-31 13:54
下面时我录的部分,应该由另外的语句记录了角度之类的参数, 接着是执行这个动作。


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
作者: geminilele    时间: 2007-7-31 15:58
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.
作者: geminilele    时间: 2007-7-31 15:58
help has almost everything you need
作者: merlin_yfa    时间: 2007-8-1 11:04
geminilele:
     Many Thanks! I got it~   and I Recognized the important of the Help Files......   Thanks again for your help.  ^^
作者: geminilele    时间: 2007-8-1 14:33
Very glad you can catch that : ), I'm also been taught as this. Look up your help, you may get almost everything .
作者: ylx9579    时间: 2007-8-31 14:02
二次开发群:24750291
作者: logxing    时间: 2008-2-2 15:25
sw脰卤陆脫赂脛脕脣卤盲禄禄戮脴脮贸




欢迎光临 iCAx开思网 (https://www.icax.org/) Powered by Discuz! X3.3