Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Navigation
- Tecnomatix
- Forums
- Blogs
- Knowledge Bases
- Groups

- Siemens PLM Community
- Tecnomatix
- Plant Simulation
- Rotation of a Graphic

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

08-10-2016 07:00 AM - edited 08-10-2016 07:06 AM

Hello All,

I am trying to rotate Graphics to an angle. I have tried the SetGraphicRotation. But my issue is to turn the Graphic twice( Turn it to an angle, for example, 45° along the X-Axis in the first call and turn it x° in the Z-Axis in the next call). When the second rotation is called, I want the new rotation to be added to the previous rotaion. Unfortunately, the previous rotation is not taken. I am using the command SetGraphicRotation. It is just setting another Rotation to the Graphic and not adding another Rotation.

When doing it manually,all I have to do is to set the first rotation, and click on Add Rotation> Define Angle> Define Axes, it works perfectly as desired but not through Simtalk. Since it is not an object but a Graphic, I cannot use the "_3d.Rotation" command too. Is there a way to do this over Simtalk?

Thank you so much.

Regards,

Simpulse

EDIT: I am looking for a command to Add Rotation and not SetRotation.

Solved! Go to Solution.

6 REPLIES

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

08-10-2016 07:31 AM

Hello Simpulse,

You can use the method '_3D.addGraphicTransformation'.

This is the more general method which allows you to add a translation as well. In your case you just use a zero translation.

Regards,

Ralf

------------------------------------------------------------------------------------------------------

Did you like the answer? Then click the Thumbs Up button.

Did the answer solve your problem? Then accept the answer as solution.

Ralf

------------------------------------------------------------------------------------------------------

Did you like the answer? Then click the Thumbs Up button.

Did the answer solve your problem? Then accept the answer as solution.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

08-10-2016 07:58 AM - edited 08-10-2016 07:59 AM

Hello Ralf,

Thank you for your reply. However, the previous rotation is not taken in the succeeding rotation. I have attached a test model if it helps. During the second call of the method, I want the previous rotation of 60° to also be taken into account when calcualting the new Rotation. I can do this manually by setting the first rotation, opening the 3D properties> Add Rotation as shown in the picture attached. I would like to know if a new rotation can be added by code. Could you please take a look into it? Thank you so much for your time.

Regards,

Simpulse

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

08-10-2016 08:01 AM

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

08-10-2016 08:03 AM

Perfect. Exactly what I needed. Thank you so much, Ralf.

Regards,

Simpulse

Regards,

Simpulse

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

08-10-2016 10:01 AM - edited 08-10-2016 10:03 AM

I'd like to add one final suggestion:

With _3D.set/addGraphicRotation, you cut the graphic inheritance (if it isn't already cut). If you actually wanted to modify your graphics for a particular object, that's alright.

But if you actually just wanted to accumulate rotations of an entire object (for instance a whole SingleProc), typically, you would have just assigned a new value to the _3D.Rotation attribute. To add a rotation in such a case, you can use the helper function basis.~._3D.concatenateRotations.

This function allows you to calculate a value that you can assign to e.g. _3D.Rotation:

-- Example 1: Two "anonymous" rotations var r := basis.~._3D.concatenateRotations(makeArray(45, 0, 0, -1), makeArray(45, 0, 0, -1)) -- The result will be [90, 0, 0, -1] or [-90, 0, 0, 1]. -- This also works with different rotation axes but with the same axis I can write the example without a calculator. myObject._3D.Rotation := r -- Example 2: "Add Rotation" var r := basis.~._3D.concatenateRotations(myObject._3D.Rotation, makeArray(10, 1, 0, 0)) -- The result will be the same as "Add Rotation" with 10 degrees around the X axis myObject._3D.Rotation := r

You can also use the calculation result for _3D.setGraphicRotation, of course.

I know you wrote that you are working on a graphic instead of on an object but I frequently saw that as a workaround for actually transformating the object visually...

Did you like the answer? Then click the Thumbs Up button.

Did the answer solve your problem? Then accept the answer as solution

Did the answer solve your problem? Then accept the answer as solution

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

08-11-2016 04:32 AM

Regards,

Simpulse

Follow Siemens PLM Software

© 2018 Siemens Product Lifecycle Management Software Inc