iLogic-Using loops for feature suppresion

iLogic-Using loops for feature suppresion

edgar123trejo
Explorer Explorer
468 Views
3 Replies
Message 1 of 4

iLogic-Using loops for feature suppresion

edgar123trejo
Explorer
Explorer

Really new to using iLogic. Is there a template or explanation for one to use a loop instead of IfElse for feature suppression? I am trying to keep my code short without alot of copy and pasting.

 

Thanks

0 Likes
469 Views
3 Replies
Replies (3)
Message 2 of 4

JaneFan
Autodesk
Autodesk

Please take the following code in iLogic as reference: 

SyntaxEditor Code Snippet

Dim oFeat As PartFeature 
For Each oFeat In ThisDoc.Document.componentdefinition.features
	If oFeat.Suppressed = False Then 
		oFeat.Suppressed = True 
	End If 
Next

 




Jane Fan
Inventor/Fusion QA Engineer
0 Likes
Message 3 of 4

edgar123trejo
Explorer
Explorer

Sorry about this but may you further explain was the syntax means?

 

I modeled a door and i am programming sizes for it. The smaller sizes have some features turned off. How will the syntax work to go back and forth for suppressing and unsuppressing  the features when changing sizes?

 

Thank!

0 Likes
Message 4 of 4

JaneFan
Autodesk
Autodesk

It seems no loops needed since some certain features need be suppressed in case of some certain parameters change. Does the following code work for you? 

SyntaxEditor Code Snippet

If d1 < size Then 
	Feature.IsActive("featurename1") = False
	Feature.IsActive("featurename2") = False 
Else 
	Feature.IsActive("featurename1") = True
	Feature.IsActive("featurename2") = True 
End If  

 




Jane Fan
Inventor/Fusion QA Engineer
0 Likes