brenkmanco / hackpdm

Open Source PDM System
GNU General Public License v3.0
19 stars 4 forks source link

GetAllExternalReferences4 returns dependencies we don't want #33

Open matt454357 opened 9 years ago

matt454357 commented 9 years ago

GetAllExternalReferences4 returns dependencies based on external references from sketch entity constraints. This type of external reference is created, for example, when editing a part in the context of a parent assembly, and creating a constraint to locate a hole relative to something in the assembly. It is indicated in the feature tree for the part by an arrow ("->") next to the feature with the external reference.

The result is that much more stuff gets committed than the user expects. That's because the assembly is a dependency of the part, so the assembly and all of its components get committed when the user intended to only commit the part.

matt454357 commented 9 years ago

We may be able to limit returned dependencies with a search filter. Take a look at the SwDmSearchFilters Enumeration. It appears that the SwDmSearchInContextReference filter groups in-context assembly references with a lot of other types of references. I'm not sure we can use this filter.

SwDmSearchInContextReference: 32 = Search for base parts for derived parts, mirrored parts, derived component parts, and in-context assembly references

matt454357 commented 8 years ago

No, don't use SwDmSearchInContextReference(32). We want dependencies on derived and mirrored parts. We just don't want the part in-context references.

Another possibly solution: when we loop through the referenced documents, discard references where the parent is a part and the child is an assembly.