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

feat.IsSelected does not work for feat type = "PLANE" #102

Open
MabeProductique opened this issue Jun 6, 2023 · 3 comments
Open

feat.IsSelected does not work for feat type = "PLANE" #102

MabeProductique opened this issue Jun 6, 2023 · 3 comments
Assignees

Comments

@MabeProductique
Copy link

Try this code on version = Xarial.XCad.0.8.0-beta.4687

//name = name of a plane

bool result = doc.Features.TryGet(name, out IXFeature feat);
feat.Select(false);
if (!feat.IsSelected)...

@MabeProductique
Copy link
Author

current workaround
result = doc.Model.Extension.SelectByID2(name, "PLANE", 0, 0, 0, false, 0, null, 0);

@artem1t artem1t self-assigned this Jun 7, 2023
@artem1t
Copy link
Contributor

artem1t commented Jun 7, 2023

This is an interesting issue. The problem is features in SOLIDWORKS expose 2 interfaces (IFeature) and a specific interface (e.g. IRefPlane). Depending on the way it is selected the actual selected object is either IFeature or IRefPlane and the dispatches are different so the comparison returns false. As xCAD IXFeature combines both of these in a single type (e.g. IXPlane), it makes sense to consider this case. Dev version has a fix for this and now handles both cases

@MabeProductique
Copy link
Author

Thank you for your efforts ;)

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

2 participants