Rotate a Sketch Text on a Face in Assembly is not working

Rotate a Sketch Text on a Face in Assembly is not working

liminma8458
Collaborator Collaborator
489 Views
2 Replies
Message 1 of 3

Rotate a Sketch Text on a Face in Assembly is not working

liminma8458
Collaborator
Collaborator

Hi,

 

I am creating a sketch Text on a face in assembly, using the methodology from Xiaodong Liang in the article http://adndevblog.typepad.com/manufacturing/2016/09/create-sketch-text-on-face-of-assembly.html. This code works fine.

 

The problem is that I want to add rotation to the text and this rotation code does not work. I put the following code at the end:

oSketchText.Style.Rotation = 1.57

It is not working. "oSketchText.Rotation = 1.57" neither.

 

Actually, similar code works fine for sketch in drawing mode as i tested

 

Anyone can help?

 

Thanks

 

Limin

 

 

Thanks
Limin
Inventor pro 2023 64 bit update 5.3; Windows 11 pro 64 bit version 24H2; Office 2013 64 bit

Download iCable in App Store to Create Cables Easily

0 Likes
Accepted solutions (1)
490 Views
2 Replies
Replies (2)
Message 2 of 3

chandra.shekar.g
Autodesk Support
Autodesk Support
Accepted solution

Hi Limin,

 

There are 4 rotation option as below image and that should be defined in PI (3.14159265358979).

 

Rotation.png

 

In VBA, 4 rotation can be achieved by following.

 

oSketchText.Rotation = 0 - 0 degrees

oSketchText.Rotation = 2 * Math.Atn(1) - 90 degrees

oSketchText.Rotation = 4 * Math.Atn(1) - 180 degrees

oSketchText.Rotation = 6 * Math.Atn(1) - 270 degrees

 

Please feel free to contact if there is any doubt.

 

If solves your problem, click on "Accept as solution" or give a "Kudo".

 

Thanks and regards,

 

 


CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network



0 Likes
Message 3 of 3

liminma8458
Collaborator
Collaborator

Hi, CHANDRA,

This solves my problem. Looks like it only accepts exact PI or PI equivalent expression, but not short digit number.

Thank you very much

 

Thanks
Limin
Inventor pro 2023 64 bit update 5.3; Windows 11 pro 64 bit version 24H2; Office 2013 64 bit

Download iCable in App Store to Create Cables Easily

0 Likes