ds-blue-logo
Preview  |  SOLIDWORKS USER FORUM
Use your SOLIDWORKS ID or 3DEXPERIENCE ID to log in.
SCScott Campbell04/06/2021

I'm needing to find the collective center of the bodies in a view. Finding the center of the view won't work. The section view will have lines, circles, or ellipses that are created by the cut line. For curves in the view I do .GetEllipseParams or .CircleParams depending on a .CurveType. From this parameter data I can get the x and y coordinate of the center of the curve. I keep a running sum of the x and y coordinates as I loop through all the entities of the view. I then take an average to find the center x and center y. While debugging I displayed the x and y values of the curves and noticed that they seem to be incorrect. I've attached the part file, drawing file, and macro. Click on the section view and then run the macro. In the section view I drew a line coming from the center of the ellipses and drew a circle at the midpoint. This is the location of where the sketch point should be.