Ilogic rule for a particular sheet to find the dimension overrides

Ilogic rule for a particular sheet to find the dimension overrides

ArunS2DHBM
Enthusiast Enthusiast
406 Views
2 Replies
Message 1 of 3

Ilogic rule for a particular sheet to find the dimension overrides

ArunS2DHBM
Enthusiast
Enthusiast

Hi,

 

I have 3 sheets names, Assy:1, Body:1 and Nameplate:1

i want a rule for sheet name Assy:1 to find the override in any dimension having "Hold" mentioned in it. 

if so then my parameter "Status" should carry a value "X" else it should be "-"

 

Please help me with the code

 

Thanks in advance.

0 Likes
Accepted solutions (2)
407 Views
2 Replies
Replies (2)
Message 2 of 3

theo.bot
Collaborator
Collaborator
Accepted solution

The first step is define the sheet in your drawing, secondly loop thru all dimension on your sheet. You can check if the dimension text contains a particular text and is the hidevalue is true of false. here's a small sample assuming you have that parameter "Status" in your drawing document.:

 

Dim oDoc As DrawingDocument
oDoc = ThisDoc.Document

Dim oSheet As Sheet
oSheet = oDoc.Sheets("Assy:1")

Dim oFound As Boolean
oFound = False

'loop thru all dimensions on sheet
For Each oDim As DrawingDimension In oSheet.DrawingDimensions
	'check if HideValue is true
	If oDim.HideValue = True Then
		'check if dimension text contains "hold"
		If oDim.Text.Text.Contains("Hold") = True Then
			oFound = True
			Exit For
		End If
	End If
Next


If oFound = True Then
	Status = "X"
Else
	Status = "-"
End If

 

Message 3 of 3

ArunS2DHBM
Enthusiast
Enthusiast
Accepted solution

Thanks for the code. it works perfectly.