Is there an alternative to View.GetOutline() which DOES include Temporary Axes?

被刻印的时光 ゝ 提交于 2019-12-13 03:36:26

问题


Note: This is not answered by the suggested question - it is practically the opposite of it. Besides, it is me who asked that question too and I also linked to it below.

I am fixing someone else's VBA code for SolidWorks which places drawing views next to each other based on their size. Size of a view is taken from bounding box returned by View.GetOutline() and view's position is set by changing View.Position property. The code processes multibody parts, creating one drawing sheet per body.

The problem is that View.Position property corresponds to center of bounding box that includes Temporary Axes while View.GetOutline() does not include them - it returns a bit more than the selection outline shown by SolidWorks GUI.

This is the multibody part and one of the offending drawing views with temporary axes turned on in the SW GUI:

In the drawing you can see:

  • selection outline shown by SW GUI (light blue dotted rectangle)
  • diagonal of the outline returned by View.GetOutline() (red line)
  • center of the view as in View.Position property (red X)
  • temporary axes (blue crosses and lines)

Is there a way to get drawing view's real size, the one that correspond to the bounding box whose center is the View.Position property?

Apparently, the drawing view includes temporary axes from other bodies in this multibody part. That points to the alternative question: Is there a way to prevent temporary axes from other bodies in a multibody part from being included in drawing view of a single body?

For reference, the problem is the same no matter which method is used to create the view (e.g. CreateDrawViewFromModelView3(), CreateUnfoldedViewAt3(), CreateRelativeView(), etc.).

Note: I asked another question that stems from this same problem which I changed because I wrongly assumed that View.GetOutline() does not include Temporary Axes.

来源:https://stackoverflow.com/questions/58649808/is-there-an-alternative-to-view-getoutline-which-does-include-temporary-axes

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!