K4 CAD Solutions
CNC Code Utilities Rubik's Cube Development Contact
K4 CAD Solutions - Logo
K4 CAD Solutions - Bespoke AutoCAD® Programming

Example UTILITIES developed in AutoLISP and DCL

FLATTEN  creates a flattened 2D image of 3D lines from any view point
FRAGMENT  breaks all selected lines wherever they intersect each other
WOBBLE  squiggles selected lines to create hand-drawn organic effects

Wobbled Lines Image
Create 'organic' effects by wobbling 2D/3D lines.

Use flatten from different view points to create multiple views from one simple wire-frame drawing. What you see is what you get as a 2D drawing on the X-Y plane, leaving the original entities intact! Use fragment to break flattened lines into segments, and then selectively erase fragments to create solid looking models and cutaways. Useful for 'trimming' multiple lines without the hassle of selecting cutting edges and then entities to trim - just erase the required fragments! Use wobble to randomly squiggle selected lines to user-defined parameters to create effects ranging from fine hand-drawn lines to very wiggly lines. Wobble lines more than once to create sketched effects and add emphasis to presentation drawings.

FLATTEN Command Dialogue Box


After the request 'Select entities to flatten' is satisfied the user is presented with the flatten dialogue box (the use of dialogue boxes for data input and/or selection provides for fast and accurate entry of parameters). Flatten defaults to the current (User) view point, expressed in WCS in the X, Y and Z edit boxes. Additionally, four pre-set view points are also available; Plan [0,0,1], Front [-1,0,0], Left [0,-1,0] and TFL (top-front-left) [-1,-1,1]. After 'OK' is clicked the drawing is regenerated from the specified view point and the user is asked to confirm that the view is correct (the view point can be re-selected and the view redrawn until it is correct). Finally, the user is requested where to insert the flattened image. The original entities are not modified in any way.

Flattened Lines Image
A 3D wire frame object flattened to 2D from various view points

After selecting the required lines to fragment the user is presented with the fragment dialogue box. Line statistics are displayed and a parameter, the 'fuzz exponential' is requested. The calculated default is generally the most appropriate. Intersections (break-points) are to be calculated and sorted for each line to be fragmented. In the example dialogue box a fuzz exponential of -6 represents a distance of 0.000001. This in turn means that any 2 or more break-points on any given line less than this distance apart are considered one intersection. This prevents very small lines being drawn due to spurious geometric calculations. After 'OK' is clicked the lines are fragmented and the user is requested where to insert the fragmented image. The original entities are left intact.

FRAGMENT Command Dialogue Box

Fragmented Lines Image
Solid looking objects created by fragmenting and then selectively erasing segments

WOBBLE Command Dialogue Box


A line is wobbled by redrawing it as a segmented polyline (of segment length) with each vertex being randomly shifted (within 'wobble x/y/z limits' in x/y/z dimensions respectively) and then applying a spline curve fit. Any lines less than 'wobble minimum' in length will not be wobbled. Use small 'wobble x/y/z limits' to create fine hand-drawn lines, large 'wobble x/y/z limits' to create very squiggly lines. Wobble lines more than once to create sketched effects. If 'delete original lines' is not selected, the wobble command can be used again on the same lines. If 'wobble ends' is selected, the end points of each line will be wobbled creating a disjointed effect. Any of the 'wobble x/y/z limits' will default to zero if there is no variation in the x/y/z dimension respectively of the selected lines (e.g. 'wobble z limit' will default to zero if wobbling flat xy lines).

Wobbled Lines Image
Use Wobble to create effects ranging from fine hand-drawn to roughly sketched lines

K4 CAD Solutions is a software development business focusing on programming services for AutoCAD users. Custom commands can be programmed to meet very specific user requirements, ranging from simple utilities to complex 'knowledge' driven applications. Additionally, Windows Applications can be developed to interact with AutoCAD (e.g. launch AutoCAD automatically to generate drawings from external data sources). To discuss your specific requirements or for any other general enquiries contact K4 CAD Solutions via the Contact page.