ds-blue-logo
Preview  |  SOLIDWORKS USER FORUM
Use your SOLIDWORKS ID or 3DEXPERIENCE ID to log in.
APAJ P21/04/2025

Hi, 

I'm trying to create a rectangle sketch at a height (Z is variable) and I can't seem to figure out how to do it using the SolidWorks API.

I can get the X and Y coordinates to change. But the rectangles are always created a the Z=0 plane.

My MWE is below:

Option Explicit Sub main() temp End Sub Function temp() ' Get access to document Dim swApp As SldWorks.SldWorks Dim swModel As SldWorks.ModelDoc2