Message 1 of 3
Referencing specific dimensions in titleblocks

Not applicable
02-19-2016
11:38 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I've been working working with Curtis on a project involving editing dimensions of titleblocks using iLogic/VBA:
Currently the code is like this:
Dim oDrawDoc As DrawingDocument oDrawDoc = ThisApplication.ActiveDocument Dim oTitleBlockDef As TitleBlockDefinition oTitleBlockDef = oDrawDoc.TitleBlockDefinitions.Item("A-B") Dim oSketch As DrawingSketch oTitleBlockDef.Edit(oSketch) Dim oDim As DimensionConstraint For Each oDim In oSketch.DimensionConstraints If oDim.Parameter.Name = "d0" Then Exit For End If Next Select Case HeightCheck Case ActiveSheet.Height = 11 oDim.Parameter.Value = (8.5 - 0.25 - 0.25 - 0.75 - (0.25*5)) * 2.54 ThisApplication.ActiveDocument.Update Case ActiveSheet.Height = 17 oDim.Parameter.Value = (11 - 0.25 - 0.25 - 0.75 - (0.25 * 5)) * 2.54 ThisApplication.ActiveDocument.Update End Select oTitleBlockDef.ExitEdit(True)
Where there's a for loop to search for a dimension labeled "d0", and then modifies it.
The problem is that I have to execute the rule *twice* for it to actually adjust to the sheet, which tells me that there's some kind of indexing problem or return value of the for loop, or something to that effect.
Is there a way to reference the 'd0' dimension explicitly by name and modify it without having to search for it?