Message 1 of 8
Dimensions in Triplicate

Not applicable
05-18-2016
11:31 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Greetings,
The following is a code that works great for dimensioning. The issue I am having is that when I align the dimensions, the code appears to have run three times.
This is what gets created. (see screenshot below)
So I was wondering if someone can identify how or why the dimensions I want are being put on the drawing three times?
I found this code from someone on this forum It is not my original. I do know that it searches all parameters and looks for the prefix that I have identified. I did figure out a way to simply delete the extra dimensions, however, it would be nice to prevent the deletion step.
SyntaxEditor Code Snippet
Dim oDrawDoc As DrawingDocument = ThisDoc.Document Dim oSheet As Sheet = oDrawDoc.ActiveSheet Dim oDrawView As DrawingView = oSheet.DrawingViews(1) Dim oGeneralDimensionsEnum As GeneralDimensionsEnumerator oGeneralDimensionsEnum = oSheet.DrawingDimensions.GeneralDimensions.Retrieve(oDrawView) Dim PrefixStr As String = "RDT_" Dim oGeneralDimension As GeneralDimension For Each oGeneralDimension In oGeneralDimensionsEnum Dim oParameter As Parameter oParameter = oGeneralDimension.RetrievedFrom.Parameter If oParameter.DrivenBy.count <> 0 Then Dim oDrivenByParameter As Parameter For Each oDrivenByParameter In oParameter.DrivenBy If InStr(oDrivenByParameter.Name, PrefixStr) = 0 Then oGeneralDimension.Delete End If Next Else If InStr(oParameter.Name, PrefixStr) = 0 Then oGeneralDimension.Delete End If End If Next