cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X

How to determine whether a dimension/annotation is valid

JB_87049
15-Moonstone

How to determine whether a dimension/annotation is valid

I'm using CreoToolkit with Creo 6.0.4.0
When you scan a 3D model for 3D annotations even deleted annotations can be found.
I don't use the visit functions as I'm not able to find all the dimension types this way.
I have not found a method to distinguish deleted (invalid) annotations from valid annotations.
Is there a way to check the status (deleted/not-deleted) of an annotation in Toolkit?

 

Thank you very much in advance.

ACCEPTED SOLUTION

Accepted Solutions
FV
17-Peridot
17-Peridot
(To:JB_87049)

the second output argument of ProCombstateAnnotationsGet(...) returns shown/erased state - 0 is shown and 1 is erased ('displayed' and 'undisplayed' in Creo6 lingo). An annotation element is not going to be a member of the returned array if it had been never attached to a combstate. ProAnnotationIsShown(...) will return the global status of the annotation in a solid model - if it returns false I don't think it is necessary to drill down to combstates.

I do not know about deleted/undeleted states for annotations or annotation elements and if those things are in pro/toolkit in the first place. There are old enums from pro/develop days which become ProDrawMode in pro/toolkit - maybe this is the point of the confusion. 

By the way, ProSolidAnnotationelemsVisit(...)  is to be used for 'free' notes, refdims, etc... The function was not intended to be a global collector for all ( free and feat bound) annotation elements. For feat bound annotation elems one need to visit features in a solid and filter on ProFeattype and then visit annot elems in collected  features.

HIH.

View solution in original post

11 REPLIES 11
MurphyMin
12-Amethyst
(To:JB_87049)

 

Does this help you? i think the annotations is invalid while  missing the reference or the status is IsIncomplete,

but i checked it in Otkjava, however, Toolkit should be the same

annotation.JPG

JB_87049
15-Moonstone
(To:MurphyMin)

There is a problem with the functions HasMissingReferences and IsComplete (at least in the C library, I haven't tested other libraries)..
E.g. if you have a driven dimension that has semantic references assigned to it, these functions don't detect the references.

MurphyMin
12-Amethyst
(To:JB_87049)

How about this method as an index for the annotation ?

wfcAnnotation.Annotation.IsInactive

JB_87049
15-Moonstone
(To:MurphyMin)

Perhaps a brief overview how to reproduce the problem.
Create a model with multiple combined states. Assign one linear dimension (using Show Annotations) to multiple combined states. Delete this linear dimension by deleting it on one combined state. Although not visible the original linear dimension can still be detected on the other combined state. In an attempt to filter this dimension out of my list of dimensions I have now tested

• ProAnnotationIsInactive
• ProModelitemIsHidden
• ProAnnotationIsShown

None of them seems to work like one would expect.
The behaviour of the last one "ProAnnotationIsShown" is the strangest of them all. It will give "PRO_B_FALSE" for the left-over dimension of the deleted annotation but it will only work for annotations of type PRO_DIMENSION. If you have annotations of type PRO_SURF_FIN, PRO_GTOL, PRO_NOTE, ... the result will also be "PRO_B_FALSE" although they are visible. This is becoming too big of a frustration. Any help to shine some light on this behaviour is very much appreciated.

JB_87049
15-Moonstone
(To:JB_87049)

I discovered my conclusion ProAnnotationIsShown is not correct for other types than PRO_DIMENSION is incorrect. Apparently this function looks - besides the value of the Annotation Settings - at which combined state is active and only gives information about the active combined state of the model. So it can't be used to distinguish valid annotations and remaining deleted annotations.

MurphyMin
12-Amethyst
(To:JB_87049)

Would you mind to send the drawing that involved the situation you mentioned, and give some notes in it, so that i can truely get you point, and i will test in your drawing, also will send you the result while i have found the solution,however, sometimes i have some connection issue with ptc community that brings me some problem to get you message form this web.

JB_87049
15-Moonstone
(To:MurphyMin)

Thank you for your reply.
It is very easy to reproduce this.
Step 1
Create a model with multiple combined states

Step 2

Create multiple driving dimensions (show annotations) on this model.

Step 3

Assign one of the driving dimensions to multiple combined states

Step 4

Delete this driving dimension by selecting it on one combined state and pressing the delete function.

Step 5

Scan the model in toolkit using ProCombstateAnnotationsGet

 

You'll see the driving dimension is no longer an annotation element but just an ordinary annotation and is still assigned to the other combined states (not on the combined state you pressed the delete function on).

FV
17-Peridot
17-Peridot
(To:JB_87049)

hi all,

for combined states bound annotations (or annotation elements) I would try  ProCombstateAnnotationsGet(...). as far as I know for dimensions this function would list dimension ids (either shown or erased) in comb state  and ignore the rest. Visiting comb states and getting a list of all state bound dimensions is probably what you are looking for.

HIH.

FV.

JB_87049
15-Moonstone
(To:FV)

Thank you for your reply.
Originally I used "ProSolidAnnotationelemsVisit" to create a list of annotations but I found out that I missed annotations by doing so.
Therefore I changed my function to use "ProCombstateAnnotationsGet" as you suggested but as you say it lists all dimensions (either shown or erased/deleted). What I want to accomplish is to identify the erased/deleted dimensions.

FV
17-Peridot
17-Peridot
(To:JB_87049)

the second output argument of ProCombstateAnnotationsGet(...) returns shown/erased state - 0 is shown and 1 is erased ('displayed' and 'undisplayed' in Creo6 lingo). An annotation element is not going to be a member of the returned array if it had been never attached to a combstate. ProAnnotationIsShown(...) will return the global status of the annotation in a solid model - if it returns false I don't think it is necessary to drill down to combstates.

I do not know about deleted/undeleted states for annotations or annotation elements and if those things are in pro/toolkit in the first place. There are old enums from pro/develop days which become ProDrawMode in pro/toolkit - maybe this is the point of the confusion. 

By the way, ProSolidAnnotationelemsVisit(...)  is to be used for 'free' notes, refdims, etc... The function was not intended to be a global collector for all ( free and feat bound) annotation elements. For feat bound annotation elems one need to visit features in a solid and filter on ProFeattype and then visit annot elems in collected  features.

HIH.

JB_87049
15-Moonstone
(To:FV)

Thank you for your reply.
Apparently the behaviour of deleted annotations still being detected is a bug in Creo 6.0.4.0 that will be solved in Creo 6.0.5.0

Announcements


Top Tags