iLogic angle

iLogic angle

GeorgK
Advisor Advisor
1,153 Views
4 Replies
Message 1 of 5

iLogic angle

GeorgK
Advisor
Advisor

Hello Together,

 

how could I get the positive or negative angle?

 

 

angle = Measure.Angle("KR10_R1100_CR_6:2", "Arbeitsebene1", "KR6_R700_CR_5:1", "Arbeitsebene1")
MsgBox(angle,MessageBoxIcon.Exclamation)

 

Winkel_1.jpg

 

Winkel_2.jpg

 

Thank you Georg

0 Likes
1,154 Views
4 Replies
Replies (4)
Message 2 of 5

Balaji_Ram
Alumni
Alumni

Hi Georg,

 

I do not see a way to let Measure.Angle to provide that information.

 

But, it should be possible to know on how the moving workplane is tilted by analyzing its normal vector.

 

Here are two screenshots to demonstrate this :

 

Up.PNG

 

 

Up.PNG

 

The iLogic code to retrieve the normal would be :

 

Dim oAssemblyDef As AssemblyComponentDefinition
oAssemblyDef = oPartDoc.ComponentDefinition

Dim oMovingPlane As WorkPlane
oMovingPlane = oAssemblyDef.WorkPlanes(5)
		
Dim movingPlane As Plane
movingPlane = oMovingPlane.Plane

Dim movingPlaneNormal As UnitVector
movingPlaneNormal = movingPlane.Normal

MessageBox.Show( "Moving X :" & movingPlaneNormal.X & " Y :" & movingPlaneNormal.Y & " Z :" & movingPlaneNormal.Z, "iLogic")

Regards,

Balaji



Balaji
Developer Technical Services
Autodesk Developer Network

0 Likes
Message 3 of 5

GeorgK
Advisor
Advisor
Hello Balaji,

the sample does not work. Thanks

Georg
0 Likes
Message 4 of 5

Balaji_Ram
Alumni
Alumni

Hi Georg,

 

I will need more information / sample files to investigate this further and know what does not work.

 

In a sample assembly that i created that mimics the robot manipulator kind of assembly that you showed, the iLogic code did work.

 

Regards,

Balaji

 

 

 

 



Balaji
Developer Technical Services
Autodesk Developer Network

0 Likes
Message 5 of 5

Balaji_Ram
Alumni
Alumni

Hi Georg,

 

Thanks for sending me your sample files to understand the issue.

 

I have attached the sample files that I was in my tests earlier and a recording of the results to the discussion forum post.

http://autode.sk/1HfGIx5

 

I do not think, there is a direct way to let Measure.Angle return the angle value based on a reference.

It has no idea that the angle values are to be measured along a certain direction on the other work plane.

 

By identifying the normal of the moving plane, it is possible to get this information.

 

The iLogic code in the sample file is not a generic way, but will need to be tweaked to get it working depending on 

which axis the two workplanes are constrained to rotate.

 

Hope this helps.

 

Regards,

Balaji



Balaji
Developer Technical Services
Autodesk Developer Network

0 Likes