Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can we wrap AccessSelections/ModifyDefinition? #22

Open
brinkdinges opened this issue Jan 2, 2023 · 0 comments
Open

Can we wrap AccessSelections/ModifyDefinition? #22

brinkdinges opened this issue Jan 2, 2023 · 0 comments

Comments

@brinkdinges
Copy link
Member

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant