iLogic measure angle between selected faces

iLogic measure angle between selected faces

Anonymous
Not applicable
1,748 Views
1 Reply
Message 1 of 2

iLogic measure angle between selected faces

Anonymous
Not applicable

I've been developing a rule that works very well except for one part.  I dont know the proper syntax to measure an angle between selected faces using iLogic.  The Measure.Angle command seems to be looking for string values (ex. a work plane's name).  Does anyone know the proper syntax so I can have the rule check if the planes intersect?

 

I know using the measure tool is much simpler, but this is an example from a section of a more extensive rule i'm developing.

 

SyntaxEditor Code Snippet

Dim oAsmCompDef As AssemblyComponentDefinition
oAsmCompDef = ThisApplication.ActiveDocument.ComponentDefinition

Dim oPlane1 As Face
oPlane1 = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kAllPlanarEntities,"Select the face of the part")

Dim oPlane2 As Face
oPlane2 = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kAllPlanarEntities,"Select an intersecting plane")

oMeasure = Measure.Angle(oPlane1,oPlane2)

If oMeasure = 0 Or 180 Then
MessageBox.Show("Selected planes do not intersect. Please select intersecting planes.","iLogic")
Return
End If
0 Likes
Accepted solutions (1)
1,749 Views
1 Reply
Reply (1)
Message 2 of 2

Anonymous
Not applicable
Accepted solution

Answered my own question...  The Measure function in ilogic seems to only work with work features.  Planes must be created, constrained to the faces, then the measure function searches for those planes' names to measure between. Here is code for measuring between two faces.

 

oFace1 = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kAllPlanarEntities,"Select Plane1")
oFace2 = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kAllPlanarEntities,"Select Plane2")

Dim oAsmCompDef As AssemblyComponentDefinition
oAsmCompDef = ThisApplication.ActiveDocument.ComponentDefinition

Dim oTG As TransientGeometry
oTG = ThisApplication.TransientGeometry

Try
	oAsmCompDef.WorkPlanes.Item("iLogic_Proxy_Plane1").Delete
	oAsmCompDef.WorkPlanes.Item("iLogic_Proxy_Plane2").Delete
Catch
	'Do nothing
End Try

oPlane1 = oAsmCompDef.WorkPlanes.AddFixed(oTG.CreatePoint(0,0,0),oTG.CreateUnitVector(1,0,0),oTG.CreateUnitVector(0,1,0),False)
oPlane1.Name = "iLogic_Proxy_Plane1"
oPlane2 = oAsmCompDef.WorkPlanes.AddFixed(oTG.CreatePoint(0,0,0),oTG.CreateUnitVector(1,0,0),oTG.CreateUnitVector(0,1,0),False)
oPlane2.Name = "iLogic_Proxy_Plane2"

oAsmCompDef.Constraints.AddFlushConstraint(oPlane1,oFace1,0)
oAsmCompDef.Constraints.AddFlushConstraint(oPlane2,oFace2,0)

oDistance = Measure.MinimumDistance(oPlane1.Name,oPlane2.Name)

MessageBox.Show(oDistance, "iLogic")

oAsmCompDef.WorkPlanes.Item("iLogic_Proxy_Plane1").Delete
oAsmCompDef.WorkPlanes.Item("iLogic_Proxy_Plane2").Delete

 

0 Likes