This example shows how to locate a model entity in the space of a drawing view.
Points selected in a drawing are returned in the space of the underlying model, rather than in the space of the drawing sheet. Given a selection point in the space of the model, where is that point in the space of the drawing view?
This example shows how to use the transform-related APIs to go from model space to drawing view space.
The APIs used are:
Various MathUtility APIs are also used and make dealing with transforms a lot easier.
- Extract the archive in a convenient location.
- Open a drawing with circular edges in SolidWorks.
- Select a circular edge in a view.
- Open the macro file in the Macro Editor.
- Run the macro.
A cross is placed at the center of the circle described by the selected circular edge.
This code is not intended to be used as an alternative to DrawingDoc::InsertCenterMark.
This code illustrates the technique of inserting a cross to confirm that we have correctly done our model to drawing transformation.
|- required for full access.|
- Looking for more API Examples?
Copyright © 2011 Dassault Systèmes SolidWorks Corp. All rights reserved.
Do not distribute or reproduce without the written consent of Dassault Systèmes SolidWorks Corp.