Ilogic If part exists then use different mate offset value

Ilogic If part exists then use different mate offset value

Anonymous
Not applicable
249 Views
1 Reply
Message 1 of 2

Ilogic If part exists then use different mate offset value

Anonymous
Not applicable

Im trying to figure out the code in a rule for searching for a part that contains the name "ZAP" and if the part is in there the following mate of the next inserted part offset value is to be increased by .079. If the part cannot be found then forgo the .079 increase. 

 

Any help please?

I am able to get this to detect the part true or false

Dim oDoc As AssemblyDocument = ThisDoc.Document

Dim oComps As ComponentOccurrences = oDoc.ComponentDefinition.Occurrences

Dim PartExists As Boolean = False
For Each oComp As ComponentOccurrence In oComps
	If oComp.Name.Contains("ZAP") Then
		PartExists = True
		Exit For
	End If
Next 

But i cant get if partexists = true then

(constrain with this dimension)

else if part exisit = false then

(constrain with other dimension)

 

0 Likes
250 Views
1 Reply
Reply (1)
Message 2 of 2

johnsonshiue
Community Manager
Community Manager

Hi! "Exit For" will abort the For Loop. Is it what you want?

Many thanks!



Johnson Shiue (johnson.shiue@autodesk.com)
Software Test Engineer
0 Likes