|
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 |
|