Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

** Community Tip** - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more!
X

- Community
- Creo+ and Creo Parametric
- Customization
- Does anyone know how to calculate drawing view hei...

Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

Jun 11, 2020
05:41 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator

Jun 11, 2020
05:41 AM

Does anyone know how to calculate drawing view height and width by view outline.

I can get drawing view outline using API "ProDrawingViewOutlineGet". I want to know how to get view height and width using this outline ?

Thanks,

Suresh

Solved! Go to Solution.

1 ACCEPTED SOLUTION

Accepted Solutions

Jun 24, 2020
05:56 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator

Jun 24, 2020
05:56 AM

Following is the right code:

Transform3D sheetTransp = drawing.GetSheetTransform(sheetNumber);

Outline3D outline = view.GetOutline();

Point3D point1 = Point3D.create();

point1.set(0, outline.get(0).get(0));

point1.set(1, outline.get(0).get(1));

point1.set(2, outline.get(0).get(2));

Point3D point2 = Point3D.create();

point2.set(0, outline.get(1).get(0));

point2.set(1, outline.get(1).get(1));

point2.set(2, outline.get(1).get(2));

Point3D point11 = sheetTransp.TransformPoint(point1);

Point3D point21 = sheetTransp.TransformPoint(point2);

double width = point21.get(0) - point11.get(0);

double height = point21.get(1) - point11.get(1);

- Tags:
- ollo

3 REPLIES 3

Jun 11, 2020
08:03 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator

Jun 11, 2020
08:03 AM

In CREOSON (Open Source Creo Automation) - you can simply run :

**drawing : view_bound_box**

and you will get this back:

```
{
"status": {
"error": false
},
"data": {
"xmin": 5,
"xmax": 30,
"ymin": 12.5,
"ymax": 15
}
}
```

Then it is just a bit of simple math to get the size.

You might look at the source for how that works as a way to help.

Dave

Jun 11, 2020
08:06 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator

Jun 11, 2020
08:06 AM

Thanks. It was simple math solution with sample Jlink code:

view.SetDisplay(display);

Outline3D outline = view.GetOutline();

this.height = outline.get(0).get(1) - outline.get(0).get(0);

this.width = outline.get(1).get(1) - outline.get(1).get(0);

Jun 24, 2020
05:56 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator

Jun 24, 2020
05:56 AM

Following is the right code:

Transform3D sheetTransp = drawing.GetSheetTransform(sheetNumber);

Outline3D outline = view.GetOutline();

Point3D point1 = Point3D.create();

point1.set(0, outline.get(0).get(0));

point1.set(1, outline.get(0).get(1));

point1.set(2, outline.get(0).get(2));

Point3D point2 = Point3D.create();

point2.set(0, outline.get(1).get(0));

point2.set(1, outline.get(1).get(1));

point2.set(2, outline.get(1).get(2));

Point3D point11 = sheetTransp.TransformPoint(point1);

Point3D point21 = sheetTransp.TransformPoint(point2);

double width = point21.get(0) - point11.get(0);

double height = point21.get(1) - point11.get(1);

- Tags:
- ollo

Announcements

Top Tags