Ilogic to detect features with errors

Ilogic to detect features with errors

JorisSteurs1246
Advocate Advocate
1,430 Views
5 Replies
Message 1 of 6

Ilogic to detect features with errors

JorisSteurs1246
Advocate
Advocate

Some features in my part  give me sometimes an error because they didn't change the geometry.

This behaviour is intended. 

What I would like to do is to detect the error with iLogic, so that when the error happens I can suppress the feature.

Is that possible ?

 

Have a look at the screenshot attached.

 

thanks

 

Joris

0 Likes
Accepted solutions (1)
1,431 Views
5 Replies
Replies (5)
Message 2 of 6

Curtis_Waguespack
Consultant
Consultant

Hi  JorisSteurs1246,

See this link:

https://forums.autodesk.com/t5/inventor-customization/ilogic-to-count-features-without-including-tho...

 

I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com

EESignature

0 Likes
Message 3 of 6

JorisSteurs1246
Advocate
Advocate

Hi  Curtis,

 

That link seemed  to have all the info I need and derived the code below from it.

 

SyntaxEditor Code Snippet

For Each oFeature As PartFeature In ThisDoc.Document.ComponentDefinition.Features
If oFeature.HealthStatus = HealthStatusEnum.kBeyondStopNodeHealth Then
oFeature.Suppressed = True
End If
Next

But unfortunatly that didn't work

 

J. 

0 Likes
Message 4 of 6

Curtis_Waguespack
Consultant
Consultant
Accepted solution

Hi JorisSteurs1246,

 

I think you want to use kInErrorHealth rather than kBeyondStopNodeHealth.

 

Of you might use kUpToDateHealth , something like this:

 

If oFeature.HealthStatus <> HealthStatusEnum.kUpToDateHealth Then ...

 

 

Also just as a tip, you can search and ask programming questions of this type on the Inventor Customization forum too:
http://forums.autodesk.com/t5/Autodesk-Inventor-Customization/bd-p/120

 

I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com

 

 

HealthStatusEnum Enumerator

Description

Constants signifying the state of the Object.

Methods

Name Value Description
kBeyondStopNodeHealth 11785 Object is beyond stop node in the browser.
kCannotComputeHealth 11783 Object cannot be evaluated.
kDeletedHealth 11782 Object has been destroyed. You may be holding on to an empty 'shell' of the Object.
kDriverLostHealth 11780 Object is driven by data from other Object(s), and one or more of them have been disconnected.
kInconsistentHealth 11786 Object is inconsistent with another object.
kInErrorHealth 11781 Object's internal state is in error.
kInvalidLimitsHealth 11789 Object has bad limits. e.g. max < min.
kJointDOFLockedHealth 11790 Object is locked Joint.
kNewlyAddedHealth 11788 Object is newly added or unsuppressed and has not been solved yet.
kOutOfDateHealth 11779 Object needs to be recomputed with respect to its 'driver(s)'.
kRedundantHealth 11787 Object's solution is redundant with another object.
kSuppressedHealth 11784 Object has been suppressed.
kUnknownHealth 11777 Object's status is not known.
kUpToDateHealth 11778 Object is up to date.

EESignature

Message 5 of 6

JorisSteurs1246
Advocate
Advocate

Hi Curtis,

 

Thank you that helped me a lot .  The other methods can come in handy also.

Can you point me to the place where you got these methods from?

Very likely there is more useful stuff for me to learn about.

 

Thanks again

 

Joris

0 Likes
Message 6 of 6

Curtis_Waguespack
Consultant
Consultant

Hi JorisSteurs1246,

 

You can find this in the Programming help files. If you look in the Help pull down it will look something like this image.

 

I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com

 

EESignature

0 Likes