move / rotate parts and assembly and make a copy

move / rotate parts and assembly and make a copy

GeorgK
Advisor Advisor
774 Views
9 Replies
Message 1 of 10

move / rotate parts and assembly and make a copy

GeorgK
Advisor
Advisor

Hello together,

 

how could I move / rotate a part or assemble and make a copy of it (like an array)? 

 

Thanks

 

Georg

0 Likes
775 Views
9 Replies
Replies (9)
Message 2 of 10

Balaji_Ram
Alumni
Alumni

Hi Georg,

 

Does creating a circular pattern based on an occurrence help ?

This is similar to what is possible using the Assembly tab > Pattern > Pattern component in Inventor UI

 

http://adndevblog.typepad.com/manufacturing/2012/12/inventor-create-pattern-of-component-occurrences...

 

Regards,

Balaji



Balaji
Developer Technical Services
Autodesk Developer Network

0 Likes
Message 3 of 10

GeorgK
Advisor
Advisor

Hello Balaji,

 

it could help if the pattern explodes after the run.

 

Georg

0 Likes
Message 4 of 10

GeorgK
Advisor
Advisor

Hello Balaji,

 

 

I solved it with a RectangularPattern which I made independent and deleted it afterwards. But the constraints are lost. Is it possible to copy it with the constraints?

 

Georg

 

0 Likes
Message 5 of 10

adam.nagy
Autodesk Support
Autodesk Support

Hi Georg,

 

What constraints are you talking about? Are they between the components you are copying? - in case not just one being copied.

 

Best is to always check what happens in the UI.

If you do that, then you'll find that if multiple components are copied together and the constraints are between them then those constraints are kept, otherwise they are not.

 

Cheers, 



Adam Nagy
Autodesk Platform Services
0 Likes
Message 6 of 10

GeorgK
Advisor
Advisor

Hello Adam,

 

the idea was to copy components with dependencies and insert them at new position.

 

Georg

0 Likes
Message 7 of 10

Balaji_Ram
Alumni
Alumni

Hi Georg,

 

In that case, i think you will need to compute the transformation matrix on your own and use it while adding a new occurrence.

or set the ComponentOccurrence.Transformation or SetTransformWithoutConstraints to transform it. 

 

If that does not help, can you please share the model and explain what you are trying to move and rotate ?

 

Regards,

Balaji



Balaji
Developer Technical Services
Autodesk Developer Network

0 Likes
Message 8 of 10

GeorgK
Advisor
Advisor

Hello Balaji,

 

Copy.png

 

Paste at same place.png

 

Paste with all the constraints.

 

Or

 

Paste at new place.png

 

Base point: where to copy the selected parts with constraints (like copy)

Insert point: where to insert the copied parts.

 

It's like in Autocad.

 

Georg

0 Likes
Message 9 of 10

Balaji_Ram
Alumni
Alumni

Hi Georg,

 

Sorry for the delay in getting back to you.

 

I do not find a way to do it other than executing the copy and paste commands after the occurrences have been selected.

This should also bring along any constraints that exist between the selected occurrences.

 

Here is a sample code :

 

    Dim oDoc As AssemblyDocument
    Set oDoc = ThisApplication.ActiveDocument
   
    Dim oAssyDef As AssemblyComponentDefinition
    Set oAssyDef = oDoc.ComponentDefinition
    
    Call oDoc.SelectSet.Clear
    
    Call oDoc.SelectSet.Select(oAssyDef.Occurrences.Item(1))
    Call oDoc.SelectSet.Select(oAssyDef.Occurrences.Item(6))

    Dim oCopyControlDef As ControlDefinition
    Set oCopyControlDef = ThisApplication.CommandManager.ControlDefinitions.Item("AppCopyCmd")
    oCopyControlDef.Execute

    Dim oPasteControlDef As ControlDefinition
    Set oPasteControlDef = ThisApplication.CommandManager.ControlDefinitions.Item("AppPasteCmd")
    oPasteControlDef.Execute

Regards,

Balaji

 



Balaji
Developer Technical Services
Autodesk Developer Network

0 Likes
Message 10 of 10

GeorgK
Advisor
Advisor

Hello Balaji,

 

Thanks for your help. But I though that there may be a function like in Autocad.

 

Georg

0 Likes