controlling joint with iLogic

controlling joint with iLogic

FeelGoodGirl
Advocate Advocate
1,467 Views
2 Replies
Message 1 of 3

controlling joint with iLogic

FeelGoodGirl
Advocate
Advocate

Hello all,

 

I have a challenge. In my assembly I use different joints. My question is specifically about the cylindrical joint. I know you can specify an angle at the limits. That also works well. Now I want to control the angle using iLogic. Depending on which option it is, you can do/see something:

 

option 1: 90 deg
option 2: 180deg
option 3: free to move between 90 and 180 degrees

 

After a search I only came across code to supress the joint. So that's not what I'm looking for. Someone who can help me?

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

andrewiv
Mentor
Mentor

If you click on the Joint in the ilogic editor you will see all of the parameters that define that joint.  You can change these with iLogic just like any other parameter.  You might have to do this with two joints since you want a static angle and a variable angle.  Create on cylindrical joint that will have the static angle definition and lock it.  You can change this angle to 90 deg for option 1 and 180 deg for option 2.  Then make another cylindrical joint and do not lock it.  Set the start and end range values to 90 deg and 180 deg.  Then when you want option 3 you can suppress the first joint and the second joint will limit the rotation of the part.

Joint parameter.PNG

In the picture the first parameter is the current angular dimension, the second one is the start dimension, the third one is the end dimension, and the last one is the current linear dimension.  There is no start or end dimension for the linear because I don't have those boxes checked in the Joint.

Andrew In’t Veld
Designer / CAD Administrator

Message 3 of 3

andrewiv
Mentor
Mentor
Accepted solution

Here is the rule that I think gets you what you want.

Dim oDoc As AssemblyDocument = ThisApplication.ActiveDocument
Dim oCompDef As AssemblyComponentDefinition = oDoc.ComponentDefinition
Dim oJoint As AssemblyJoint = oCompDef.Joints.Item("Cylindrical:1")
iLogicVb.UpdateWhenDone = True
oOption = InputBox("Option 1, 2, or 3", , 1)

If oOption = 1 Then
	oJoint.Locked = True
	d1 = 90 deg
ElseIf oOption = 2 Then
	oJoint.Locked = True
	d1 = 180 deg
Else
	oJoint.Locked = False
End If

Andrew In’t Veld
Designer / CAD Administrator