Determine whether part file is a sketch

Determine whether part file is a sketch

youann21700
Advocate Advocate
172 Views
2 Replies
Message 1 of 3

Determine whether part file is a sketch

youann21700
Advocate
Advocate

Morning,

 

I have a few rules that scan folders and determine part properties (generic material checker/drawing state checker).

I want these rules to skip certain types of parts, i.e. Sketch parts. Files used in pipe runs (XXXX.Route.01.ipt files)/frame generator skeletons. If there an easy way to differentiate these .ipt files from "regular" .ipt files.

 

Thanks

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

WCrihfield
Mentor
Mentor
Accepted solution

Hi @youann21700.  If there was always something unique about their file names, such as the "Route" term in your example, then you could likely check for that term in their file names.  But other than that, I don't think there is anything at the 'file' level that can be checked to determine that specific difference.  At the purely iProperty level, a model file that only contained sketches, and no features, would not have any 'Mass', and may not have any 'Volume' either, which could be checked for.  But the next step would likely be checking something like:

If oDoc.ComponentDefinition.Features.Count = 0 Then

and

If oDoc.ComponentDefinition.Sketches.Count > 0 Then

...but only after you have determined that it is a model file (.ipt or .iam), instead of a drawing (.idw or .dwg), because drawings don't have a ComponentDefinition.  Just some initial thoughts.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 3 of 3

cidhelp
Advocate
Advocate

Hi @youann21700,

 

for frames / tube&pipes you can use the Document.DocumentInterests collection.

 

In Frames there are DocumentInterests with Names like:

FrameDoc

FrameMemberDoc

SkeletonDoc

EndPlate

 

Tube&Pipes have these DocumentInterests:

Piping Runs Environment

Piping Run Environment

Piping Hose Environment

Piping Segment

Piping Route Environment

 

Perhaps there are some more of such DocumentInterest's.

0 Likes