
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi All,
I'm Working on creating Angle constraint by using ILogic. I'm using below functional code to create new Angle constraint. I want to change the maximum limit once the angle constraint got created. Please give your suggestions.
Existing Function code I'm Using now:
oAxis1 = oAsmCompDef.WorkAxes.Item ("Y Axis")
oAxis2 = comp.Definition.WorkAxes("Y Axis")
comp.CreateGeometryProxy(oAxis2, oproxyAxis2)
If Not ConstraintExists(comp, ObjectTypeEnum.kAngleConstraintObject, oproxyAxis2, oAxis1) Then
oAConstraint = oAsmCompDef.Constraints.AddAngleConstraint(oproxyAxis2, oAxis1, 0, 78594)
'78594 refers to the undirected angle constraint solution type. 78593 refers to
'directed (which is default), and 78595 is the referenced vector solution
oAConstraint.ConstraintLimits.MaximumEnabled = True
oAConstraint.ConstraintLimits.Maximum.Expression = "45 deg"
oAConstraint.ConstraintLimits.MinimumEnabled = True
oAConstraint.ConstraintLimits.Minimum.Expression = "0 deg"
If oAConstraint.HealthStatus = oAConstraint.HealthStatus.kInconsistentHealth Then
oAConstraint.Delete
oAxis1 = oAsmCompDef.WorkAxes.Item("Y Axis")
oAxis2 = comp.Definition.WorkAxes("Z Axis")
comp.CreateGeometryProxy(oAxis2, oproxyAxis2)
If Not ConstraintExists(comp, ObjectTypeEnum.kAngleConstraintObject, oproxyAxis2, oAxis1) Then
oAConstraint = oAsmCompDef.Constraints.AddAngleConstraint(oproxyAxis2, oAxis1, 0, 78594)
'78594 refers to the undirected angle constraint solution type. 78593 refers to
'directed (which is default), and 78595 is the referenced vector solution
oAConstraint.ConstraintLimits.MaximumEnabled = True
oAConstraint.ConstraintLimits.Maximum.Expression = "45 deg"
oAConstraint.ConstraintLimits.MinimumEnabled = True
oAConstraint.ConstraintLimits.Minimum.Expression = "0 deg"
If oAConstraint.HealthStatus = oAConstraint.HealthStatus.kInconsistentHealth Then
oAConstraint.Delete
oAxis1 = oAsmCompDef.WorkAxes.Item("Y Axis")
oAxis2 = comp.Definition.WorkAxes("X Axis")
comp.CreateGeometryProxy(oAxis2, oproxyAxis2)
If Not ConstraintExists(comp, ObjectTypeEnum.kAngleConstraintObject, oproxyAxis2, oAxis1) Then
oAConstraint = oAsmCompDef.Constraints.AddAngleConstraint(oproxyAxis2, oAxis1, 0, 78594)
'78594 refers to the undirected angle constraint solution type. 78593 refers to
'directed (which is default), and 78595 is the referenced vector solution
oAConstraint.ConstraintLimits.MaximumEnabled = True
oAConstraint.ConstraintLimits.Maximum.Expression = "45 deg"
oAConstraint.ConstraintLimits.MinimumEnabled = True
oAConstraint.ConstraintLimits.Minimum.Expression = "0 deg"
Thanks & Regards,
Manoj Sampath
Solved! Go to Solution.