Measure the angle between the working plane of the assembly and the working plane of occurence

Measure the angle between the working plane of the assembly and the working plane of occurence

Hubert_Los
Advocate Advocate
378 Views
2 Replies
Message 1 of 3

Measure the angle between the working plane of the assembly and the working plane of occurence

Hubert_Los
Advocate
Advocate

Hi All,


I would like measure the angle between the working plane of the assembly and the working plane of occurence

I can't use codes below

angle = Measure.Angle("componentName1", "Plane1", Assembly, "XY Plane")
		


Any ideas?


Regards,
Hubert.

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

dalton98
Collaborator
Collaborator
Accepted solution

I couldn't get the measure.angle tool to work. This is another way to do it, you have to create a geometry proxy for the plane inside the component.

Dim oAss As AssemblyDocument = ThisApplication.ActiveDocument
Dim XYplane As WorkPlane = oAss.ComponentDefinition.WorkPlanes.Item("XY Plane")
Dim oOcc As ComponentOccurrence
oOcc = oAss.ComponentDefinition.Occurrences.ItemByName("component1:1")
Dim Plane1 As WorkPlane = oOcc.Definition.WorkPlanes.Item("Plane1")
oOcc.CreateGeometryProxy(Plane1, Plane1)

angle = ThisApplication.MeasureTools.GetAngle(XYplane, Plane1) * 180 / PI
MessageBox.Show(angle)

 

Message 3 of 3

Hubert_Los
Advocate
Advocate

It works, thank you.

0 Likes