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

Modelspace Zoom Extents #512

Open
sigster opened this issue Dec 18, 2024 · 2 comments
Open

Modelspace Zoom Extents #512

sigster opened this issue Dec 18, 2024 · 2 comments
Labels
help wanted Extra attention is needed

Comments

@sigster
Copy link

sigster commented Dec 18, 2024

Hi

How can I Zoom Extents in Modelspace after I import data

@sungaoyong
Copy link

sungaoyong commented Dec 25, 2024

my code worked successed with

` CadDocument doc = new CadDocument();

VPort vport = doc.VPorts["*Active"];
if (vport != null)
{
vport.Center = new CSMath.XY(40404219.63209335, 3615454.9612060254);
vport.ViewHeight = 1202.0730586005643;
vport.ViewMode = ViewModeType.FrontClippingZ;
vport.UseDefaultLighting = true;
}`

but not success with CadDocument from a file

@DomCR DomCR added the help wanted Extra attention is needed label Jan 8, 2025
@DomCR
Copy link
Owner

DomCR commented Jan 8, 2025

Hi @sigster

Haven't found a proper way to do it easily, but I think that the trick should be to play with the Entity.GetBoundingBox() and set the VPort *Active values to fit with the entities boxes.

The BoundingBox struct also has methods like Merge(), which you can use to merge different boxes created form entities and have the total boundaries of your drawing.

Hope this helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants