Sunday, 12 October 2014

Rectangle Centerlines Part 01

A competing CAD program SolidWorks 2015 introduced a handy centerline command for rectangles. Making an equivalent one for Solid Edge would be geometrically challenging but it would be fun too beating the challenge.

This tutorial is part of the Solid Edge Maker Faire and takes you step-by-step through the coding process to build such a program from scratch for Solid Edge. Other tutorials in this series can be read here.

The Rectangle Centerlines command would allow user to pick 4 lines that form a rectangle and draw 2 centerlines either through the Midpoints or Corners as shown below:

01 - Copy02 - Copy

A seemingly simple task, but the devil is in the details.

The UI for this command would look like:

image

1. Option to draw through corners or midpoints.

2. Option to choose color for the centerlines.

3. Options to select a layer to draw the centerlines in the Draft environment as below:

(a) Same layer as the rectangle lines.

(b) On a new layer created on the fly.

(c) On an existing layer by presenting the layers via a listbox.

4. Option to create relationship between the centerlines and the rectangle lines.

5. Option to create centerlines in both the Draft and Part environments though this is not provided through the interface but is done transparently in the background.

This tutorial uses Visual Studio 2010 with .Net 4 and Solid Edge ST 6.

Start with creating a new Windows Form Project in Visual Studio.

01Note: At the end of the last part of this article are the free program executable and the source code for download.

Only the necessary steps to build the program are discussed in detail. For instructions on how to start a new VB.Net project and add Forms, Controls and References, etc. see a previous article on 'Making of Match Properties for Solid Edge'.

As mentioned earlier, the source code and the also the executable are available for download at the end of the last part of this tutorial. You may as well want to keep it open as you follow the instructions that follow.

The following video illustrates the functionality of the Centerlines for Rectangles in Solid Edge:

[www.SurfAndCode.in] Rectangle Centerlines for Solid Edge

Continued to Part 2...

Index of all Solid Edge Tutorials, Tips, Videos...