How to uncheck "Constrain"

How to uncheck "Constrain"

nitinjambhale
Advocate Advocate
1,264 Views
3 Replies
Message 1 of 4

How to uncheck "Constrain"

nitinjambhale
Advocate
Advocate

Hi Guys,

I am trying to simulate the Copy + Move command from the API.

 

Manual Steps: I am selecting 2 elements and pressing the "CO" command, then I need to uncheck the "Constrain" checkbox, and then I am selecting the different location to paste it.

 

The question is, how I can uncheck "Constrain" programmatically?

 

nitinjambhale_0-1602220997069.png

 

0 Likes
Accepted solutions (1)
1,265 Views
3 Replies
Replies (3)
Message 2 of 4

naveen.kumar.t
Autodesk Support
Autodesk Support

Hi @nitinjambhale ,

How are you executing copy and move commands?

 

Are you using postable command or ElementTransformUtils?

 

As per my understanding, if you are using the postable command, you can check/uncheck the constrain option.

If you are using ElementTransformUtils.CopyElement/ElementTransformUtils.MoveElement you will provide a point as one of the parameters so here no need to check/uncheck the constrain option. The element will be moved to/copied to a  point(XYZ).

 

I hope this helps.

 

If this doesn't help, Could you please explain why you need to uncheck the constrain option?


Naveen Kumar T
Developer Technical Services
Autodesk Developer Network

0 Likes
Message 3 of 4

nitinjambhale
Advocate
Advocate

Hi,

I am using ElementTransformUtils.CopyElements...

 

If I do not deselect "Constrain" or press shift, I only allowed to paste that vertically, but if I press shift and then move my cursor, I can allow anywhere to paste that fitting.

 

Can you please give me an example, how can I achieve this with PostableCommands?

 

 

 

0 Likes
Message 4 of 4

nitinjambhale
Advocate
Advocate
Accepted solution

Hi Naveen,

It's done! Actually, I used another overload of CopyElements that takes transform...

0 Likes