I load a part model (3D cube) through macro and then i do some calculation and select one of the faces. I want to now zoom fit my model so that the selected surface is viewed. Is there a way to do it?
Select the face, run the command normal to and then zoom to fit.
Entity swEntity = swFace as Entity;
2015 SOLIDWORKS API Help - ViewZoomtofit2 Method (IModelDoc2)
This zooms the model but does not turn the model so that selected face is visible
If you made the normal to selection and then the zoom fit command. See example for normal to command.
2015 SOLIDWORKS API Help - Get Normal of Planar Face Example (VBA)
I tried it and set it up the way you suggested but still the same thing. IT does not turns the part around.
"Normal to" view
Thank you that worked
Retrieving data ...