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

Support of Flip expressions in dynamic blocks. #555

Open
mme1950 opened this issue Feb 11, 2025 · 2 comments
Open

Support of Flip expressions in dynamic blocks. #555

mme1950 opened this issue Feb 11, 2025 · 2 comments
Labels
feature New feature added

Comments

@mme1950
Copy link
Contributor

mme1950 commented Feb 11, 2025

We are trying to read dynamic blocks with Flip operations.
Flip operations apply to a state of the dynamic block. We need to extract the "normal" and the "flipped" version of the state.

I think for this purpose it should be sufficient to read evaluation expression of these types

  • BLOCKFLIPPARAMETER
  • BLOCKFLIPACTION

Respective classes can be set up as

public class BlockFlipParameter : Block2PtParameter {
}

public class BlockFlipAction : BlockAction {
}

I implemented readers and templates for

  • BlockFlipAction
  • BlockAction
  • BlockFlipParameter
  • Block2PtParameter

These evaluation expressions are successfully read and referenced by the state of the dynamic block. This is nice but it is half the job,

To extract the flipped version of the dynamic-block State we have to apply the flip operation to the entities listed in the BlockFlipAction object, i. e. we must mirror all coordinates of the entities at the line defined by the two XYZs provided by the BlockFlipParameter object. Texts, however, must not be mirrored, but the angle and alginment has to be changed.

@DomCR Do you have a suggestion how to include such functionality into ACadSharp?

@DomCR
Copy link
Owner

DomCR commented Feb 12, 2025

Hi @mme1950,

I started working on a Transform utility to make this kind of operations:

The idea was that the user can apply a transformation matrix into any entity.
This feature can be extended for the different BlockAction so they generate their own transformation matrix and apply the transformation into the entities in the block.

Note: the mirroring of the text shouldn't be a problem I think is controlled by TextMirrorFlag.

@DomCR DomCR added the feature New feature added label Feb 12, 2025
@mme1950
Copy link
Contributor Author

mme1950 commented Feb 12, 2025

Hi @DomCR,
this is really great, Thank, you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature added
Projects
None yet
Development

No branches or pull requests

2 participants