Quantcast
Channel: MicroStation Programming Forum - Recent Threads
Viewing all articles
Browse latest Browse all 7260

RE: Resize a rotated rectangle with click and drag

$
0
0

The general approach with element modification is to create a new element that mimics the chosen element.  Then, modify the copy until user has finished modifications.  Finally, add the copy to your DGN model as a new element and delete the original.

That approach sits well with MicroStation's undo/redo logic.  If user cancels the operation, nothing needs to be changed.

There may be some circumstances, such as the one you describe, where the original element can be modified in-place.  If all you're doing is moving, rotating or scaling, then the stored element size is unchanged (even when its geometric depiction is different). 

One way to approach your goal is to set up a local coordinate system (think of a user-defined ACS) aligned with your rectangle.  Modify your element, or create a new element within that coordinate system, then unrotate it when finished.  That way, you're working with orthogonal axes aligned with the geometry you want to create.

Note that, during development, the copy-and-replace idiom is useful because you can directly compare what you've created with what you started with.


Viewing all articles
Browse latest Browse all 7260

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>