Skip to content

Can we wrap AccessSelections/ModifyDefinition? #22

@brinkdinges

Description

@brinkdinges

The current method for changing feature definitions can be made more user-friendly. These are the current steps:

  1. Get the xFeatureData object from IFeature.GetDefinition
  2. Call AccessSelections on the FeatureData object. Pass the part object + null or assembly + component.
  3. Call any method or set any property that requires user selection
  4. Call IFeature.ModifyDefinition. Pass the part object + null or assembly + component.

The protocol is pretty straightforward, but can we make it more user-friendly? Some ideas:

  • Create a big switch for every feature type, cast the FeatureData object to the correct type and call AccessSelections on that.
  • Or make that call dynamic after a type check?
  • Split modifying part features and assembly features so we have a method for each one
  • Wrap it in a try-catch-finally block so we always call ModifyDefinition at the end

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions