几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量  


返回   几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量 » 仿射空间:CAX软件开发(三)二次开发与程序设计 » CAD二次开发 » SolidWorks二次开发
用户名
密码
注册 帮助 会员 日历 银行 搜索 今日新帖 标记论坛为已读


回复
 
主题工具 搜索本主题 显示模式
旧 2009-04-13, 12:50 PM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】mirroring in assembly

mirroring in assembly
dear all,
i open a cylinder in assembly and have a plane offsetted and i tried to mirror the cylinder using insert-->mirror components...i recorded the whole procedure and i found the code to be
part.mirrorsubassembly
boolstatus = swassemblydoc.extension.selectbyid2("plane1", "plane", 0, 0, 0, true, 0, nothing, 0)
boolstatus = swassemblydoc.extension.selectbyid2("part7-1@headframe500", "component", -0.01224993124285, 0.01042243164287, 0.102, true, 0, nothing, 0)
but when i run this macro it says "object doesnt support this property or method"
then i declared a variable comp as sldworks.partdoc and after selecting the component and the plane i typed comp.mirrorpart but this also gave the same error. how can i mirror a component in assembly....please guys, help me this is eating me up
i am attaching the file along with this.
with regards,
kiran.
the greater the difficulty, the more glory in surmounting it.
there is no such command as mirrorsubassembly. and part.mirrorpart only requires the plane to be selected, not the part itself as well, that is probably why it failed.
for the assembly version try mirrorcomponents:...
assemblydoc::mirrorcomponents
description
this method mirrors the specified components in this assembly.
syntax (ole automation)
resultantcomponents = assemblydoc.mirrorcomponents ( plane, componentstoinstance, componentstomirror, mirroredcomponentfilenames, recreatemates, componentmodifier, componentnamemodifier, mirroredfilelocation, copycustomproperties)
input:
(lpdispatch) plane
plane or planar face about which to mirror the components
input:
(variant) componentstoinstance
array of instances of the component to mirror
input:
(variant) componentstomirror
array of components to mirror
input:
(variant) mirroredcomponentfilenames
array of filenames for the newly created mirrored assemblies or parts
input:
(variant_bool) recreatemates
true to preserve any mates between the selected components if more than one component is to be mirrored, false to not
input:
(long) componentmodifier
prefix or suffix for the newly mirrored components if mirroredcomponentfilenames is not specified, as defined by swmirrorcomponentnamemodifier_e
input:
(bstr) componentnamemodifier
string to add to the prefix or suffix of the name of the newly mirrored component if mirroredcomponentfilenames is not specified
input:
(bstr) mirroredfilelocation
name of the folder where to store the file of the newly created mirrored components
input:
(variant_bool) copycustomproperties
true to copy the custom properties from the selected components to the mirrored components, false to not
output:
(variant) resultantcomponents
array of the newly created components
dear luke,
i am using solidworks 2007 sp3.1, but i didnt find any commands like
resultantcomponents = assemblydoc.mirrorcomponents ( plane, componentstoinstance, componentstomirror, mirroredcomponentfilenames, recreatemates, componentmodifier, componentnamemodifier, mirroredfilelocation, copycustomproperties)
i tried with this but it said object required...but i cant even find mirrorcomponents in help
any idea ???
regards,
kiran
the greater the difficulty, the more glory in surmounting it.
dear all,
okay... i saw mirrorcomponents as a member of the class swprompforfilenamecause_e under the library swconst .... but i dont know how to use this... i failed trying to declare and later call the function.... all helps are very much appreciated.... thanks
any idea guys,
with regards,
kiran.
the greater the difficulty, the more glory in surmounting it.
the members of the swconst classes such as swprompforfilenamecause_e are not methods they are values. you cannot call a value.
assemblydoc::mirrorcomponents must be only in 2008 then. i don't have documentation for 2007 handy i'm affraid. if you could provide me with the api help file or a link to it i can gladly help.
dear luke,
okay, here is the api help ...
with regards,
kiran.
the greater the difficulty, the more glory in surmounting it.
originally posted by: luke malpass
there is no such command as mirrorsubassembly. and part.mirrorpart only requires the plane to be selected, not the part itself as well, that is probably why it failed.
for the assembly version try mirrorcomponents:...
assemblydoc::mirrorcomponents
description
this method mirrors the specified components in this assembly.
syntax (ole automation)
resultantcomponents = assemblydoc.mirrorcomponents ( plane, componentstoinstance, componentstomirror, mirroredcomponentfilenames, recreatemates, componentmodifier, componentnamemodifier, mirroredfilelocation, copycustomproperties)
input:
(lpdispatch) plane
plane or planar face about which to mirror the components
input:
(variant) componentstoinstance
array of instances of the component to mirror
input:
(variant) componentstomirror
array of components to mirror
input:
(variant) mirroredcomponentfilenames
array of filenames for the newly created mirrored assemblies or parts
input:
(variant_bool) recreatemates
true to preserve any mates between the selected components if more than one component is to be mirrored, false to not
input:
(long) componentmodifier
prefix or suffix for the newly mirrored components if mirroredcomponentfilenames is not specified, as defined by swmirrorcomponentnamemodifier_e
input:
(bstr) componentnamemodifier
string to add to the prefix or suffix of the name of the newly mirrored component if mirroredcomponentfilenames is not specified
input:
(bstr) mirroredfilelocation
name of the folder where to store the file of the newly created mirrored components
input:
(variant_bool) copycustomproperties
true to copy the custom properties from the selected components to the mirrored components, false to not
output:
(variant) resultantcomponents
array of the newly created components
hi!
i have tried using this method without any luck. has anyone succesully used assemblydoc.mirrorcomponents ??
thanks in advance.
fred
quick
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)
回复


主题工具 搜索本主题
搜索本主题:

高级搜索
显示模式

发帖规则
不可以发表新主题
不可以回复主题
不可以上传附件
不可以编辑您的帖子

vB 代码开启
[IMG]代码开启
HTML代码关闭

相似的主题
主题 主题发起者 论坛 回复 最后发表
【转帖】how to transform a point in sketch space to assembly space yang686526 SolidWorks二次开发 0 2009-04-13 12:04 PM
【转帖】can you modelize a drawing view yang686526 SolidWorks二次开发 0 2009-04-13 09:31 AM
【转帖】assembly standard practices yang686526 SolidWorks二次开发 0 2009-04-13 09:06 AM
【转帖】inserting and mating parts in an assembly yang686526 SolidWorks二次开发 0 2009-04-12 09:28 PM
【转帖】inserting and mating parts in an assembly yang686526 SolidWorks二次开发 0 2009-04-12 06:43 PM


所有的时间均为北京时间。 现在的时间是 09:25 AM.


于2004年创办,几何尺寸与公差论坛"致力于产品几何量公差标准GD&T | GPS研究/CAD设计/CAM加工/CMM测量"。免责声明:论坛严禁发布色情反动言论及有关违反国家法律法规内容!情节严重者提供其IP,并配合相关部门进行严厉查处,若內容有涉及侵权,请立即联系我们QQ:44671734。注:此论坛须管理员验证方可发帖。
沪ICP备06057009号-2
更多