Message 1 of 5
iLogic setting dimensions driven or not

Not applicable
10-31-2014
12:18 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm trying to switch between two sets of dimensions being driven or not by using iLogic, but I'm having a bit of a weird issue.
One of the dimensions I named "leaningAngle", and the code looks like this:
SyntaxEditor Code Snippet
Dim oDoc as PartDocument oDoc = ThisDoc.Document Dim oSketch1 As Sketch oSketch1 = oDoc.ComponentDefinition.Sketches.Item("Sketch1") If choice = "Choice1" Then oSketch1.DimensionConstraints.Item(leaningAngle).Driven = False ElseIf choice = "Choice2" Then oSketch1.DimensionConstraints.Item(leaningAngle).Driven = True End If
The weird thing to me about this is that when I change the choice variable to trigger the if statements, its not leaningAngle that changes to driven (or not), but another dimension in the same sketch thats called "d87" and is a hole diameter. So I'm thinking that I need another reference to the leaningAngle dimension, as the name doesn't seem to work, but how do I do that?