LinuxCAD v 5.0


Visual Modeling , Diagramming and Computer Aided Design Software for Linux Operating System.














Copyright (C) 1996,1997,1998,1999,2000,2001,2002,2003,2004 Software Forge Inc.
All rights reserved.











LinuxCAD v 5.0

http://www.linuxcad.com


Visual Modeling , Diagramming and Computer Aided Design Software for Linux Operating System.














Copyright (C) 1996,1997,1998,1999,2000,2001,2002,2003,2004 Software Forge Inc.
All rights reserved. No part of this software may be copied, published released under GPL or given in the public domain. Any copying of this software besides for a backup purposes must be accompanied by written permission from Software Forge Inc. You may not upload this software or this manual to computer networks or transmit electronically. You may not rent or lease this software.





LICENSE AGREEMENT AND LIMITED PRODUCT WARRANTY
THE PROGRAMS, INCLUDING CODE, DOCUMENTATION, APPEARANCE, STRUCTURE AND ORGANIZATION, ARE PROPRIETARY PRODUCTS OF Software Forge Inc. AND ARE PROTECTED BY COPYRIGHT AND OTHER LAWS. TITLE TO THESE PROGRAMS, OR ANY COPY, MODIFICATION OR MERGED PORTION OF ANY OF THESE PROGRAMS, SHALL AT ALL TIMES REMAIN WITH THE AFOREMENTIONED COMPANY. LICENSE

    YOU MAY:
  1. Install and use the Programs only on a single computer for your own individual use. The Programs may be transferred to and used on another computer only so long as they are completely removed from the original computer, and shall under no circumstance be used on more than one computer at a time. If you wish to use the Programs on more then one computer at a time, you must purchase additional copies.
  2. Make one copy of the Programs for backup or archival purposes in support of your permitted use of the Programs as described in this Agreement.
  3. Transfer the Programs together with this License to another person, but only if the other person agrees to accept the terms and conditions of this Agreement. If you transfer the Programs and the License, you must at the same time either transfer all copies of the Programs and their Documentation to the same person or destroy those not transferred. Any such transfer terminates your License responsibilities.
  4. Use the Programs to develop your own designs and products as long as: 1) Software Forge Inc. logo or trademarks are not used to market your design or product; 2) Software Forge Inc. is indemnified, held harmless and defended by you from and against any claims, lawsuits or causes of action, in equity or in law, including related legal fees, that may arise from the distribution or use of your design or product.
YOU MAY NOT:
  1. Transfer or rent the program, or use, copy or modify the Programs, in whole or in part, except as expressly permitted in this Agreement.
  2. Decompile, reverse assemble or otherwise reverse engineer the Programs.
  3. Reproduce, distribute or revise the Documentation shipped with the Programs.
  4. Publish online or elsewhere any of your opinions or experiences about this program without prior approval of the materials you want to publish by Software Forge Inc.
If you do any of the foregoing, your rights under this license will    
automatically terminate.  Such termination shall be in addition to and not    
in lieu of any criminal, civil or other remedies available to    
Software Forge Inc. 
   
LIMITED WARRANTY   
Except as specifically stated in this agreement, the Programs are provided    
and licensed "as is" without warranty of any kind, either expressed or    
implied, including, but not limited to, the implied warranties of    
merchantability and fitness for a particular purpose.   
   
Software Forge Inc. warrants that the media on which the Programs are    
furnished will be free from defects in materials and workmanship under normal    
use for a period of 15 days from the date of delivery to you.      
Software Forge Inc. does not warrant that the functions contained in the    
Programs will meet your requirements or that the operation of the    
Programs will be entirely error free or appear precisely as described in the    
Documentation.   
   
LIMITATION OF REMEDIES AND LIABILITY   
To the maximum extent permitted by applicable law, the remedies described    
below are accepted by you as your only remedies, and shall be available to    
you only if you register LinuxCAD with Software Forge Inc. within 15 
days after delivery of the Programs.   
   
Software Forge Inc.'s entire liability and your exclusive remedies shall be:    
if the Programs media are defective, you may return them within 15 days of    
delivery to you along with a copy of your receipt and Software Forge Inc.    
will replace them free of charge. The customer is responsible for shipping 
charges.
   
TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT WILL    
Software Forge Inc. BE LIABLE TO YOU FOR ANY DAMAGES, INCLUDING LOST    
PROFITS, LOST SAVINGS, OR OTHER INCIDENTAL OR CONSEQUENTIAL DAMAGES,    
ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAMS, EVEN IF    
Software Forge Inc. OR A OEM OR DEALER AUTHORIZED BY Software Forge Inc.    
HAD BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.   
   
GENERAL   
If any provision of this Agreement is held to be unenforceable, the    
enforceability of the remaining provisions shall in no way be affected    
or impaired thereby.  This Agreement shall be governed by the laws    
of the state of Illinois.   
   
If you have any problems with the License or have any further questions,   
please contact your supplier:   
   

Software Forge Inc.

Phone    913 663 1724

e-mail   unixguy@aol.com 
web:     www.linuxcad.com
         www.softwareforge.com   
 	  


Table of Contents


Part 1. LinuxCAD Concepts Manual.
Starting LinuxCAD
Files in Distribution
LinuxCAD User Interface
LinuxCAD Print Server
LinuxCAD Pull Down Menus
Customization of the LinuxCAD Dimensioning System
Other Environment Variables of LinuxCAD
LinuxCAD Hot Keys
LinuxCAD Command Line Arguments
List of LinuxCAD Commands
Useful Things to Know
LinuxCAD Linetype Customization Guide
A Word About Format of the Drawings
Notes about ORTHO mode

Part 2. User Reference.
1. Drafting Commands.
2. Displaying and Zooming Commands.
3. Editing Commands - Commands for Modifying Graphics Objects within the Drawing.
3.1 The group of commands for accessing the windowing system clipboard.
3.2 Editing Commands.
4. Obtaining Additional Information about your Drawing, using pull down menu Inquiries.
5. Commands of the Options sub tree.
6. Commands for Printing to DeskJet, LaserJet and HP-GL plotters.
7. Installation and LinuxCAD Extensions.
8. LinuxCAD C-programming interface.
8.1 Introduction in ADSL programming for LinuxCAD.
8.2 ADSL Functions Reference.
8.3 ADSL Sample Programs.
9. LinuxCAD Support for Symbol and Part Libraries.
9.1 Introduction.
9.2 Commands for Managing Blocks and Attributes.
10. Commands for 3D modeling.
11. Command Scripts.
12. LinuxCAD Lisp.
13. LinuxCAD Fonts.
14. LinuxCAD Customization Guide.
15. LinuxCAD Dimensioning Commands.
16. LinuxCAD Rendering.


















Part 1

LINUXCAD CONCEPTS MANUAL



Starting LinuxCAD



  linuxcad   {filename} 
  
  lcad {filename}  
  
  linuxcad - is an executable file linked to static Motif libraries.  
  lcad     - is a script that sets customized preferences for drawing dimensions 
               and other emvironment variables. Then sets the backup trace mode  
               and calls linuxcad afterwards. 
  
  {filename} - is a file to edit, we do not enforce particular filenames or  
               file extensions. LinuxCAD will detect its format automatically  
               by looking at contents. We recommend to use the following  
               file extensions:    
                  .dxs - for LinuxCAD drawings, .scr - for LinuxCAD scripts,  
                  .dxf - for export files to Acad.  
  
        If {filename} does not exist it will be created at the first SAVE command.  
     Whenever you start LinuxCAD with a file name of a new or non-existing file you  
     will see a message  "... is not a regular file! error!".  Disregard this 
     message and proceed with your work. The message just means the file  
     was not found and it will be created.  
  


Files in the distribution


linuxcad - executable.

linuxcad.caf - command aliases configuration data.

linuxcad.lin - linetype configuration data.

airplane.dxs - sample drawings.

bolt12.dxs

bs75.dxs

columbia.dxs

housing.dwg

housing.dxs

inqueries.mnu - loadable menus.

display.mnu

draw.mnu

edit.mnu

setup.mnu

stars.mnu

dim.tbr - loadable toolbars.

draw.tbr

demo - demo shell script.

demo.scr - sample command script.

lcad - startup shell script with dimensioning variables customized to the English system.

lcadm - startup shell script with dimensioning variables customized to the Metric system.

license.txt - copying license.

linuxcad.txt

paintl.scr - this script creates a more versatile set of layers. This is more appropriate for drawing signs, trademark symbols and logos.

readme.txt

userguide.html - this manual.

adsl.mak - sample make file to build ADSL programs in C and C++. Or you may also call them LinuxCAD loadable modules

adsl_cmd.so - sample LinuxCAD loadable module.

adsl_sample1.cpp - source code of the sample LinuxCAD loadable module.

linuxcad_c_exposed.h - Application Development System for LinuxCAD include file.

sample_blib.dxl and sample_blib.slb - sample attachable block library and slide library related to it for the purposes of browsing.

mech_sample.slb - another extensive slide library. You can browse this one by command BROWSESLB. These slides cannot be utilized as part of your designs. They serve only for demonstration. We can create similar symbol libraries for LinuxCAD as a special order.

./ads - Directory contains sample programs that demonstrate how user can write extensions to LinuxCAD.

./fonts - Directory contains LinuxCAD fonts. You can add more fonts to LinuxCAD using TTF2LTF command.

./libs - Directory three contains all LinuxCAD symbol libraries.

./lisp - Directory contains sample programs in embedded LinuxCAD Lisp.

./more_samples - Directory contains sample drawings that were created in LinuxCAD by other users, and distributed here with their permission.

./winprint - Directory contains executable code of LinuxCAD MS-Windows print server.



LinuxCAD User Interface


LinuxCAD User Interface consists of:

  1. Command area below the graphics area where you can enter commands as text,
  2. Pull down menus, which are the primary user interface now (until we come up with something better),
  3. Buttons in the top right corner of LinuxCAD window, there are 3 buttons: "+", "-" and "S" . They are tied to the commands ZOOMPLUS, ZOOMMINUS and the S button allows you to start command script.


Controlling and Giving Commands to LinuxCAD


LinuxCAD accepts all commands through a command line. Entering commands, points and scalars from the command line produces drawing output in the graphics area of the LinuxCAD. You can execute commands either by manually typing them or through pull down menus.

In many of the commands described below you will be asked to enter objects. The LinuxCAD prompt for entering objects looks like this:

Select objects:

You can select objects by choosing individual objects or by selecting a group using the Window frame or the Crossing frame. To switch to the Window frame group selection mode just type "W" ( do not type quotes ).

To switch to the Crossing frame group selection mode type "C" . A specific set of objects is affected by every command. This set is referred to as the selection set and will be highlighted. There are two modes of LinuxCAD operations when you create a selection set. The first mode is ADD mode, when objects are added to the selection set. Another mode is REMOVE when objects are removed from the selection set. For instance, when an object is selected (which we will call B1) for deletion by the ERASE command you may cancel the delete of B1 by switching the selection set from ADD mode to REMOVE mode. Now, once in REMOVE mode B1 can be unhighlighted by picking it with the mouse.

To switch in REMOVE mode enter "R" at the Select object: prompt. To switch back to the ADD mode enter "A" at the Select object: prompt. The initial mode is of course ADD. For your convenience object selection keywords can be accessed from the pull down menu: ***/Select objects You can enter points as coordinate pairs X and Y in two distictly different coordinate systems (x,y) and polar (angle, radius), points in both systems can be entered as absolute or as relative to a previous location.
 
  Example:  X,Y         
  
  A comma must separate x from y. Do not use spaces.   
  
  Sometimes you may want to enter a point as a displacement from the previous  
  
 point. In that situation you enter the "at sign"  ("@") in front of the coordinate pair.  
  
  For instance:  
  
    @10,20  -  says we want a point 10 units above the previous point and 20 units  
  
 to the left from previous point.  
  
    @45<1.125  - says we want a point in the direction of 45 degrees 1.125 inches  
  
away from the previous location.  
  
   X,Y - absolute Decarte point  
   A < R - absolute polar point  
   @X,Y - relative Decarte point  
   @A < R - relative polar point  
  

The 3D capabilities of LinuxCAD is whole another story. It might be particularly challenging for some users enter 3D geometry coherently. Therefore we added such capability as Named 3D point to LinuxCAD 3D system. The 3D system of LinuxCAD will be discussed later in detail. Here we would like to say that if 3D point is defined, it can be entered by name later. Whenever user expect 3D point, you can either enter 3D point by its coordinates separated by commas or you can enter a name of the existing Point 3D object preceded by a dollar sign. For example $P4 enters point P4. LinuxCAD will find the 3D point object in file and substitute it's coordinates right there in the command.

  Example:

Command:L3D
First 3D point (x,y,z):$pa
Entity "PA" not found, discarding input.
Point was expected !
First 3D point (x,y,z):$pb
Found 3D point "PB"(10.000000,10.000000,10.000000).
Second 3D point (x,y,z):$p444
Found 3D point "P444"(4.000000,4.000000,4.000000).

In the above example point PA does not exist in the drawing but points PB and P444 do exist. Note that LinuxCAD will automatically generate names of 3D points such as to exclude duplicate names when selections sets containing 3D points are copies. Many LinuxCAD 3D commands will automatically generate named 3D points when the visibility of 3D points is turned On. Use Options/Settings 3D/Control 3D points to change display mode of 3D points.

You can enable ORTHO mode any time by selecting Ortho/On in the pull down menu.

ORTHO mode will only allow drawing of vertical or horizontal lines. In order to draw skewed lines, disable ORTHO. In addition to ORTHO, LinuxCAD allows you to control drawing with other modes. For example, by setting SNAP mode on, movement of the cross hair is now discrete with a particular fixed step. GRID mode will show you a constant Cartesian grid overlaying your drawings.

It is very convenient to start or end a line at a very specific position in relation to other objects in the drawing. For example, you might want to start another line from the exact middle of another vector or from the intersection point of two objects. This is possible. LinuxCAD provides an object attachment feature.

You can attach to the end point, the intersection point, the middle point and to a perpendicular projection of the previous point to an object.

Any time LinuxCAD expects you to enter point, you may enter an object attachment keyword first and the point second.

All object attachment keywords can be found in the ***/Osnaps and ***/Osnaps 3D pull-down menus. Here they are: NEA, END, PER, INT, TAN, MID, CEN, VER, EDG, POI.

 
        2D object attachments
   NEA   -  Nearest point on a line of an object.
   END   -  End point of a line.
   INT   -  Intersection point of two lines.
   TAN   -  Tangent to arcs,ellipses and circles.
   MID   -  Middle point of line segments.
   CEN   -  To the center of arcs,lines,ellipses.

        Simple 3D object attachments ( require one point click ):
   VER   -  To one of the end points of a 3D object. This mode will attach 
            to the corner of 3D Face, to the endpoint of 3D Line and to any vertex
            of 3D Polyline.
   EDG   -  3D middle point of a rib of 3D wireframe object. Use this attachment when you
            already have an existing segment of another object. This mode will find 
            a middle point of 3D Line, middle point of an edge of 3D Face or middle point
            of a segment of 3D Polyline.
            
   POI   -  Attaches to a "close located" point of 3D Line. This mode is not very precise
            but the resulting point is guaranteed to lay exactly on the 3D Line or rib.

        Complex 3D object attachment modes ( require several point click ):
        
   MID3  - this mode will ask you to enter two new 3D points. Then LinuxCAD will compute 
           the middle point in between of these two and that will be the 3D point
           that command in progress gets.
          Example:
             First 3D point (x,y,z):MID3                         - LinuxCAD 3D command prompt.          
             
             MID3 OSNAP: Start Pnt (x,y,z):VER                   - first point prompt of MID3 mode.
             MID3 OSNAP: Start Pnt (x,y,z):3.232708,11.561254
             Caught 3D point at [7.270650,3.688106,10.000000] .
             
             MID3 OSNAP: End Pnt (x,y,z):VER                     - second point prompt of MID3 mode.
             MID3 OSNAP: End Pnt (x,y,z):3.050029,11.199957
             Caught 3D point at [7.100357,3.295584,10.000000] .
             
             Caught 3D point at [7.185503,3.491845,10.000000] .   - is final 3D point that command gets.

           In the example above the VER simple 3D attachment mode is used inside of MID3 complex
           3D attachment mode. This is optional but commonly used supperposition of attachments.   

   PROD  - this mode will ask user to enter 3 3D points, the points must not be located on the same 
            3D line. LinuxCAD will compute a vector product of the two vectors defined by 
            the 3 points entered. The resulting vector tip will be the point the top level command 
            gets.
          Example:
            Second 3D point (x,y,z):PROD
            VECTOR PRODUCT OSNAP: Start Pnt of Vector1 (x,y,z):VER
            VECTOR PRODUCT OSNAP: Start Pnt of Vector1 (x,y,z):3.236767,11.553135
            Caught 3D point at [7.270650,3.688106,10.000000] .
            VECTOR PRODUCT OSNAP: End Pnt of Vector1 (x,y,z):VER
            VECTOR PRODUCT OSNAP: End Pnt of Vector1 (x,y,z):2.368030,11.382635
            Caught 3D point at [6.390835,3.492592,10.000000] .
            VECTOR PRODUCT OSNAP: Start Pnt of Vector2 (x,y,z):VER
            VECTOR PRODUCT OSNAP: Start Pnt of Vector2 (x,y,z):3.228648,11.545016
            Caught 3D point at [7.270650,3.688106,10.000000] .
            VECTOR PRODUCT OSNAP: End Pnt of Vector2 (x,y,z):VER
            VECTOR PRODUCT OSNAP: End Pnt of Vector2 (x,y,z):2.842994,10.846779
            Caught 3D point at [6.930255,2.903502,10.000000] .
            Computed vector product 3D point : [7.270650 3.688106 10.623754]

Do not get confused if you can not undertsand these descriptions of attachment modes completely at this stage of learning, it will all become self evident when you start actually using LinuxCAD 3D features. Using of 2D features of LinuxCAD requires no knowledge of 3D attachments or any 3D features.

Regarding 3D Polylines, it is very convenient to use 3D Polylines as a skeletons for the construction of your 3D point assembly, use 3D Polylines together with VER 3D object attachment mode for this purpose. This provides for more natural way to enter 3D geometry.

2D attachment modes will not catch 3D Objects and vice versa.

When customizing environment variables it is important to know color numbers.

 
   LinuxCAD standard color numbers are:  
  
 BLACK     0  
 RED       1  
 YELLOW    2  
 GREEN     3  
 CYAN      4  
 BLUE      5  
 MAGENTA   6  
 WHITE     7  
 LIGHTRED  8  
  
  In all commands you can enter either one of the colors above or a 
 color as a combination of RGB values. But in dim variables you must 
 specify one of the standard LinuxCAD colors above.  
  


LinuxCAD Print Server


Is a separate MS-Windows program which can read files written by selecting

"File/Save & Print/Print/Print To LinuxCAD MS-Windows print Server"

in the LinuxCAD pull down menu. LinuxCAD print server can print these files on any MS-Windows system printer.

We have noticed that printer manufacturers with microsoft corporation are very organized folks. They have put a great deal of efforts and dollars into creation of printer drivers for ms-windows. That is why we have decided to take advantage of that and provide you with LinuxCAD print server for ms-Windows.

The menu choice above creates binary plot file. Print server can accept the file either from the disk or on the fly from TCP connection.

Currently you may use LinuxCAD ms-Windows print server only in file printing mode, the TCP/IP connection mode will be added in one of the next releases.

There are two LinuxCAD MS-Windows Print Server executables in this distribution:

lwps32.exe - 32 bit LinuxCAD MS Windows print server for Windows 95 and NT.

lwps16.exe - 16 bit executable for Windows 3.1 and Wabi under Linux.

bwcc.dll - Borland C++ runtime DLL, required for LinuxCAD Print Server.

bwcc32.dll - Borland C++ 32 bit runtime DLL, required for LinuxCAD Print Server.

You may use the "Setup" button in LinuxCAD MS-Windows Print Server dialog to set the line width for the lines with a width of 0 in the drawing.



LinuxCAD Pull Down Menus


Pull Down menu has a tree structure. Most of the branches and leafs of the menu are commands. But some are keywords that make sence only within a context of a commend.

***

Menu *** (far right permanent menu) has three sub-menus, Select objects and Osnaps and Osnaps 3D. These sub-menus contain simple keywords instead of commands that can be run. Keywords for object selection and object attachment that were described earlier Keywords can not be executed in a command area but they are used quite often in a context of other commands.

Whenever you run a command that requires entering a point (and almost every command requires that). You may want to go to Osnaps menu and use object attachment modes available there. Similarly, when you work with a command that requires you to select an object or objects, you may want to use object selection control keywords available in ***/Select objects menu.

Keys

Keys - is a far left menu, you may or may not see it while you are reading this, Keys is a temporary menu. Whenever an active command gives you a list of choices in a command area it will simultaneously create "Keys" menu consisting of all those choices and make it visible. So it is almost never necessary to enter choices in the command area while they always duplicated in keys menu.

Keys menu does not get cleared until some subsequent command will give you some new choice. The presence of the Keys menu on the screen does not always mean the choices given in it are acceptable.

What input is acceptable at the time is shown in the command area prompt.





File Pull Down Menu Structure

 
   File 
 
         Command History     -  bring up the command history window 
         New LinuxCAD        -  start new instance of LinuxCAD on another 
                                or the same file. 
                                 ( If you have started two copies of the LinuxCAD 
                                   on the same file, you are responsible for 
                                   consistency of the changes and mutual updates. 
                                    Use menu command  File/Re Open  for  
                                    synchronization ). 
         New                 -  Detach current file from LinuxCAD 
         Open                -  Open another drawing file. 
         Symbol libraries    -  Select one of the preloaded symbols for reuse
                                in your drawing.
         Symbol libraries 3D   -  Some of the libraries, especially architectural ones
                                are accessible in 3D mode here, these parts when inserted
                                will be placed in 3D model space instead of paper space.

   More commands/Re open       - open the drawing again, therefore abandoning the
                                 changes you have made since last SAVE command.  

   More commands/Copy the Filename - copies the name of the current file to the
                                           clipboard ( might save you an effort to
                                           retype the file name at times ).


         Save & Print 
                    Save                      - regular save command designed 
                                                to use most of the time. Also
                                                accessible by pressing F2. 

                    Export to 

                        DXF (acad10)   - write DXF file consisting of all 
                        DXF (acad13)     entities of the current drawing. 
                        SLD            - save as AutoCAD slide 
 
         Print                     
                    To X11 Bitmap 
                    To X11 Pixmap
                    Write Postscript in colors  - output colored postscript.
                    Write Postscript BW         - output black&white postscript.
                    Change Postscript settings  - set the postscript line width, etc.    

                    Print to DeskJet            - print to attached DeskJet type
                    Print to DeskJet in Colors    printer ( Hewlett-Packard ).

                    Print to Laserjet           - print to attached LaserJet type
                                                  printer ( Hewlett-Packard ). 
                    To LinuxCAD MS-Windows Print Server 

             All printing commands have the following modes:

         Print View                  - will print whatever is now visible 
                                      in the LinuxCAD drawing area. 
 
         Print Window                - will ask you to select a window and 
                                      will print all objects contained within 
   
         Print Extents               - will print all objects in the drawing. 
                                       Normally this command should be executed 
                                      within 3 - 8 seconds. If you
                                      are experiencing longer delays, it is 
                                      because you have distant, small objects 
                                      in your drawing. That forces 
                                      LinuxCAD to do extensive calculations which
                                      cause the delay. We recommend that you run 
                                      command Display/Zoom extents
                                      and make sure your Zoom Extents contain 
                                      nothing more than you want to print
                                      before you chose "Print Extents". 

         Windows Printing
              Print         - command only shows up in Micrsosfty Windows version
                             of LinuxCAD.
                                       
 
         Save as...      - save to a file with different name. 
         Exit 
 
 
 
 
 
                        Edit  Pull Down Menu 
------------------------------------------------------------ 
 
   Edit 
 
         Clipboard 
                    Cut        - select objects and cut them to  
                                 X-clipboard 
                    Copy       - select objects and copy them to 
                                 X-clipboard  
                    Copy Color - copy the current color specification to
                                 the X-clipboard
                    Paste      - paste objects from the X-clipboard 
                                 into current drawing. That is a simple, 
                                 quick way to cut and paste between different 
                                 instances of LinuxCAD 
                    Paste Text  - paste from clipboard but paste as text strings 
                                  only, do not attempt to interpret the 
                                  information on the clipboard like LinuxCAD
                                  drawing.
                    Paste Color - copies the color from clipboard and allows 
                                  the user to select objects that to be converted 
                                  to this color.
                    Paste/Set Color - take color from the X-clipboard and set it
                                  to be the current color. Please open colors.dxs 
                                  sample drawing file that comes with LinuxCAD. 
                                  Now you should understand that in conjunction 
                                  with such color palette file this menu command 
                                  is very useful.
                    Paste Command - the contents of a clipboard will be pasted into
                                  LinuxCAD command line and executed as a command.
                                    This is convenient when you insert blocks by name
                                  from deep directory three hierarchies, you can just 
                                  have a list of your blocks in text file and paste them
                                  when you need them instead of typing.

 
         Edit... 
                    Undo       - allows to go back and restore the previous
                                 state of the drawing. This command does not 
                                 yet allows you to restore deleted objects. 
                                 You may be able in future versions.
                          Set mark 
                          Undo to last mark 
                    Select     - select objects 
                    Break&Divide
                          Break      - break a line, removes part of the line 
                                       or separates line to two lines.
                          Break Lines - breaks all line type objects at their 
                                        intersection points. 
                          Divide      - divides any objects to specific number
                                         of parts.
                          Divide Line - divides a line in two proportional parts


                    Extend     - extend one or more lines until intersection 
                                 with a boundary 
                    Trim       - trim object  
                    Chamfer    - create chamfer in a place where two lines meet 
                    Fillet     - create a fillet in the place where two lines meet 
                    Hatch      - create hatch, hatch will be created as fully 
                                 "exploded" set of lines. 
                        Hatch Patterns - brings up a graphics (iconic) menu of hatch patterns,
                                         after selecting pattern the hatching starts 
                                         automatically using the pattern yiou have selected.


                    Stretch    - moves and stretches objects with preserving their
                                 links with the rest of the drawing.
 
         Edit2...   Change Props - changes generic object properties of a group
                                   of objects ( like Line type color etc. ).
                    Change     - changes specific object attributes, such as radius
                                 starting point, angle and so on.
                    Change Text  - select text and modify contained string 
                                  by using text editor. You can configure the name 
                                 of text editor used here setting LINCAD_EDITOR 
                                 environment variable. If none specified 
                                 the command uses vi and 
                                 xterm together. 
                    Create Block  - creates a block by associating several simple 
                                    objects together.
                    Explode       - breaks a block back to simple objects.
                    Convert to
                         Lines    - converts objects to line segments
                         Traces   - converts object to trace segments
                         Solids   - converts filled objects to Solid filled triangles.
                         Single Block - combines group of objects "in place" in 
                                    a block, the name of the block is generated 
                                    automatically.  
                         Single Polyline - converts a 2D object to polyline.
                         Tesselate 3D objects - breaks 3D objects to elementary
                                      triangular Face 3D type objects, this is
                                      a canonic (sort of) form for many 3D
                                      algorythms to work.


                    Edit Polyline - modifies a polyline type drawing object.
                    Text Magnifier - magnifies text until its readable.
                    Change EXEC    - changes an executable contents of the 
                                     drawing object.
                    EXEC           - executes an executable contents of a
                                     drawing object.

         Edit 3D  
           Move 3D    - move command that moves objects in model space and will
                        affect only 3D objects, 2D objects are invisible for this
                        command.
           Copy 3D    - copying 3D objects in 3D space.
           Offset 3D  - a form of copying of 3D objects with somewhat alternative
                        user interface.
           Scale 3D   - scales 3D objects in 3D model space.  
           Rotate 3D
               Rotate around 0X
               Rotate around 0Y
               Rotate around 0Z
               Rotate Any Axis   - LinuxCAD will ask user to enter two 3D points
                                   that define rotation axis.
               Rotate&Copy Any Axis - this command rotates 3D a copy of 3D objects.
                                     It copies objects first and then rotates the
                                    copy.
          Mirror 3D  - mirroring 3D objects across the "mirror plane".
          Copy&Rotate 3D - this command is misnamed ( for the lack of better name ),
                          it computes "complex spacial transformation" of coordinates 
                          of 3D objects in such a way that three 3D points are "best aligned"
                        to other three 3D points. It is usefull for virtually assembling
                        3D parts together. It supposed to be easy to put one floor of
                         a building on top of another using this command.

          Extrude      - these group of commands extrudes 2D polyline in 3D space therefore
                         creating 3D bodies.
             Extrude        
             Extrude Group
             Conic Extrude
             Move&Scale Extrude

           Revolve - revolves 2D polyline in 3D therefore creating "body of rotation".


 
         Copy        - copy objects within single drawing, option MULTIPLE 
                       allows to you place many copies with a single command. 
         Move        - move drawing objects within one file. 
         Mirror      - mirror objects 
         Rotate      - rotate objects 
         Scale       - scale objects 
         Offset      - offsets one of the offsetable objects. There are some
                       objects that can not be offset, such as SOLIDs. 
         Erase       - delete objects from the drawing 
 
 
 
 
                        Draw  Pull Down Menu 
------------------------------------------------------------ 
 
 
 
  Draw 
 
         Draw... 
                   Dimensions... 
                               Horizontal 
                               Vertical 
                               Aligned 
                               Radius 
                               Diameter 
                               Angular 
                               Leader
                               Leader&Text
                   2D Splines
                               Quadratic Spline
                               Edit Quadratic Spline
                               Bezier 2D Curves
                               B-Spline 2D Curves
                   Rectangle         - creates a rectangle, nonfilled.
                   Filled Rectangle  - creates a rectangle, filled with color.
                   Polygon           - creates any type of proper polygon.
                   Multiline Text
                   Polyline          - creates a polyline object.
                   Polyline Vector   - creates a special type of single segmented
                                       polyline.
                   Polyline Arc      - creates a special type of an ARC object.
                   Array           - creates rectangular or polar 
                                     arrays of objects. Angles for 
                                     polar array have to be 
                                     specified in degrees. 
                   Insert 
                   Attdef
                   Sketch       - free hand drawing(press to toggle pen up/down).
                   Pencil       - free hand drawing(pen is down while you press).
 
         Draw 3D... 
                   3D Line 
                   3D Solid 
                   Sphere 
                   Torus 
                   Cone 
                   Cylinder 
                   Spline surface 
         Line                      - create 2D line 
         Solid                     - create 2D solid triangle 
         Circle                    - create 2D circle 
         Arc                       - create 2D Arc 
         Text                      - create Text 
         Ellipse                   - create 2D ellipse 
         Point                     - create point, LinuxCAD 
                                     draws points as small squares. 
         Trace                     - create 2D trace 
         Doughnut                  - create 2D filled doughnut 
 
 
                        Display  Pull Down Menu 
------------------------------------------------------------ 
 
 
  Display       - commands from this menu change current visible part 
                  of World Coordinate System 
 
         Zoom  
                   3D Zooming... 
                            X 
                            Y 
                            Z 
                            Rotate camera Y 
                            Rotate camera X 
                            Rotate camera Z 
         Zoom Previous    - LinuxCAD remembers 20 previous zooms for 
                            later recall.
     
         Zoom Next        - When you zoomed with Zoom Previous you 
                            can return in opposite direction to the 
                            last view you have set.
                              
         Zoom All         - View all within the drawing limits. 
                            Drawing limits are special variable. 
                            LinuxCAD sets those variables when you 
                            run DWGLIMITS command and stores them in your 
                            drawing when you do SAVE command.

         Enlarge          - Enlarges objects, changes magnification 
                            alone so a smaller sized area of  
                            World Coordinate System  will be visible 
                            without changing overall position of the 
                            Viewport relatively to WCS. 
         Diminish         - Enlarges objects, so a bigger size area 
                            of WCS will be visible without changing overall 
                            position of the Viewport relatively to WCS.
         Zoom to Extents  - Recalculates coordinates of all objects and 
                            changes zoom so all of them become visible. 
         Zoom Window      - Allows you specify visible window as rectangular 
                            part of the  current view 
 
         Pan              - Move visible window without changing magnification 
 
         Redraw           - Refresh the current view 
 
         Inquiries 
                   Point ID?  - display the precise coordinates of the 
                                point you choose .
                   Angle ?    - Displays an orientation angle of your choosing. 
                   Included Acute Angle?
                   Distance ? - Displays the distance between two chosen
                                points.
                   Entity data? - Displays the LinuxCAD's data about selected
                                  object.
                   Insert Data? - Displays the LinuxCAD's data about selected
                                  INSERT type object and prints the entire block
                                  contents associated with it also.
                   All objects? - prints information about all objects in the 
                                  drawing.
                   All blocks?  - prints information about all blocks in the 
                                  drawing.

         Inquiries 3D
                   Distance?             - computer 3D dstance.
                   Point ID?             - reports coordinates of picked 3D point.
                   Angle 3D?
                   Angle with 3D Axes?   - reports andle of a picked vector with
                                        all three 3D coordinate axes.
                   Which 3D viewport?    - prints the 3D viewport number that the
                                        picked object is displayed through.
                   Vector,Scalar prod?   - computes vector and scalar product of
                                        two vectores that you select by picking 4 points.
                   Are they parallel?    - checks if picked 3D faces are parallel or not.
                   3D faces intersect?   - computes intersection of two planes.
         Hide
                   Remove hidden lines   - just what it is, WARNING: TIME CONSUMING.
                                            (up to 3000 3D Faces on Intel i7 takes 8 minutes).
                   End hide              - abandons "HIDE" command results and returns
                                           to wireframe view.
                   Make Hide Permanent   - removes original wireframe objects from the
                                           drawing and inserts flat view instead.
         Render    
                   Render Status         - Produces status report on renderer parameters that
                                           are active.
                   Render Config         - allows to adjust renderer parameters one by one.
                                           (while this may help mosty common mistake when
                                            rendering is not having the light sources in drawing).
                   Show render pallete   - quick test if your display hardware and display mode
                                           are capable enogh for render to work
                   Render Scene          - thise is where it shades the 3D wireframe.




 
         New Window(RO)       - Open another uneditable (read only) window.
                normal
                inverse
 
                  Options Pull Down Menu 
------------------------------------------------------------ 
 
 
   Options 
         Settings 
                    Text Style  - Set the current text style, currently 
                                  supports only SHX.
                    List Loaded SHX  - see what fonts are loaded.
                    Query Font Codes - see which symbols exist in an SHX font.
 
         PickBox Size           -  Change size of the object selection rectangle 
                                   (that little yellow  box when there are 
                                   prompt "Select object:" in the command 
                                   area below ).   
                    other size 
                    2 
                    4 
                    6 
                    8 
                    10 
                    12 
                    14 
                    16 
                    18 
                    20 
        Ortho               enables or disables the mode so you can 
                            not draw any but the orthogonal lines. 
                    On 
                    Off 
        Axis                displays or hides  the coordinate axes. 
                    On 
                    Off 
                    Setup 
        Snap                When set to on makes the movement of the cross hair
                            discrete. 
                    On 
                    Off 
                    Setup  
        Grid                Displays or hides dots of the coordinate grid. 
                            This feature is very convenient. We recommend 
                            that you always set GRID four times larger
                            then SNAP. SNAP does not produce 
                            the performance overhead the grid does. 
                    On 
                    Off 
                    Setup 
 
        Screen Extents   - Changes the size of the scrollable 
                           black area where your graphics objects are. 
                           This parameter does not change  magnification
                           or origin of the view, it just gives more 
                           pixels to LinuxCAD. This allows you to take
                           full advantage of high resolution displays. 
                    Set 640x480         
                    Set 800x600 
                    Set 1024x768 
                    Set 1024x1024 
                    Set 1400x1200 
                    Set 2048x2048 
                    Set 4096x4096 
 
        Drawing Limits   - sets the limits of the current drawing and 
                           draws boundary lines for them. 
                           If you do not need boundary lines you  
                           can remove them later.
                    Setup 
                           Landscape 
                                     ISO 
                                             A4 
                                             A3 
                                             A2 
                                             A1 
                                             A0 
                                     ANSI 
                                             A 
                                             B 
                                             C 
                                             D 
                                             E 
                           Portrait 
                                     ISO 
                                             A4 
                                             A3 
                                             A2 
                                             A1 
                                             A0 
                                     ANSI 
                                             A 
                                             B 
                                             C 
                                             D 
                                             E 
 
        Circumference Number - Changes the value of circumference. 
                      The circumference is a number of segments 
                      LinuxCAD uses to represent analytical functions 
                      (such as a circle or an ellipse). A larger   
                      circumference yields a more precise your drawing.
                       It is obvious the drawing should not be 
                       more precise that you can see or that the 
                       paper can take.  Excessively large circumference
                       values may significantly impact the 
                       performance of LinuxCAD.                               
 
        Change Color 
                Set 
                ByLayer 
                Black 
                Red 
                Yellow 
                Green 
                Cyan 
                Blue 
                Magenta 
                White 
                Lightred 
                Gray 
                RGB             - Select new color visually in a dialog
                          as combination of RGB values from 0 to 255 for
                          each color dimension. 
 
      Change Line Type                - Menu for managing line types. 
                Linetype                 
                List All Line Types  
                Set CONTINUOUS        - Sets plain line without breaks 
                Set HIDDEN            - Sets dashed line, usually used for 
                                        drawing hidden objects 
                Set CENTER            - Sets center line (alternate long 
                                        dash and short dash). 
                Set DOTTED            - Sets line from dots only. 
 
      Change Layers 
                Layer                 - Enter layer command and select 
                                        what to do next (about layers)
                                        in a command line, this command
                                        is an AutoCAD compatible.
                Set Layer             - allows to select current layer
                                        in more intuitive way.
                Set Layer ON
                Set Layer OFF               
                List All Layers 
                Order By Layer        - sorts objects in the drawing in the 
                                     stacking order of their layers.
                All Layers On  - turns all layers on simultaneously, good
                                 for finding hidden objects.
      Named Views 
                Views 
                List All Views 
                Save View 
                Restore View 

      Drawing Settings  
                Insertion Base point 
                Specify Units of the Drawing - tell LinuxCAD about Inches
                                 or millimeters whichever you prefer.
 
      Editor Settings 
                Spool commands to ...  - Activate spooling of the all 
                                         commands you run to specified file. 
                Spool Off              - Exit spooling mode. 
 
                Autosave               - Enable autosave mode. We suggest 
                                         that you keep the Autosave mode on
                                         at all times to prevent loss of 
                                         work. 
                             Every 1 min. 
                             Every 2 min. 
                             Every 3 min. 
                             Every 5 min. 
                             Every 10 min. 
                             Off  
                OS Services
                        lpr linuxcad.ps   - if you have a LaserJet
                                         printer this is the one you will use
                                         often.
                        xterm 
                        xcalc           - other X-window programs that is
                        xclock            good to have an access to.
                Help  
 
 
    * * *  Pull Down Menu   (Object attachments and object 
                             selection keywords)  
------------------------------------------------------------ 
 
 
      * * *  
                Osnaps      - Object attachments menu, can be entered  
                            in every place where the point can be entered. 
                           NEArest 
                           ENDpoint 
                           INTersect 
                           PERpend 
                           TANgent 
                           MIDpoint 
                           CENter 
 
                Select objects  - Object selection keywords menu 
                           Window 
                           Crossing 
                           Add 
                           Remove 
                           Previous 
 
 
                  Keys Pull Down Menu 
------------------------------------------------------------ 
 
 
      Keys       - Transient keyword menu. 
 
          ... 
 


Customization of the LinuxCAD Dimensioning System


You can customize the way LinuxCAD creates dimensions by setting Linux environment variables in the current execution environment, before you start LinuxCAD. The standard way of doing that in Korn and Bourne shell is:

{Variable name} = {variable value} export {Variable name}

For instance:

LINCAD_DIM_DIMLINES_COLOR=3
export LINCAD_DIM_DIMLINES_COLOR

sets color of dimension lines to green. When specifying color in any of the color related environment variables of the LinuxCAD, you may set a color as standard LinuxCAD color number or as a word. The only recognized color names are the first eight colors of the EGA palette. Color name may be specified in upper case, lower case or mixed case.
     Example:


LINCAD_DIM_DIMLINES_COLOR=white
export LINCAD_DIM_DIMLINES_COLOR 
LINCAD_DIM_ARROW_COLOR=WHITE 
export LINCAD_DIM_ARROW_COLOR
linuxcad ATM_API_ObjectModel.dxs -inverse



You can customize dimensioning with the following environment variables:
LINCAD_EXTENSION_LINE_EXCESS
LINCAD_DIM_EXTENSION_LINE_DISTANCE
LINCAD_DIM_DIMTEXT_HEIGHT
LINCAD_DIM_DIMTEXT_COLOR
LINCAD_DIM_ARROW_COLOR
LINCAD_DIM_DIMLINES_COLOR
LINCAD_DIM_DIMARROW_SIZE
LINCAD_DIM_LAYER_NAME
LINCAD_DIM_DIMARROW_RATIO
LINCAD_DIM_DFLTVALS_PRCSN
LINCAD_DIM_DFLTANGLS_PRCSN
LINCAD_ANGLES_IN_RADIANS

LINCAD_ANGLES_IN_RADIANS - Chooses the angular units. If this variable is 0 LinuxCAD reads the angles in degrees. If this variable is 1 LinuxCAD reads angles in radians. That is not what you enter them in, but what they are measured in by LinuxCAD for the default dimension text.

We recognize that these long variable names are hard to type. But their names are self explanatory and they only need to be entered once and saved. You can save them in a special startup script or your shell ~/.profile file.



Other Environment Variables of LinuxCAD


LINCAD_EDITOR - text editor executable name for modifying text (if none specified vi and xterm are used in combination). We recommend to use any X windows based text editor which takes file name as its first argument.

LINCAD_PRINTER - system name of the printing device for the LinuxCAD or special name lpr This device will be used for printing your drawings

Depending from your system configuration you will set there one of the following:

LINCAD_PRINTER =/dev/lp0 if your parallel port address is 0x03bc
LINCAD_PRINTER =/dev/lp1 if your parallel port address is 0x0378
LINCAD_PRINTER =/dev/lp2 if your parallel port address is 0x0278

To figure out your parallel port address enter your computer setup and browse peripheral configuration. Usually BIOS will tell you the number. Do not change that number, but make note of it and set LINCAD_PRINTER variable accordingly. If this variable set to the value lpr ( lowercase ) then UNIX printing command lpr will be used to print your output. This is a usual case when you print to a network printer.

LINCAD_DIR - full path to the directory where LinuxCAD will look for menus and some other files.

LINCAD_LENGTH_UNITS - by default LinuxCAD uses inches as its drawing units. Units are not relevant when you draw but they become relevant when you export or print your drawing. To make Millimeters the default, you have to assign something like Metric or MM to this environment variable, actually any word starting from letter M will do. This environment variable assigns drawing units for new drawings. For existing drawing the units will be read from the file itself. Drawing units can be verified or changed using DWGUNITS command of LinuxCAD.

LINCAD_PS_LINEWIDTH - related to postscript output, specifies width of the thin lines. Thin lines are the ones originated from width less graphics objects as Lines, Circles, Ellipses and Splines. This opposite to objects that define their width in the drawing editor model like: Traces, Polylines, Doughnuts. You have to specify it in the Postscript units. It may be less then 1.0 and does not have to be an integer. Line width specified by this variable can be changed while you work with drawing editor by using PRINTPS/SETTINGS/LINE_WIDTH command.



LinuxCAD Hot Keys


Hot keys are only available when the command area below the drawing area is the current active widget. Widget is the UNIX name for window. To make the command area the current widget set your mouse cursor over it and click left mouse button. You will see the border of the command area becomes a thicker to confirm the activation of the widget.

  
  
      F4 - maximize command area, so you can see command history.  
 
      F2 - save drawing on disk  
 
      F3 - toggle ortho mode. (at present time the ortho mode toggles 
             which were entered through this key do not get written to 
             the script file, that may cause script file to produce incorrect  
             output later, this is a minor problem and it will be corrected 
             in later versions). 
 
      F5 - cancels current command (Enters Nil or imitates right button pressed ), or repeat the last command  
           if you are not in the middle of a command. This however can not abort the
           ERASE command that already has a non empty selection set.  To abort ERASE
           command use Ctrl/C combination of keys. 

      Ctrl/C - abort command immediately and unconditionally.
                                 This is especially convenient way (the only way)
                                 to end the unwanted ERASE command
                                 without deleting the selected objects.

      F6 - toggles snap mode.


      Ctrl/Q - enables object attachment to  NEAREST point.

      Ctrl/A - enables object attachment to  END point.

      Ctrl/Z - enables object attachment by PERPENDICULAR.

      Ctrl/W - enables object attachment to MID point.

      Ctrl/S - enables object attachment to CENTER point.

      Ctrl/X - enables object attachment to  NEAREST point.

      Ctrl/Q - enables object attachment to  INTERSECTION point.

    The key for object attachments have been selected such that it is very easy to reach them
  both Control key and letter key simultaneously by using the fingers of 
  your left hand while you move the mouse with your right hand.


  THE FOLLOWING HOTKEYS ARE FOR MICROSOSFT WINDOWS VERSION OF LINUXCAD ONLY:

      Ctrl/Q - Opens up command history.

      Ctrl/A - Toggles ORTHO.

      Ctrl/S - Saves the drawing.


You will get a button menu in the next release of LinuxCAD. And it will be possible to assign arbitrary length command script to almost every functional key or Ctrl/Alt modified key of the keyboard.



LinuxCAD Command Line Arguments


  
  
   The program recognizes the following arguments:  
  
   -trace    when specified, this enables the output of all your editing  
          operations in the LinuxCAD editing session to the linuxcad.trc 
          file.  WE RECOMMEND TAHT YOU USE EITHER THIS OPTION OR AUTOSAVE 
          MODE. This protects your work in case of a program or computer failure. 
	  This function also allows for:
               1) Full backup of your session in linuxcad.trc, so you can   
               rerun the script and restore your drawing completely, even  
               if you were not working in AUTOSAVE mode  
               2) You may assist us with product developement by e-mailing your drawing,
		as it was before that editing session and this linuxcad.trc file. 
                That information alone is enough to fix any bug.  
               3) Use the following restart procedure after crash:  
                     - open in text editor the linuxcad.trc file and delete   
                       very last few lines,  
                     - restart linuxcad and use SCR button to repeat all your  
                       editing operations.  
                 
   -autosave{number of minutes}  - start LinuxCAD with autosave 
                                   mode enabled. Specify number of minutes between
                                   saves. Type in the number of minutes between saves
                                   without using any spaces.

                          For instance: 
 
             -autosave5   - when specified, this means the program 
                                             will automatically save every five minutes. 
  
  -dwglimits{world min X, world min Y, world max X, world max Y }   
          - used to set initial drawing limits, by default initial drawing limits
              correspond to US letter size. 
 
  -ro 
  -readonly either option will disable the Save commands. The
               purpose of this command is to provide you with an opportunity to edit 
               the drawing in one window while at the same time, you can observe different 
               parts of it in another window. Even two people separated geographically 
               can view the same drawing at the same time because X widow can be displayed
               anywhere from anywhere on the internet.
          

  -screensize { width in pixels, height in pixels }    
          - sets the initial screen drawing area size. You may change 
            the drawing area size later by pull down menu command
                   "Option/Settings/Screen Extents"
       For example, this is how you can start LinuxCAD with custom
   window and drawing area size:

     linuxcad your_dwg.dxs -screensize 1100,900 -geometry 1200x1000+1+1 
 
    The example above will work only if you start it on an existing drawing file.
  When the file does not exist the screen will came up in standard screen size.
    That happens because "File not exist" message box will intercept
  X-events before LinuxCAD is able to get modify the size of the window and 
  drawing area.    


   -aliases {name of the command aliases file}  
 
     Command aliases file helps you customize LinuxCAD environment. You can 
   actually assign the name you like to any LinuxCAD command.
     Every line of the Command Aliases File has the following format: 
 
     {standard linuxcad name of a command}   {new name for a command}  
 
   If you put the character # in the first position of a line in Command
   Aliases File, the whole line will be ignored as if it was remarks. 
   Incorrectly formatted, duplicated, and logically erroneous entries are  
  ignored. 
       We have provided a sample command alias file called linuxcad.caf. 
   It is located in LinuxCAD distribution directory.  Please note that
  for all command line arguments to take effect the drawing file must exist.
  Otherwise the argument parsing will not proceed all the way.  Anotherwords:
             linuxcad test.dxs -aliases linuxcad.caf
   will not work, if the test.dxs does not exist.




-inverse - changes black background of the drawing to white background. White lines will still be visible as they will be displayed in black color instead of white. This has been implemented only to make screen shots look better when sending them to laser color copiers. We recommend you use black background for most other tasks. -script {.scr file name} this allows LinuxCAD to run the commands from the specified script first and then transfer control to the user interface.




List of LinuxCAD Commands


ANGLE - measure an absolute slope of a line.

ALIGN - aligns groups of objects along specified vertical or horizontal line.

ARC - draw an arc.

ARCHIT - bring up a selection tool for the library of architectural symbols of LinuxCAD. If you are using dynamic build of LinuxCAD this command may require a separate lodable extension library ( .so file ).

ARRAY - draw a rectangular or polar array of objects.

ATOMS - prints all variable names and function names known to LinuxCAD Lisp ( our version of AutoLisp ).

ATREDIT - selects and edits a text of an attribute within an inserted block.

ATTACHLIB - attach a specially formatted LinuxCAD block library ( .dxl file ). To insert blocks from library you have to attach it first.

ATTDEF - define an attribute.

AUTOSAVE - enable automatic saving of the current drawing to disk at regular intervals of time ( recommended 3 - 10 minutes ).

AXIS - show and configure coordinate axes [x0,x] and [y0,y] .

BASE - establish a new base point of this drawing. LinuxCAD uses the base point when it inserts the drawing into another drawing.

BEZIER2D - draws or edits 2D Bezier curves. You may draw four, five and six node curves and also four node composite curve.

BITMAP - creates non scalable bitmap object in the drawing. This command can insert in the drawing any bitmap in X-Window .xbm format.

BLOCK - defines a block.

BLOCKLIB - create drawing archive file for block library.

BMTEXT - draws multiple lines of text and boxes them automaticaly when done.

BREAK - make two lines out of one, with possible removal of some middle segment of the line, arc or circle.

BRKINT - breaks a single X-shaped intersection of lines to separate segments.

BRKLINES - breaks all selected lines at X-shaped intersections. This command does not exist in Acad.

BROWSESLB - brings up the slide library browsing Icon menu. Menu is organized in the format 3x3. The name of the slide you select will be printed for your convenience in the command line. .SLB files or so called slide libraries were originally introduced in Acad. LinuxCAD, as a step up from Acad, naturally provides support for them. You can create your own slide library by using LinuxCAD SLIDELIB command. You may also use the utility program appendslb for adding slides one by one to the existing slide library.

BTEXT - draws a single text line and boxes it afterwards.

CHAMFER - make a chamfer at the corner of intersection of two lines.

CHANGE - modifies geometrical characteristics of the object. This command can only be used to modify the idiosyncratic properties of an object, like the center of a circle, text height, vertexes of a solid, etc.

CHGCOL - change current object creation color. This command also has synonym COLOR to make it the same as the similar command in AutoCAD.

CHGSPLINE2D - a command to edit 2D spline object.

CHPROP - change properties of one or more objects. The changeable properties are color, layer, line type.

CIRCLE - draw a circle.

CIRCUM - change the global variable that controls the accuracy of curve approximation.

CMDSPOOLOFF - disable command spool to file. If you started LinuxCAD with trace mode enabled (command line option -trace) this command will disable trace mode as well.

CMDSPOOLON - enable spooling of every command to a spool file. Henceforth every drawing command you run will be written to the spool file and later rerun again.

COLOR - sets the current color.

COMMANDS - print the list of all commands known to LinuxCAD, this is a nice command because this documentation is often behind and does not cover features that have been added the most recently in the newest versions of LinuxCAD.

COMPUTING - bring up a selection tool for the library of computing symbols of LinuxCAD. If you are using dynamic build of LinuxCAD this command may require a separate lodable extension library ( .so file ).

COPY - copy graphics objects.

COPYROTATE - copies a group of objects and rotates the copy.

CRTLAYER - creates layer with the specific number and gives it a name.

DBLIST - prints all objects existing in the drawing to the LinuxCAD text window. Use HISTORY command to see the output.

DDFONTS - allows to create new text style by selecting a particular font typeface from user friendly graphics menu.

DELAY - Insert a specific number of idle seconds in a running command script.

DELETE - erase graphics objects. The ERASE command does the same thing. This is just an alternate name for your convenience.

DIMHOR - create horizontal dimension. When you have to accept default dimension text here, you press the Space key and the press the Enter key. Without pressing the Space first, the program will not continue. This may not seem very convenient and it will be corrected in the future.

DIMVERT - create vertical dimension. Similar use and restrictions as DIMHOR.

DIMRAD - create radius dimension.

DIMDIAM - create diameter dimension.

DIMANG - create angular dimension.

DIMLEAD - create leader with dimension text or without.

DIST - measure a distance between two points.

DIVLINE - divides a line in specified proportion by some object and simulatenously breaks line in two pieces.

DIVIDE - divides any non-filled object to specified number of equidistant segments with a specified divider object or block.

DONUT - create a doughnut.

DRAWFONT - creates in the current drawing a complete font map. In a rectangular table every character defined in the font will be drawn.

DWGBG - creates a background filled area on layer 0. Similar to DWGLIMITS command. You may create a background area for the all ANSI and ISO standard formats in portraight and landscape layouts.

DWGLIMITS - change the limits of the current drawing. There are built-in options for portrait and landscape in all ANSI and ISO standard formats. This command will create 4 bounding lines in the drawing.

DWGUNITS - specify units of the current drawing whether they are inches or millimeters. LinuxCAD does not care what units your drawing is in, microns, intergalactic parsecs or meters, until it needs to produce a hard copy. Printing commands to DeskJet, LaserJet, HP/GL compliant plotter, then LinuxCAD print server will interpret drawing as created in inches. If you work in the metric system, you will want to use this command. If you fail to do this, you may get hundreds of empty pages instead of A4 sized drawing.

DXFIN - import DXF files form AutoCAD.

ELECTRIC - bring up a selection tool for the library of electrical symbols of LinuxCAD. If you are using dynamic build of LinuxCAD this command may require a separate lodable extension library ( .so file ).

ELLIPSE - create an ellipse.

ERASE - erase one or more graphics objects.

ERASEID - erase one graphics object. You may have to use this command if you accidently created an object that does not have a graphics representation. For exapmle and Insert with negative scale factor.

EXIT - exit LinuxCAD

EXPLODE - disassemble a Block to its components. In LinuxCAD this command can also break polyline to an individual segments. It can also break test string to an individual characters.

EXPORTDXF10 - export all objects of the current drawing in Acad interchange file DXF. The DXF file written by this command can be read by all versions of AutoCAD including those later than v.10.

EXPORTDXF13 - at present time the command does exactly the same thing as the one above.

EXTEND - extend line or multiple lines until intersection with one of the boundary objects.

FILENAME_XCLPCOPY - copies the file name of the current drawing file to X-clipboard.

FILLET - rounds a corner where two lines join.

FILLRECT - creates a rectangle filled with current drawing color.

GRID - enable or configure coordinate grid.

HATCH - hatch a contour.

HELP - display contact information for LinuxCAD.

HISTORY - brings up the command history window. The command history window keeps last 2000 lines and responses you have entered and received in the command area.

HOST - submits a string to Linux shell for execution.

ID - print coordinates of a point.

INBLOCK - combines objects in a block so they can be selected as a single entity later. The name of the block is chosen automatically.

INCLANGA - measures the acute angle included between vertex and two points on bounding rays.

INSERT - insert a block in the drawing.

INSERT3D - insert a 3D block in the drawing. 3D blocks consist of 3D objects. and placed in 3D modelspace when inserted.

LAYER - creates and deletes layers. It can be used also to control the visibility and editability of objects on a layer by setting the layer on or off.

LIBS - invokes a LinuxCAD symbol libraries access tool. In some dynamic builds of LinuxCAD this command may require a loadable module.

LINE - create a line.

LINETYPE - set current line type. There are 7 standard line types. They are CONTINUOUS, HIDDEN, CENTER, DOTTED and their metric equivalents MHIDDEN, MCENTER, MDOTTED. We recommend you use regular line types if you work in an inch system and metric types when you work in metric dimensions. When exporting to DXF for the metric line types to be converted, you have to created line types of MHIDDEN, MCENTER, MDOTTED in Acad.

LISP - load and execute a LinuxCAD Lisp program from specified .lsp file.

LIST - display parameters of a graphics object in the command history window.

LISTDEEP - display parameters of a graphics object in the command history window. This command has the advantage of listing the entire contents of the block when user selects an Insert object, something that the above LIST command can not do.

LINK - create a link between two INSERTs that have their part names defined.

LOADADSL - load an external program on C/C++ into LinuxCAD. This command will work properly only in dynamic build of LinuxCAD that is compatible to your Linux version.

LTYPEIMPORT - imports ACAD.LIN file into LinuxCAD.

MAPS - bring up a selection tool for the library of geographical and mapping symbols of LinuxCAD. If you are using dynamic build of LinuxCAD this command may require a separate lodable extension library ( .so file ).

MIRROR - mirror one or more objects.

MOVE - move one or more objects.

MSLIDE - create Acad slide. For the file to be viewed properly in Acad it has to have World coordinate system drawing extents the same or about the same as the resolution of the target monitor. For example, on a 640x480 monitor you have to fit you slide to be saved in 0.0,0.0 - 640.0,480.0 window in the world coordinate system.

MTEXT - allows to create multiple lines of text in a single command.

NEW - clear the current drawing are and start a new work. The old data will be in the current drawing file until you do your next save command (or until AUTOSAVE will do it for you).

NEWCAD - select a file and start another copy of LinuxCAD on it.

OFFSET - offset an object one or multiple times. This command does somewhat different processing for different graphics objects. It moves lines, for objects with a center (circles, arcs, ellipses, doughnuts) it changes their radius or axes lengths proportionally. This command does not process Solids.

OPEN - open another file in the current editing session.

ORDLAYER - order objects by their layer number. Therefore making some objects on top of others in stacking order, depending from the numbers of their layers.

ORTHO - enable or disable ortho mode. Enabling or disabling Ortho can also be done while another command is running by pressing F3 in the command area.

OVERLAY - sets the scanned bitmap image at the background of the current drawing. This command requires an image in LinuxCAD bitmap format .pix. PIX files can be created by tif2pix program from uncompressed TIFF files. Images from the optical scanners usually arrive in TIFF format. tif2pix is included with LinuxCAD package.

PAINT - Free hand painting. This command similar to SKETCH. The difference is that this command creates filled areas composing them from little triangles.

PAN - move the visible window in world coordinate system. Many users enter points here in the wrong order. If you do so and the screen moves in the direction to where you wanted it to move, simply rerun the PAN using opposite points twice.

PARTNAME - assigns a name to an INSERT object. You can join the named INSERT object with a links using a LINK command.

PASTE - this command pastes previous or deleted objects (which are not the same) to the drawing. If the previous objects do not exists, but deleted objects do, it will paste the deleted objects only. This command may change in the future. We do not recommend you use it currently. Use XCLPCOPY, XCLPCUT, XCLPPASTE commands instead.

PEDIT - edit the AutoCAD style polyline.

PICKBOX - change the current size of the object pick box.

PLINE - draw the AutoCAD style polyline.

PLINEVEC - draw the LinuxCAD style polyline line segment. Polylines of this type are individual segments. They can have only two vertexes but they do have line type, start and end width.

PLINEARC - draw the LinuxCAD style polyline arc segment. Polylines of this type are individual segments that can have only two vertexes. However, they do have line type and a start and end width (linetype is currently stored but not rendered for the created graphics object).

PLOT - produces the HP-GL printed output from LinuxCAD, the output is written to linuxcad.plt file.

POINT - create a point. LinuxCAD displays points as small squares. In reality, they are created as points in a mathematical model. They do not occupy any space. As Euclid says, "A point is that which has no part". You can attach to a point by such object snaps as MIDpoint, ENDpoint, NEArest, CENter.

POLYGON - draws a right polygon of any number of sides.

PREVTOMARK - copies all objects created after the last Undo Mark was set to the Previous selection set.

PRINTDJ - print to Hewlett-Packard DeskJet compatible printer in black and white. Requires a printer attached to a local port.

PRINTDJCOL - print to Hewlett-Packard DeskJet compatible printer in colors. Requires a printer attached to a local port.

PRINTLJ - print to Hewlett-Packard LaserJet compatible printer. Requires a printer attached to a local port. If your LaserJet is accessible on network only you can use PRINTPS command instead. And then just do lpr linuxcad.ps.

PRINTPS - print to postscript device, the command actually writes a file ( linuxcad.ps in the current directory ). Later you can print this file on a true Postscript device.

PRINTSRV - produce a print file for LinuxCAD MS windows based print server. Command will give you three choices, whether you want to print current View, specified Window or all drawing ( Extents choice ). Before you can use this command, you have to specify current drawing units by DWGUNITS command.

PRINTXBM - print to X11 bitmap ( .xbm file ). Bitmaps are black and white pictures used for icons in X-window system.

PRINTXPM - print to X11 pixmap ( .xpm file ).

PURGE - removes unused objects from the drawing. Unlike AutoCAD, you can run PURGE any time and not only when the drawing editor just started. You may remove unused blocks, linetypes, layers and text style references.

QUERYFONT - prints the list of all charcters defined in specified SHX font.

RECTANGLE - draws four line rectangle, using current color and line type.

REDRAW - refresh the current view. This command will erase any point markers which are left on the screen by previous commands. Another way to accomplish redraw is to pull a scrollbar of the graphics area.

REM - the command does nothing and may be used to insert a remark in LinuxCAD command script.

REOPEN - abandones all changes in the drawing and reverts to the last saved version of the drawing.

ROTATE - rotate one of more objects.

SAVE - save drawing

SAVEAS - save drawing with different file name

SAVE_AS_DXS - save drawing to different file. That other file becomes the current drawing from now on.

SAVE_DWG10 - save drawing in the DWG Release 10 format.

SAVE_DWG13 - save drawing in the DWG Release 13 format.

SCALE - scale one or more objects.

SCREENEXT - set the size of the scrollable graphics area.

SELECT - select one or more objects.

SETLAYER - set the current layer by selecting from the pull down menu. All new object that LinuxCAD commands create are created on the current layer. That is why this is important.

SETLAYEROFF - sets a layer invisible, be careful not to make invisible current layer. Command asks user for layer name.

SETLAYERON - makes layer visible. Command asks user for layer name.

SETUNDOMARK - set mark in time, every object created past that mark will be considered a "Past undo mark object". All "Past undo mark" objects can be removed from the drawing all at once by UNDOTOLASTMARK.

SKETCH - free hand drafting or sketching. An arbitrary sketch can be ceated using this command. This command creates curves of any irregular shape as supperposition of very short line segments.

SLIDELIB - this command will create a slide library or .slb file. Slide libraries were used by CAD application developers for long time. The command will ask to enter .slb file name and names of all slides which go into the library. You must enter all file names without their extensions. LinuxCAD assumes .slb extension for slide library file and .sld extension for individual slide member files.

SNAP - set snap on, off or set horizontal and vertical snap length. The horizontal and the vertical Snap length can be set equal to grid length. We recommend you avoid very small settings for the grid relative to visible world coordinate system area. When there are too many grid points on the screen, it impacts the redraw performance.

SOLID - create a filled triangle. We are trying to implement a command to draw spine bounded filled areas. Let us know if you think this is a good idea and would use this command.

SPLINE2D - creates second degree 2D spline curve.

STRETCH - move a group of objects and preserve their connections to the drawing outside of the group in the same time.

STYLE - Load Acad SHX font file, SHX fonts are fully supported for ACAD versions 10,11,12,13. Let us know if you have a requirements to use SHX fonts from the versions of Acad past 13.

TOLINES - breaks drawing objects to separate lines (if it can be done for the kind of object you have selected). Use this command for text,arcs,circles ellipses and the like.

TOOLMENU - command loads a user programmable menu in a new child window. The child window created resides outside the main LinuxCAD window and more importantly, off the drawing area. That avoids useless redraw events which otherwise may be required if you used the pull-down menu. You can load one menu file, all menu files in LINCAD_DIR or you can recreate standard tool menus by using keyword RECREATE. After you have recreated menus, do not forget to load them with LOADALL command, otherwise they will not be visible. Also take into consideration that menus save their position on the screen when you press exit button inside menu. Understanding this fact is important for successful customization of LinuxCAD menu environment. We recommend that you set LINCAD_DIR variable to some path and load menus from there, so they will not mix with your drawings.

TOSOLIDS - breaks drawing objects to separate filled triangles (if it can be done for the kind of object you have selected). Use this command for wide polylines, doughnuts and the like.

TRACE - draw a non-zero length line segment. At present time you can create only traces with CONTINUOUS line type. Let us know if you need line types on traces.

TRIM - trim one or more lines. Bounding area can be combined from objects of any type but only lines can be trimmed. Trim boundary can consist of any types of objects, including filled objects (like Solids, Traces and Doughnuts). Please keep in mind that when you use filled objects as a boundary, you almost always get unexpected results, because the line will cross the filled object boundary twice.

TEXT - create text object. Text objects can have only one line of text. Multi-line texts require many drawing objects.

TXTBOX - draws an enclosing frame ( or rectangular box ) around the text object.

TXTCHG - edit text in the drawing using preconfigured text editor.

TXTCHGEXEC - edit executable contents of a drawing object using preconfigured text editor. In LinuxCAD an OS command string can be attached to any drawing object.

TXTEXEC - execute executable contents of a drawing object.

TXTMAGNIFIER - temporary change the height of the text object so it is readable.

UCS - set the User Coordinate System. This will affect Ortho, Snap and Grid modes as well as interpretation of the coordinates you enter from the command line. Currently UCS implemented only for 2D case.

UNDOTOLASTMARK - remove from the drawing all objects created after you have issued SETUNDOMARK command. One such removal turns Undo Mark off and you have to use SETUNDOMARK command again if you want to keep it.

VIEW - set the current view to one of the stored in the drawing views or create new stored view.

VSLIDE - view slide in the main editing window. Drawing will be temporary replaced by slide image, first subsequent redraw event will discard slide and revert back to the drawing. You can end the slide viewing by entering REDRAW command at any time. LinuxCAD uses Acad r10. slide format for its own slides.

WBLOCK - write a Block to external OS file.

WINRO - starts another instance of LinuxCAD on the current file , but in Read Only mode.

WTEXT - create wide character text object. Wide character text objects have 16 bit (or two bytes) per every character position so they can be used with national alphabets and respective SHX fonts (including Kanji).

XCLPCOPY - copy one or more graphics objects to X Windows clipboard. Object from the clipboard can be pasted in another LinuxCAD session running on the same X display server. This makes it possible to access your graphics objects from another computer as long as you have an X-protocol connection established and the copy of LinuxCAD at the remote location. Objects on the X Windows clipboard stay there until overwritten by another Cut/Copy command or other than LinuxCAD application.

XCLPCUT - cut one or more graphics objects to X Windows clipboard.

XCLPPASTE - paste the LinuxCAD drawing from the X Windows clipboard in the current drawing. Only LinuxCAD drawings can be pasted in such a way. Another important feature might be to paste a plain text. When plain text is pasted, you can create an array of text objects in the drawing. Plain text paste is not implemented now. Again let us know, we will consider it for future development.

XCLP_PASTETEXT - paste text from X-window system clipboard to the LinuxCAD drawing.

XMESSAGE - prints message in a pop-up dialog box. It prompts with ">" at a command line and you type message which up on carriage return will appear in a dialog box. This command is for use in demo scripts only. And is not relevant to the drafter.

ZOOM - AutoCAD alike 2D zoom command.

ZOOMALL - change current view to the limits of the drawing.

ZOOMEXT - change current view in such a way that every and all object in the drawing become visible. Be aware if that a single run away point at some distant location may distort the view in a way your main drawing will appear too small.

ZOOMTEXT - Will search an entire drawing for the occurence of a specified text, and when done will zoom in a way that the text found will be visible. Searches the string within a drawing and changes the current zoom that strings become visible as they found. Allows to step through multiple occurences of the strings that have been found.

ZOOMMINUS - view bigger area of the world so your objects will look smaller.

ZOOMNEXT - move forward to the next view, will do any good only if there one or more ZOOMPREV commands were executed beforehand.

ZOOMPLUS - view smaller area of the world so your objects will look larger.

ZOOMPREV - switch back to the previous view.

ZOOMW - select the visible area by window.







Useful Things to Know


Left Mouse Button generally used in LinuxCAD for entering points, picking ( selecting ) objects, selecting menu items in pull down menu. Speaking simply its meaning is "Yes", just the word "Yes", a positive desire to enter information and act.

Right Mouse Button has meaning similar to word "No" in most cases. Right Mouse Button submits negative reply, desire to end information entry process or abandon the command execution immediately.

Sometimes you have to press Right Mouse Button a few times before command actually aborts.

"Command:" prompt in the command area you can use right mouse button to invoke(rerun) last command.

In many places where you have to enter some sort of text string pressing right mouse button will actually submit empty string to LinuxCAD. Commands react to this differently. Some accept default and some refuse to proceed.

Sometimes it may appear that you are unable to pick a filled object when you select objects, you click and solid or traces remain not highlighted.

The solution for this problem is to pick the object from the edge. When you pick a filled object such as Solid or Arc, pick it from the edge or corner !!!

In many LinuxCAD commands you have to press right mouse key to end the command or to give a default value. In some places you may see a message appears "Command aborted!" when you press right mouse button.

It does not mean that something is wrong with your input to the program or with LinuxCAD itself. The "Comand aborted!" message simply means that the previus command is terminated, completed or cancelled upon user request.







LinuxCAD Linetype Customization Guide


You can create custom user defined line types for LinuxCAD. Let us look at LinuxCAD line type definition file on a sample. This is a simple excerpt from one properly formatted LinuxCAD Linetype Definition file ( recommended extension : .lin ).

SMPDOTTED 14 1.0,0.02,0.125,0.02,0.125,0.02,0.125,0.02,0.125,0.02,0.125,0.02,0.125,0.02
SMPMHIDDEN 14 25.4,0.125,0.0625,0.125,0.0625,0.125,0.0625,0.125,0.0625,0.125,0.0625,0.125,0.0625,0.125

Column one is a line type name. A line type definition follows a line type name.

Definition consists of 3 parts:
  1. Total number of floating point values in definition.
  2. Base length, which is the length of entire single segment of a line type pattern on physical paper.
  3. An array of dashes, every even dash is a pen down interval and every odd dash is a pen up interval.

In our example above: 14 - is total number of floating point values, including total length and dashes. Total length of the pattern for line type SMPDOTTED is one inch. For line type SMPMHIDDEN, the length is also one inch, but this time it has been expressed in millimeters. Because SMPMHIDDEN line type is for use in metric drawings.

File linuxcad.lin in distribution is an example of line type definition file. It has the definitions for the standard LinuxCAD line types. You can use the data in that file as a basis for your customization.

Line types with names duplicate to the names of line types from the current drawing will not be loaded. You can see what type has been loaded and what type has not been loaded from the LINETYPE/LOAD command messages.

When LinuxCAD writes dxf for importing to Acad it writes entities only. We export no tables. We can not do it any other way because we would have to export the default values for most of the other parameters which we just do not have in LinuxCAD drawings.

There is a small problem, when you import dxf in Acad, Acad is going to complain if it does not have some of LinuxCAD layers and Line types defined in the current drawing, this problem can be solved by user. To overcome that use the same line type and layer names in LinuxCAD and Acad.





Additional Unique Features of LinuxCAD


We target LinuxCAD for more than Computer Aided Design applications. Other areas where LinuxCAD can be used are visual analysis and modeling of systems with complex structure, such as real time equipment or computer networks. Therefore we will and we do add some features not usually found in CAD software.

One of those features is an executable seed of a text entity. Besides its textual value text in LinuxCAD may have an executable contents which is simply a command line that can be executed by user with EXEC command. EXEC command asks user to select the text entity and then this command will be executed. You can easily understand how such a feature allows navigation of hierarchically organized information.





A Word About Format of the Drawings


 
  Currently LinuxCAD uses ASCII format for storing the drawings. That has as 
an up-side as well as a down-side. 
   On the up-side we have: 
       - you can see what is in drawing database and you can create  
your own processing programs and use LinuxCAD for visualization only. 
       - you can send drawings by e-mail without mime conversion.
       - you can archive drawings and they take less disk space then. 
 
   On the down-side: 
       - ASCII drawings cannot be loaded as fast as binary drawings 
         would. 
 
  The difference in speed is very insignificant, besides LinuxCAD only 
  reads from the disk once, when it starts. 
 
    Therefore we can conclude the ASCII format, although is not very 
traditional, is a completely feasible way of storing the drawings. 
 
     We will provide full binary format in one of the upcoming versions 
of LinuxCAD. 
 


Notes about ORTHO mode.


ORTHO mode allows you to draw lines , traces and polylines only in two orthogonal directions that coincide with X and Y directions of the current active UCS. Normally you should use ortho only when you draw. When you edit and select objects you should turn the Ortho off, because Ortho modifies the points that come from mouse clicks and this may create difficulty in selecting object. The problem appears as the following: when you try to select objects by pick , it may not pick the object even if the pickbox was right on it. Solution: turn the ortho off (F3 key) then select object and then enable ortho again by pressing F3 key one more time.







Part 2

USER REFERENCE








1. Drafting commands.

LINE

This is the first command a new user will probably try in LinuxCAD. Creates a line in the drawing, using current layer color and line type. Enter points using left mouse button or command line. To exit command instead of drawing the next vector, press right mouse button or enter Nil in a command line. Please disregard the "Command aborted!!!" message that may appear when you exit the line command.

  
Example: 
 
 Command:LINE 
 
From point:492.101381,305.282219 
 
To point:629.668320,238.717571 
 
To point:483.226095,156.177408 
 
To point:Nil 

SOLID

The SOLID command draws solid, filled triangles. These polygons are special LinuxCAD drawing objects called Solids. LinuxCAD Solids can have only three vertexes, but any shape can be formed as their superposition. That can be done using LinuxCAD programming extensions.

Example: 
 
Command:SOLID 
 
Enter point:559.553557,317.707620 
 
Enter point:660.731822,259.130730 
 
Enter point:548.015685,232.504871 



CIRCLE

The CIRCLE command creates a circle in the drawing. You can activate the CIRCLE command by selecting it from the Draw menu.

LinuxCAD uses most of the possible ways to create Circles.

    Circle creation modes are:
  1. by two points on the diameter,
  2. by center point and radius,
  3. by center point and diameter,
  4. by three point on the circle's circumference.

One of the simplest, to enter center point and point on the radius.

 
Example: 
  
Command:CIRCLE 
 
Enter {{Center point:}/3P/2P/TTR/}:485.888680,253.805558 
 
Enter {{Radius:}/DIAMETER/}:516.064654,202.328897 
 

If you enter the DIAMETER keyword at the second prompt LinuxCAD will take your second point as point on the diameter instead of the radius. You do not need to type in the word DIAMETER, just select DIAMETER keyword from the "Keys" pull-down menu.

Example: 
 
Command:CIRCLE 
 
Enter {{Center point:}/3P/2P/TTR/}:10.990834,0.783750 
 
Enter {{Radius:}/DIAMETER/}:12.787500,-0.339167 
 
Command:CIRCLE 
 
Enter {{Center point:}/3P/2P/TTR/}:11.119167,8.868750 
 
Enter {{Radius:}/DIAMETER/}:DIAMETER 
 
Enter point:13.300834,5.532083 

LinuxCAD's user interface is very intuitive. The best way to learn is by drawing and trying various menu commands and options.

To draw circle by three points, use 3P keyword instead of entering point when responding to "Enter {{Center point:}/3P/2P/TTR/}:" prompt. Again you may select keyword from the "Keys" menu or type the first unique letters of the keyword in the command line.

Example: 
 
Command:CIRCLE 
 
Enter {{Center point:}/3P/2P/TTR/}:3P 
 
First point:639.431135,306.169748 
 
Second point:666.944522,323.920320 
 
Third point:651.856536,311.494919 

Option 2P is for creation of a circle by two end points of the diameter.

Example: 
 
Command:CIRCLE 
 
Enter {{Center point:}/3P/2P/TTR/}:2P 
 
Enter point:446.837420,256.468144 
 
Enter point:579.966716,157.064936 


ARC

Use the LinuxCAD ARC command to create circular (non-elliptical) arcs. To create elliptical arcs you may use the ELLIPSE command with Start and End angles option. Arc is one of the supported LinuxCAD drawing object types.

To create an Arc using 3 points, you will enter the chosen point on every one of the three ARC command prompts.

Example: 
 
Command:ARC 
 
Enter  {{Start point:}/CENTER/}:495.651495,241.380157 
 
Enter  {{Second point:}/CENTER/END_POINT/}:708.658368,292.856818 
 
End point:616.355390,203.216426 

If you need to draw arc using the center point, there are two methods. You may enter the start angle and the end angle or you may enter the center point coordinates and the direction and length of a chord. To begin either method choose the keyword CENTER and follow the commands from there.

Don't forget that any keyword may be entered using only the first few letters. If you do not enter enough letters to distinguish a keyword, LinuxCAD will give you a narrowed list of keywords, all beggining with the prefix you have entered. You may then select the keyword from that list.



TEXT

Creates a text object. Text objects in LinuxCAD can not have more than one line. This restriction is true for most CAD systems and should not be viewed as a limitation. If you need multi-line text you have to create multiple text objects. There is a special LinuxCAD command for creation of multi-line text objects. The command is MTEXT. You can also insert multiple text lines in the drawing by using "Paste" command from Edit/Clipboard pull down menu. The TEXT command lets you place text in the drawing, one line at a time, and adds the text when the command is completed.

Example: 
 
Command:TEXT 
 
Enter {Start point:/ALIGN/FIT/CENTER/MIDDLE/RIGHT/JUSTIFY/}:-2422.175126,973.810142 
 
Height  {4.000000} or point to accept:3 
 
Rotation angle  {0.000000} or point to accept:0 
 
Text:Have a nice day! 

Normally LinuxCAD creates text left-justified, but you also have other text placement options:

To select a different text justification, enter your keyword of choice instead of the point at the "Enter {Start point..." prompt.

ALIGN - lets you align a text string above the direction line, which you will enter as two points. If you enter two points, LinuxCAD draws the text so that its baseline starts and ends at the two selected points and fits exactly between them. The distance between two points determines only the text angle not the text height.

  
          Example: 
                     Command:TEXT 
                      
                     Enter {Start point:/ALIGN/FIT/CENTER/MIDDLE/RIGHT/JUSTIFY/}:ALIGN 
                      
                     First text line point:3.226667,1.232917 
                      
                     Second text line point:14.423750,5.981250 
                      
                     Height  {0.000000} or point to accept:3 
                      
                     Text:ALIGNED TEXT 

FIT - aligns text between two points and also changes width between letters so the letters become evenly distributed between the specified two points.

CENTER - creates text string as centered horizontally on either side of a specified point.

MIDDLE - creates string centered horizontally and vertically about the specified point.

RIGHT - interpret the start point of the text string as right alignment point.

JUSTIFY - exists only for compatibility with AutoCAD, adds no value.

Please note: You have to specify rotation angle of a text in degrees and not in radians.



TXTBOX

The command creates a rectangular frame or a box around the text object. You may find yourself using this command often when creating flowcharts, entiry relationship diagramms, organizational charts, databases, object models, and other similar diagramms.

The command allows you to either select a text object that will be surrounded with a frame immediately or you may eneter a INDENT_DISTANCE keyword. The later will give you the opportunity to specify the distance of the frame from the text for this command.


   In this example first TXTBOX command sets a distane and second draws a frame:


TXTBOX , the command puts text into a frame ( indent dist = 0.059055 ) or :
   (Select text object/INDENT_DISTANCE/):INDENT_DISTANCE

Enter distance from the text to box frame<0.059055>:0.7

INDENT_DISTANCE  from the text to box frame is 0.700000 now.
Command:Nil

TXTBOX , the command puts text into a frame ( indent dist = 0.700000 ) or :
  (Select text object/INDENT_DISTANCE/):3.827083,8.479167

Found 1 object!
Command:Nil




ELLIPSE

The ELLIPSE command creates an ellipse. Ellipse is one of the supported object types of LinuxCAD. The LinuxCAD ellipse command provides several methods for drawing ellipses. In LinuxCAD, ellipse object is not polyline but a completely independent entity. You can activate ELLIPSE command by selecting it from Draw menu.

LinuxCAD provides you all the necessary Ellipse creation modes, like:
  1. By one axis and other axis distance, or ellipse eccentricity.
  2. By ellipse center, axis end point and other axis distance.
  3. By ellipse center, axis end point and rotation of the circle.

Example of an ellipse creation by one axis and other axis distance ( or length: )

 
Command:ELLIPSE 
 
Enter  {{Axis endpoint 1}:/ARC/CENTER/}:-2425.819132,996.460604 
 
Axis endpoint 2:-2376.612593,1000.219437 
 
Enter  {{Other axis distance}:/ROTATION/}:-2409.075240,1004.832550 
 

You may sometimes want to enter absolute angles and distances as scalar values, instead of points. If you need to do so, enter the angle as a relative point in polar coordinates and distance as a relative point in cartesian coordinates.

  Example: 
 
      @1<<30  if you need to enter 30 degrees absolute orientation angle. 
 
      @1.25,0  if you need to enter length of 1.25 drawing units.  

Select ARC keyword if you would like to create an elliptic arc:

Command:ELLIPSE 
 
Enter  {{Axis endpoint 1}:/ARC/CENTER/}:ARC 
 
Enter  {{Axis endpoint 1}:/CENTER/}:-2301.674040,1076.538998 
 
Axis endpoint 2:-2193.243276,1144.537952 
 
Enter  {{Other axis distance}:/ROTATION/}:-2233.675086,1137.186714 
 
Start angle:-2138.108989,1132.592190 
 
End angle:-2229.999467,1191.402096 

Yet another way to create an ellipse:

Command:ELLIPSE 
 
Enter  {{Axis endpoint 1}:/ARC/CENTER/}:CENTER 
 
Center point:-2524.048998,965.351519 
 
Axis endpoint:-2297.998421,1090.322570 
 
Enter  {{Other axis distance}:/ROTATION/}:-2555.291761,997.513187 

In the example above, you would enter the center point first and then the axis endpoint and then either the other axis distance or circle rotation angle.

Example of an ellipse creation as center, axis endpoint and rotation of a the circle:

Command:ELLIPSE 
 
Enter  {{Axis endpoint 1}:/ARC/CENTER/}:CENTER 
 
Center point:1.494167,4.184583 
 
Axis endpoint:11.119167,0.559167 
 
Enter  {{Other axis distance}:/ROTATION/}:ROTATION 
 
Rotation:1.109167,4.505417 


POINT

The simplest command yet! Just enter the point's coordinates and it will be created in the drawing. Remember, points are displayed as small squares, but in reality they do not occupy any space.

Example: 
 
Command:POINT 
 
Enter point:-2559.886285,1052.647474 
 


TRACE

The TRACE command creates a LinuxCAD drawing object of the Trace type. Traces are lines without line type attributes. They have a non-zero width. The proposed use of the trace is for printed circuit board design.

 
Example: 
 
Command:TRACE 
 
Trace width {4.000000} :2 
 
From point:-2575.507666,1111.457380 
 
To point:-2254.809896,1131.673285 
 
To point:-2197.837800,983.729615 
 
To point:-2603.074810,1020.485806 
 
To point:Nil 

TRACE command works similarly to a line command. It will draw vectors until you press the right mouse key.

The very first TRACE command prompt asks you to enter new trace width and offers a default value. LinuxCAD stores trace width in the drawing file.



DONUT

This command creates the LinuxCAD drawing object Doughnut in the drawing (a solid filled circle). LinuxCAD Doughnuts have inner and outer diameter and are filled by the Doughnut entity color. The first two questions of the command define the inner and outer diameters of the doughnut. Later you can create many doughnuts. Exit the command as usual by pressing right mouse button.

 
Command:DONUT 
 
Inside diameter  {20.000000} or point to accept:10 
 
Outside diameter  {30.000000} or point to accept:11 
 
Center of doughnut:-2261.242230,1034.269378 
 
Center of doughnut:-2331.997898,1076.538998 
 
Center of doughnut:-2188.648752,950.649043 
 
Center of doughnut:-2158.324894,1028.755949 
 
Center of doughnut:Nil 
Some more drawing commands accessible in Draw/Draw... sub-menu.

RECTANGLE

The RECTANGLE command is for insertion of rectangles in the drawing. LinuxCAD does not have a rectangle entity type, instead the command simply adds four lines to the drawing. All you need to do to create a rectangle is to enter two points at the ends of a rectangle diagonal line. This works very similarly to selecting a window in the Zoom Window command.

 
Command:RECTANGLE 
 
First corner of rectangle:-2715.392942,1279.180825 
 
Second corner of rectangle:-2649.693759,1314.220390 


MTEXT

Multi-line Text Creation command, creates multi-line text (another way to access this is from Draw/Draw.../Multiline text pull down menu.

 
Command:MTEXT 
 
Enter {Start point:/ALIGN/FIT/CENTER/MIDDLE/RIGHT/JUSTIFY/}:-2912.490493,328.732635 
 
Height  {3.000000} or point to accept:2 
 
Rotation angle  {0.000000} or point to accept:30 
 
Text:String 1, Hello world !! 
 
Text:String 2, Hello world again !! 
 
Text:String 3, Good by boring world. 
 
Text:Nil 

This command resembles the ordinary TEXT command but later Text: prompt will loop and you can create many text strings with the same text height and rotation angle. The start point will progress from the top to bottom with the predefined step. This command is especially useful for putting extensive text into the drawing. Again, text rotation angle has to be entered in degrees.



ARRAY

The ARRAY command is for creation of rectangular and polar arrays from the selected set of objects. It lets you copy any number of objects quickly, using rectangular or circular patterns.

Example of a rectangular array creation:

 
Command:ARRAY 
 
Select object:-2887.441159,344.226709 
 
Found 1 object! 
Select object:Nil 
 
Rectangular or Polar array  {R/P/}:R 
 
Number of Rows (---)  range ( 1 ... 1000 ):100 
 
Number of Columns (|||)  range ( 1 ... 1000 ):20 
 
Unit cell or distance between Rows (---):1 
 
Distance between Columns (|||):2 

When doing an array, select object or objects first, terminate selection of objects by right mouse key, then choose what array type you are going to create. R - stands for rectangular array, P - stands for polar array. Once you have done that LinuxCAD asks you to enter the number of rows and columns in rectangular array and the distance between rows and columns. Then LinuxCAD creates an array by adding new copies of the objects you have selected to the drawing.

Let us review the creation of the polar array too:

 
Command:ARRAY 
 
Select object:3.452755,2.545149 
 
Found 1 object! 
Select object:Nil 
 
Rectangular or Polar array  {R/P/}:P 
 
Center point of array:3.554618,2.536123 
 
Number of items: range ( 1 ... 1000 ):40 
 
Angle to fill in decimal degrees ( +=ccw, -cw ):3 
 
Rotate objects as they copied  {YES/NO/}:yes 

Keyword P in the 5th line takes you to the polar array mode. You have to enter the number of items in the polar array and the total angle to fill. For example, if you enter 360 degrees, your objects will be evenly distributed around the circle.










2. Displaying and Zooming Commands.



ZOOM

This zooming command works exactly in the same way as zoom command in AutoCAD. When invoked, the command will produce the following menu:

Select (1st window point/Scale factor/ALL/CENTER/EXTENTS/PREVIOUS/WINDOW):

If you select a point, you then will proceed in zoom window mode. The same zoom window occurs when you select the WINDOW option.

   For example:

Command:ZOOM

Select <1st window point/Scale factor/ALL/CENTER/EXTENTS/PREVIOUS/WINDOW/>:2.612500,6.027083

Second corner of zoom rectangle:5.568750,8.341667

   or

Command:ZOOM

Select  1st window point/Scale factor/ALL/CENTER/EXTENTS/PREVIOUS/WINDOW :WINDOW

First corner of zoom rectangle:2.429167,5.362500

Second corner of zoom rectangle:6.279167,7.837500

If you enter a real number, LinuxCAD will just change magnification of the current view by that factor ( something similar to what you can accomplish by commands ZOOMPLUS and ZOOMMINUS

Option ALL will make all area which has been set as drawing limits by DWGLIMITS command visible.

Option EXTENTS will make all objects in the drawing visible, even if they are outside of the specified drawing limits.

Option PREVIOUS will return you to the zoom previously specified. LinuxCAD keeps up to 20 of the previous zooming windows in its buffer.

Option CENTER will ask you to enter a point and will then move the center of the current visible window to that point.

   For example:

Command:ZOOM

Select <1st window point/Scale factor/ALL/CENTER/EXTENTS/PREVIOUS/WINDOW/>:CENTER

New view center point:11.870833,10.106250

This ZOOOM command works exactly like the AutoCAD ZOOM command. Some of the functions of this command are duplicated by other LinuxCAD specific ZOOM commands, explained below:


ZOOMALL

The command changes the visible part of the drawing so all of the drawing is visible. It will zoom according to the format you set earlier by DWGLIMITS command ( A,B,C,D ... ISO A4 etc. )



ZOOMEXT

The command alters the view of the drawing so that all objects become visible. This view can be distorted by distant objects which are not important but still ended up in the drawing as the result of sketching or user errors.



ZOOMPLUS

This command is tied to the menu item Display/Enlarge and enlarges the view of the objects. This command makes objects appear closer by a multiple of 1.6. In some other CAD programs they call this function Zoom In.



ZOOMMINUS

ZOOMMINUS command is also accessible as menu item Display/Diminish. It moves objects 1.6 times away from the viewer. In some other CAD programs they call this function Zoom Out.


ZOOMTEXT

It is a frequently needed task to find out whether part with certain name located in the drawing. You could search for a part name or for a town name or street name. All these types of objects are represented as a text strings in LinuxCAD drawing. Whenever you want to find an object labeled by some text in your LinuxCAD drawing use this command.

  Example:

Command:ZOOMTEXT
This command will find a text in the drawing and ZOOM to that part of the drawing.
Enter string to search:PLAZA
Search for text where ? :TEXT
Found 1 occurences.
Continue search ? :NEXT
No more found.

The above example searches and zooms to all occurences ( in this example only one was found ) of the word PLAZA in the drawing.



ZOOMW

The most common Zooming command, which zooms by Selecting Window frame. ZOOM Window is accessible from Display/Zoom Window pull down menu item too.


"Transparent" Zooming.

Commands ZOOMPLUS and ZOOMMINUS. Can also be used in the transparent mode, when some other drafting, editing or zooming command is in progress. To run transparent ZOOMPLUS, use "+" button in right top corner of LinuxCAD main window. To run transparent ZOOMMINUS, use "-" button in right top corner of LinuxCAD main window.

About other buttons in that area of LinuxCAD main window:

Save button - saves the drawing. Also can be used when some other command is in progress.

"?" button, displays "about" information, your location in UNIX system and program creation date and time.

"SCR" button invokes File selection dialog where you can select a command script to run.

You can create command scripts, by using menu selections: "Options/Editor Settings/Spool commands to ..." and "Options/Editor Settings/Spool Off" when you are done.

If you start LinuxCAD with the -trace option on, all commands will be saved to the trace file. This trace file can be used as a script later.



PAN

The PAN command, or otherwise called Panning Zoom, changes current viewing area without a change in magnification. The command asks you to enter two points. The screen crawls over the drawing from point 2 to point 1.




UCS

The UCS command defines a User Coordinate System. This is very convenient when you need to do relatively complex work in a coordinate basis which is different from standard vertical and horizontal. When you set UCS, it immediately will affect orientation of the Ortho, Snap and Grid. The coordinates you type in the command line are now assumed by LinuxCAD as UCS coordinates. The related ACAD command PLAN is not yet implemented.

The main menu of the UCS command is the following:

Select any of ORIGIN/ANGLE/TWO_POINTS/RESTORE/SAVE/?/WORLD:


Option ORIGIN changes only the origin of the coordinate system. For example, you can move the origin of UCS to point 100,100 and, when you work in UCS , the point of 101,101 would seem the same as 1,1.

UCS

 Select any of  ( ORIGIN/ANGLE/TWO_POINTS/RESTORE/SAVE/?/WORLD ):ORIGIN

Enter new origin of the UCS:0.090956,0.181913

Option ANGLE creates new UCS by rotating the horizon on the angle you specify by entering scalar in decimal degrees.

  For instance the following will rotate coordinate system on 35 degrees counter
clockwise.

Command:UCS

 Select any of  ( ORIGIN/ANGLE/TWO_POINTS/RESTORE/SAVE/?/WORLD ):ANGLE

Enter angle of rotation of new UCS (decimal degrees):35.0

Using option TWO_POINTS you can change the origin of the coordinate system as well as its rotation angle simultaneously.

   The example:

Command:UCS

 Select any of  :TWO_POINTS

Enter the origin of the new UCS:3.328383,7.139756

Enter the point on positive 0X axis of the UCS:4.591664,7.554113

New UCS origin = 3.328383,7.139756, Rotation Angle = 18.159525

Option WORLD will take you back to the world coordinate system and will make everything "normal" again.

SAVE stores UCS and the visible 2D window under the name you choose, so you can return to both easily later.

RESTORE makes a stored UCS active

? prints the list of all named User Coordinate Systems the LinuxCAD keeps.










3. Editing Commands - Commands for Modifying Graphics Objects within the Drawing.

3.1 The group of commands for accessing the windowing system clipboard.

XCLPCUT
XCLPCOPY
XCLPPASTE
XCLP_PASTETEXT

The commands above are from "Edit/Clipboard" menu. These commands utilize the X-server clipboard buffer to store graphics objects on their way from one drawing file to another. You can cut and paste between different drawings as well as within the same drawing.

XCLPCUT - Cuts object or objects and stores them in the X-clipboard.

XCLPCOPY - Copies object or objects and stores them in the X-clipboard.

XCLPPASTE - Pastes object or objects from the X-clipboard and put them into the current drawing.

XCLP_PASTETEXT - Pastes plain text from the clipboard into the current drawing using a process similar to repeating TEXT commands.

 
Examples: 
 
Command:XCLPCUT 
 
Select objects:4.224844,4.316565 
 
Found 1 object! 
Select objects:4.240623,4.127215 
 
Found 1 object! 
Select objects:4.524647,4.253448 
 
Found 1 object! 
Select objects:4.051273,4.379681 
 
Found 1 object! 
Select objects:Nil 
 
Base point:3.656795,4.253448 

Now the selected object will disappear from the drawing, they will be gone to the X-clipboard. Be aware when you copy a block (or to be precise an INSERT object) to the clipboard, the block itself will not be copied but rather all the entities composing the block will be copied. LinuxCAD performs deep explode automatically before copying the block to the X-clipboard. The INSERTs in the original drawing, however, will remain as they were. This approach makes sense because the other drawing may not have relevant block definitions in its block table.

Command:XCLP_PASTETEXT 
 
5 lines of text was found on the clipboard. 
Height: {3.000000} or point to accept:0.3 
 
Rotation angle: {0.401082} or point to accept:0 
 
Distance between strings: {1.500000} or point to accept:0.1 
 
Insert point:-1.778333,10.120000 
 
Plain text pasted. Ok. 

As you probably know, the X window system is a networked system, not as ms-windows. Therefore the commands above can be easily used for cutting and pasting between computers separated geographically, but connected over the TCP/IP network (the Internet would be a good example). We very much apologize to those of our users who are computer experts and already know everything that has been said in this paragraph.

When you paste 3D objects using XCLPPASTE you will not see a rubber banding effect. The 3D objects you can only paste in exactly the same place in 3D WCS where they have been in another drawing. Because 2D scale, rotate and move commands do not affect 3D objects. You will have to modify 3D objects you have pasted afterwards using 3D move, scale and similar commands.






3.2 Editing Commands.



COPY

The COPY command copies objects within the current drawing from one location to another.

 
Command:COPY 
 
Select object:3.347827,2.813699 
 
Found 1 object! 
Select object:3.267542,2.635000 
 
Found 1 object! 
Select object:3.306390,2.637590 
 
Found 1 object! 
Select object:Nil 
 
Enter  {Base point:/MULTIPLE/}:3.145819,2.596152 
 
Insertion point:3.593862,2.746363 

You select objects first, then select base point and then the new point. Sometimes it is convenient to make multiple copies at once. You can accomplish this by choosing keyword MULTIPLE in the Keys menu or from a command line.

 
Command:COPY 
 
Select object:3.394444,2.629820 
 
Found 1 object! 
Select object:Nil 
 
Enter  {Base point:/MULTIPLE/}:MULTIPLE 
 
Base point:3.350417,2.487379 
 
Enter target point:3.643069,2.552125 
 
Insertion point:3.842487,2.580613 
 
Insertion point:3.943491,2.681617 
 
Insertion point:4.026366,2.588383 
 
Insertion point:Nil 

This time You will be able to place as many copies of the selected objects as you want, not just one.



COPYROTATE

You find yorself using this command far less often then COPY or MOVE commands. However you'll find COPYROTATE useful whenever you will have to show the motion of rotating parts. This command works much like ROTATE command except it creates second group of objects and rotates them while keeping original objects where they were.

   Example:

Command:COPYROTATE
Select object:c
1-st Crossing point-9.102172,-0.170864
2-nd Crossing point-3.932012,-7.017833
Found 7 objects.
Select object:Nil
Base point:-6.028023,-9.393312
Enter  ((Rotation angle:)/REFERENCE/):-4.421081,-10.091983



MOVE

The MOVE command is one you will use often. The command changes the position of the object. It does not remove objects, neither does it create objects. It just modifies an existing object or objects.

 
Command:MOVE 
 
Select objects to move:3.479909,2.521047 
 
Found 1 object! 
Select objects to move:Nil 
 
Base point or displacement:3.373726,2.500328 
 
Second point of displacement3.707815,2.609102 
 


MIRROR

Creates a mirrored reflection of the object or objects about the axis you select. You can retain or delete the original objects.

 
Command:MIRROR 
 
Select object:3.790690,2.640180 
 
Found 1 object! 
Select object:Nil 
 
First point of the mirror line:3.806230,2.764492 
 
Second point of the mirror line:3.451421,2.539176 
 
Delete old objects ?  {YES/NO/}:NO 
  Again as always select as many objects as you want, then finish select object 
process by pressing right mouse button and select the mirror line you need and finally 
there are two ways of doing the mirror. You can either keep or do not keep the old objects. 


ROTATE

The command rotates the object or group of objects around the point.

 
Command:ROTATE 
 
Select object:3.741483,2.712695 
 
Found 1 object! 
Select object:3.653429,2.875855 
 
Found 1 object! 
Select object:Nil 
 
Base point:3.407394,2.417453 
 
Enter  {{Rotation angle:}/REFERENCE/}:3.508397,2.552125 

The most important question is the last one. The point entered there allows you to choose the rotation angle. Or you may enter the actual value of the rotation angle in degrees here.

Let us recall the way of entering relative points in polar coordinates: @A<


SCALE

This command changes the size of the existing objects or objects in the current drawing. You can enlarge or reduce objects.

  
Command:SCALE 
 
Select object:-6.056333,18.221070 
 
Found 1 object! 
Select object:-3.982138,17.593988 
 
Found 1 object! 
Select object:Nil 
 
Base point:-4.368035,15.953926 
 
Enter  {Scale factor:/REFERENCE/}:-4.609220,14.603287 

You enter scale factor here as a point. The length of the rubber band will then be taken a scale. It may not be very convenient as it might take an accurate hand to enter a scale less than one. In such situations you can also use the REFERENCE feature. Or you may enter a scale as just a number.

   
Command:SCALE 
 
Select object:-0.408733,17.005495 
 
Found 1 object! 
Select object:Nil 
 
Base point:-0.084580,16.438227 
 
Enter  {Scale factor:/REFERENCE/}:REFERENCE 
 
Reference length: {1.000000} or point to accept:10 
 
New length:5.061354,13.845000 

Enter keyword REFERENCE ( select it as usual from the Keys menu ) and then enter point. Now your scale will be {reference length} / { rubber band length }.





ALIGN

As the name suggests, this command aligns groups of objects so they become located with their respective edges at exactly the same horisontal or verical position. After alignement, objects appear evenly located along the alignement line. The ALIGN command will ask you to select several object groups. And after you select the groups, LinuxCAD will align them all at the location and the rule that you have specified. There are currently only four alignement rules: 1. TOP - align the topmost edges of all object groups 2. BOTTOM - align the object groups bottom ends 3. RIGHT - align right edges 4. LEFT align left edges. At the end of this dialog, the command will ask you to enter the defining point. Depending on what point is needed, either X or Y, you should enter your choosen value to define the alignement boundary.


   This is an example of the typical dialog from ALIGN command:


Command:ALIGN

This command aligns groups of objects.
Align where ? :top

Select group of objects # 1 (to exit click Right Button now):
Select object:2.016667,5.729167

Found 1 object!
Select object:Nil

Select group of objects # 2 (to exit click Right Button now):
Select object:5.522917,6.760417

Found 1 object!
Select object:Nil

Select group of objects # 3 (to exit click Right Button now):
Select object:7.241667,6.783333

Found 1 object!
Select object:7.333334,5.683333

Found 1 object!
Select object:Nil

Select group of objects # 4 (to exit click Right Button now):
Select object:Nil

Enter alignement point:11.939584,10.679167

Command:Nil







OFFSET

Makes a copy of the object and transforms it so that the new object is parallel to the original object and located at the specified distance from the old object or passes through a specified point for central symmetrical transformation of the object. For different objects it works differently. For some object types, it is undefined so the offset command will refuse to handle those. Examples include Solids and Text.

 
Command:OFFSET 
 
Enter  {Offset distance:/THROUGH/}:4 
 
Object to offset:1.941378,14.371749 
 
Found 1 object! 
Side to offset:1.414629,16.114073 
 
Object to offset:1.293071,14.331230 
 
Found 1 object! 
Side to offset:2.549166,12.832021 
 
Object to offset:Nil 

There are two modes of offsetting. One offsets at a specified length and the other offsets to a point (THROUGH mode). Offset command creates new entities one at a time. The original entity which is being offset remains unmodified.

Offset of the Circles, Arcs, Ellipses and Elliptic Arcs, Doughnuts creates concentric objects of the same type with the same center and start end angle but with different axes and radius. Offset of a Line or Trace transforms them to parallel Line or Trace respectively. OFFSET command does not handle Text and Points.



ERASE

This command removes objects from the drawing permanently. Select one or more objects, finish selection by pressing right mouse button and objects are gone.

Command:ERASE 
 
Select object:2.539117,5.029780 
 
Found 1 object! 
Select object:2.072142,7.564789 
 
Found 1 object! 
Select object:7.942688,9.099136 
 
Found 1 object! 
Select object:Nil 

At present time LinuxCAD does not have Undo command to restore deleted objects, so be careful and pay attention to what you are doing. One way to restore deleted object does still exists. Before you have saved and before LinuxCAD has done autosave, you can restore deleted objects by using the command REOPEN ( File/More commands.../ReOpen ). REOPEN abandons the current editing buffer and opens the file again from the disk. If you do REOPEN, you will restore all objects you have delete since the most recent save command and loose all objects you have created after the last save command.



SETUNDOMARK

The command creates a mark in time. This command works in a pair with UNDOTOLASTMARK command



UNDOTOLASTMARK

Removes all objects that have been created after the last SETUNDOMARK command. Removed object may still be visible on the screen, but they actually are not there anymore. Touch the scrollbar to invoke a screen repaint and you'll see them disappear.



BREAK

The command makes two objects from one. Break can split Lines, Arcs, and Circles

    
Command:BREAK 
 
Select single object:-2.961441,17.451206 
 
Found 1 object! 
Enter {Second point of (F-for first point):/F/}:-0.651848,17.086534 

You select a single object first, then you enter a second point. The part of the object inbetween the first point and the second point you have entered will be removed. LinuxCAD will take the pick point of the object as the first breaking point. Sometimes you may want to remove part of the the object or you may wish to just split an object into two parts without damaging either side. To do the later, enter your second point the same as first point.

If another point, other then the pick point is required as the first breaking point, use keyword F to specify the first breaking point explicitly.

To enter the second point precisely the same as first point use relative coordinates, like this:

@0,0



BRKLINES

Breaks all X-shaped intersections of lines. This command does not exist in Acad.

The command will ask you to select objects. From all the objects you select only lines will be taken. This command will break 2 intersecting lines to 4 lines (in the simplest case).



DIVIDE

The command separates any kind of object to specified number of parts using the divider object as marker. The command asks user to select divider object and its base point first. And then the user needs to select the object to be divided and the number of parts. In many cases this command is more convenient then ARRAY command.

 
Example: 
 
Command:DIVIDE

Select divider object:7.539583,5.797917

Found 1 object!
Enter Base Point for divider object:end

Enter point:7.585417,5.087500

Select object to divide:9.281250,5.087500

Found 1 object!
Enter number of parts:8


EXTEND

The command extends lines to the first intersection with the boundary edge. The boundary can consist of any types of stroked (non-filled) objects. But only lines can be extended. When you select lines for extension with EXTEND command pick them from the end closest to the boundary edge.

 
Example: 
 
 
Command:EXTEND 
 
Select boundary edge object(s) ... 
Select object:1.576706,12.102676 
 
Found 1 object! 
Select object:Nil 
 
Select object to extend:0.644765,15.830440 
 
Found 1 object! 
Select object to extend:1.374110,16.438227 
 
Found 1 object! 
Select object to extend:4.777720,17.815879 
 
Found 1 object! 
Select object to extend:-2.232096,13.561366 
 
Found 1 object! 
Select object to extend:Nil 

For an Extend command, select objects that compose the boundary you wish to extend to, then click right mouse button. Then select Lines one by one and see how LinuxCAD extends them synchronously.

EXTEND command as well as TRIM command can work correctly only when boundary line and line to be trimmed or extended, intersect in an X-like intersection. A T-like intersection will not be trimed or extended to. This consideration is more related to the TRIM command than to EXTEND. Therefore in the case of a T-like intersection, we recommend you use BREAK/F/point/same point command and then ERASE command instead of TRIM.



CHAMFER

The command cuts a chamfer from the intersection of the two lines. There are two possible dialogs with the command, setting chamfer distances and actual chamfering. In other words the command trims two intersecting lines at a specified distance from their intersection and connects the trimmed ends with a new line.

Setting chamfer distances scenario:
Command:CHAMFER 
 
Enter {Select first line:/DISTANCES/}:DISTANCES 
 
Enter first chamfer distance:  {0.000000} or point to accept:2 
 
Enter second chamfer distance:  {0.000000} or point to accept:2 
Chamfering two lines scenario:
 
Command:CHAMFER 
 
Enter {Select first line:/DISTANCES/}:2.670723,9.468931 
 
Found 1 object! 
Internal error, the entity have to be on the stack 
Select second line:2.143974,6.511031 
 
Found 1 object! 


FILLET

The command cuts a round chamfer from the intersection of two lines. It trims the line ends first and then connects them with the arc of a specified radius. Like in CHAMFER command, there are two modes: set the fillet radius mode and do the fillet operation mode.

Setting fillet radius scenario:
 
Command:FILLET 
 
Select  { first line or /RADIUS/}:RADIUS 
 
Enter Fillet Radius  {0.250000} or point to accept:1 
 
Fillet Radius has been set to 1.000000 
Performing actual fillet:
 
Command:FILLET 
 
Select  { first line or /RADIUS/}:1.860340,21.219489 
 
Found 1 object! 
Select second line:-0.368214,17.734840 
 
Found 1 object! 
Ok. 
 


HATCH

The Hatch command creates a hatched area. The hatch and crosshatch areas are often used to show removed sections. This command may logically belong either to edit or draw groups. Before you do hatch, you have to have a hatch contour without any T-shaped intersections. Ellipses Lines, Arcs and Circles can all serve as hatch boundaries.

 
Command:HATCH 
 
Enter pattern or U for angle and spacing {?/U/}:U 
 
Angle of crosshatch lines (decimal degrees)  {45.000000} or point to accept:9.032232,10.441391 
 
Spacing between lines  {0.125000} or point to accept:6.520044,10.198276 
 
Double hatch area ? {Y/N/}:Y 
 
Select object:5.912257,19.639241 
 
Found 1 object! 
Select object:Nil 

The first prompt exists for AutoCAD compatibility and will be answered for you if you select HATCH command from the pull down menu. The next prompt asks you to enter you prefered angle for the crosshatch lines. Then you enter the distance between the crosshatch lines and whether you want double hatch or single hatch lines. Finally enter the objects of a closed contour which you wish to form the hatch boundary. For proper hatching it is important that the boundary be closed and do not have a so called T-intersections. All T-like intersections at the corners of hatch boundary has to be broken to adjacent vectors.



CHPROP

The command is available from "Edit/Edit2.../Change Props"

The command changes properties of graphics objects. In LinuxCAD these properties are Color, Linetype and Layer. There are 10 predefined colors and RGB colors combined from levels of green red and blue. Each color component can have a level of intensity from 0 to 255.

There are 1000 possible layers and every layer can have a name. The number of layers can be easily increased on demand. We thought 1000 will be fine for most applications. Objects can be picked only at the layers which are on. If a layer is off, the object on it is invisible.

You can change the line type of any object, including Solids. LinuxCAD will save the line type information. At present time, line types are handled only for Line objects. Later revisions may add line types for Arcs, Circles and Ellipses and possibly for Traces.

The example shows how to change color of one or more objects:

 
 
Command:CHPROP 
 
Select object:1.586106,13.502046 
 
Found 1 object! 
Select object:Nil 
 
Change what property  {COLOR/LAYER/LINETYPE/ELEVATION}:COLOR 
 
Enter color:  
{BLACK/RED/YELLOW/GREEN/CYAN/BLUE/MAGENTA/WHITE/LIGHTRED/RGB/BYLAYER/DIA 
LOGRGB/}:CYAN 
 
Or you can change Layer like this:
 
 
Command:CHPROP 
 
Select object:C 
 
1-st Crossing point0.537795,20.744928 
 
2-nd Crossing point7.542424,13.597347 
 
Found 145 objects. 
Select object:Nil 
 
Change what property  {COLOR/LAYER/LINETYPE/}:LAYER 
 
New layer:lremarks 

If you change layer to the layer which is currently off, your objects may visually disappear. They are not lost, they just become invisible when the layer is turned off. To make objects visible, turn the layer on. That can be done by layer command ( or from "Options/Change Layers/Layer" ).

Elevation is a Z-coordinate for 2D objects. The elevation has been introduced in release 1.96 of LinuxCAD.



CHANGE

Another very interesting command is the command CHANGE. As opposite to CHPROP command which changes generic object properties, the CHANGE command changes specific properties which are different from object to object.

For instance, you can change start and end points for a line, inner and outer diameter for a doughnut, as well as text height and rotation angle for text.

  
 
 Command:CHANGE 
 
Select object to change:-3.074117,19.769680 
 
Found 1 object! 
What to change ? {POINT_1/POINT_2/}:POINT_2 
 
POINT_2:-1.536592,20.030170 
 
Entity was changed. 

The common dialog with the CHANGE command looks like this: you select an object first, then a keyword list will appear and you must choose a parameter of the object you want to modify. After you have selected the keyword, LinuxCAD asks you to enter the new value of the corresponding parameter. Depending on the type of the parameter selected, you may have to enter a real or integer value, a point or string.



TXTCHG

For changing the text there exists a special command TXTCHG. When changing contents of a text string, it is much easier to do in full screen text editor, even if you have only one line to work with.

Command TXTCHG is very simple to use. Just pick a text string and your text editor with the contents of the string will pop up on the screen.

   
Command:TXTCHG 
 
Select text object:18.043729,9.083115 
 
Found 1 object! 
Text has been updated without errors. 
 

When you have finished editing, LinuxCAD will transfer the new text string back to your drawing.

LinuxCAD uses a text editor specified by environment variable: LINCAD_EDITOR

The only requirements to that editor are:
  1. It has to work in blocking mode.
  2. It has to take file name as a command line argument.

If you do not specify any editor, LinuxCAD will cleverly use Xterm and Vi together to give you a primitive X window system text editor.

We recommend you use Sun Open Windows textedit or another similar product.



TXTMAGNIFIER

The command helps to read text when the drawing is big and contains many text strings which cannot be normally observed all at the same time because the view magnification does not allow you to read them. The command asks you to select an object. If the selected object is a text the command will magnify it to a height that is comfortable to read. The magnified text string will remain on the screen until you click a mouse key.



TXTEXEC

One very interesting feature of LinuxCAD is its ability to bind executable contents to every graphics object. Executable contents is a single line command string that can be executed by LinuxCAD from time to time on user demand. To execute an executable contents bound to graphics object, select command TXTEXEC from "Edit/Edit 2.../EXEC". Simply pick an object and the attached executable content is performed.

  
Command:TXTCHGEXEC 
 
Select executable object (text):16.748726,9.477619 
 
Found 1 object! 
EXEC string has been updated without errors. 






4. Obtaining Additional Information about your Drawing using commands from the "Inquiries ?" sub-menu.

There are following commands in Inquiries ? sub-menu:

ID - Enter point and print its coordinates.

ANGLE - print absolute orientation angle in radians.

INCLANGA - print the included by 3 points angle.

DIST - print distance between two points.

LIST - list all data about current primitive.

DBLIST - print the properties of all objects in the drawing.

All Inquiries commands are at: "Display/Inquiries" sub-menu.







5. Commands of the Options sub tree.



CHGCOL

The CHGCOL command changes the current object creation color.

 
 
Example: 
 
Command:CHGCOL 
 
Enter color:  
{BLACK/RED/YELLOW/GREEN/CYAN/BLUE/MAGENTA/WHITE/LIGHTRED/GREY/RGB/BYLAY 
ER/}:Yellow 

RGB choice will invoke the RGB selection dialog. Use the RGB selection dialog to compose a customized RGB color.



LINETYPE

The LINETYPE command controls the Line Types. The command is accessible from "Options/Change Line Type"

Command:LINETYPE 
 
Enter  {?/CREATE/LOAD/SET/}:? 
 
 
   ? - prints information about all linetypes defined in the current drawing. 
 
   LOAD - loads linetype definitions from the external file. 
 
   SET - sets the current object creation line type. 
 



LAYER

LAYER command controls creation, deletion and state of layers.

Object in LinuxCAD drawing can be grouped in layers which can have color and line type assigned to them. Layers can also be in the On or Off state. When the layer is On, you can select and edit the objects on it. When the layer is Off, you cannot see or edit the objects created on that layer. When you draw objects you are creating them on the current layer.

Speaking of layers we should mention that entities in the drawing can be arranged in such a way that some of them appear on top of others. Normally, objects on layers with smaller numbers are in the background and objects on the layers with larger numbers are in foreground. To activate that mode you should use ORDLAYER command. For example, when drawing the flag of Sweden you may draw TRACE of blue on layer 0 and draw a yellow cross on layer LDIMENSIONS (which has number 1) so that the cross appears to lay on top of the blue field.

The layer command options:

 
Command:LAYER 
 
Enter  {?/NEW/SET/ON/OFF/}:? 
? - lists all layers in the current drawing. You will get some thing similar to the following:
 
 Layer #    Name        Color                Line type                    State 
-------------------------------------------------------------------------------------- 
*   0      0            white                  CONTINUOUS                   On 
    1      LDIMENSIONS  red                    CONTINUOUS                   On 
    2      LHATCH       red                    CONTINUOUS                   On 
    3      LREMARKS     yellow                 CONTINUOUS                   Off 

In the table above, there are standard predefined LinuxCAD layers. The current layer is marked with a star at the first column.

NEW - creates a layer.

In this next example we created layer QQQQ with color Magenta, line type Continuous and initial state On.

 
Command:layer 
 
Enter  {?/NEW/SET/ON/OFF/}:n 
 
Enter layer name:qqqq 
 
Enter color:  
{BLACK/RED/YELLOW/GREEN/CYAN/BLUE/MAGENTA/WHITE/LIGHTRED/RGB/DIALOGRGB/} 
:m 
 
Enter layer linetype name:continuous 
 
Enter layer state: {ON/OFF/}:on 
 
Layer QQQQ created. 
 
SET - sets the current layer

Example, in this example layer qqqq is being set as a current entity creation layer.

 
Command:layer 
 
Enter  {?/NEW/SET/ON/OFF/}:s 
 
Enter NEW CURRENT active LAYER name:qqqq 
 
Layer QQQQ is new current layer. 

ON - sets the layer On or Off.

 
 
 Example: 
 
Command:layer 
 
Enter  {?/NEW/SET/ON/OFF/}:on 
 
Enter layer name to set ON:qqqq 
 
Layer QQQQ has been set ON. 
 


VIEW

The VIEW command controls Named Views. VIEW command can be also selected as a menu item "Options/Named Views/Views" You can store Views in LinuxCAD using command VIEW/SAVE and you can then return to the saved views using subcommand RESTORE

Command:VIEW 
 
Enter  {?/SAVE/RESTORE/REMOVE/}:? 

? - print all Views.

SAVE - saves current view.

RESTORE - restores current view.

REMOVE - deletes name d view.

Here is an example of the VIEW/? command output:

Command:VIEW 
 
Enter  {?/SAVE/RESTORE/REMOVE/}:? 
 
              Named Views Table 
   Lower X           Left Y            Upper X           Right Y        View Name 
----------------------------------------------------------------------------------------- 
  -35.231593         -20.558426          40.625855          36.334659     A1 
  -0.384578           5.399044           6.015894           10.199398     A2 
  -16.229080         -15.997350          -8.406280         -10.130250     AA22 
----------------------------------------------------------------------------------------- 
 

As you can see the most interesting column is the last one where the View Name is. We recommend you use descriptive names for your views.



BASE

The command defines the insertion base point of the current drawing. This point is used when you insert one drawing into another drawing.

 
Command:BASE 
 
New insertion BASE point:3.218335,2.471840 


DWGUNITS

We created this command to let you to specify in advance the units of your drawing, either millimeters or INCHES. The units are important only in relation to printer output or PostScript export. The command is accessible via menu choice.

"Options/Drawing Settings/Specify units of the Drawing"
Example: 
 
Command:DWGUNITS 
 
Select the Length Units of the Drawing: {INCHES/MILLIMETERS/}:MILLIMETERS 
 
Drawing units have been set to Millimeters. 
 


TOOLMENU

This command controls loading of user programmable tool menus.

Command:TOOLMENU 
 
What to do ?  {ACTIVATE/LOADALL/RECREATE/}:LOADALL 

ACTIVATE - load individual menu file.

LOADALL - load all *.mnu files from the LinuxCAD directory. LinuxCAD directory is a special directory that you specify with environment variable: LINCAD_DIR.

RECREATE - some minimal menu prototype has been built into LinuxCAD. This command forces LinuxCAD to write out the menu prototypes in the current directory. Before Menus may be used by LinuxCAD in LOADALL command they must be manually moved to LINCAD_DIR.

 
    The menu file format: 
 
#{menu interpreter command} {menu interpreter command parameters} 
 
  . 
  . 
  . 
 
*{Menu Item Name 1} {Command Input 1} 
{Command Input 2} 
. 
. 
. 
{Command Input n} 
 
   First empty line terminates the batch of LinuxCAD commands 
 activated by this menu. 
 
   . 
   . 
   . 
*{Menu Item Name N} {Command Input 1} 
{Command Input 2} 
. 
. 
. 
{Command Input m} 
   

  

   An example of the menu file: 

 
#GEOMETRY 902 25 107 303 
#TITLE Setup 
*Grid_&_Snap_ON GRID 
ON 
SNAP 
ON 
 
*Grid_&_Snap_OFF GRID 
OFF 
SNAP 
OFF 
 
*Set_Color CHGCOL 
 
*Set_RGB_Color CHGCOL 
RGB 
 
*Set_Format DWGLIMITS 
 
*Set_B_portrait DWGLIMITS A 
 
*Set_CONTINUOUS LINETYPE 
SET 
CONTINUOUS 
NIL 
 
*Set_HIDDEN LINETYPE 
SET 
HIDDEN 
NIL 
 
*Set_CENTER LINETYPE 
SET 
CENTER 
NIL 
 
*Set_DOTTED LINETYPE 
SET 
DOTTED 
NIL 


TOOLBARS

One of the most convient features of any GUI are standard toolbars. LinuxCad supports toolbars with the TOOLBARS command. The LinuxCAD toolbars are groups of small buttons, sometimes with graphics that concisely illustrate the actions to be done when you click the toolbar button. LinuxCAD toolbars have an extension *.tbr. Toolbars can use built in bitmaps as well as loadable bitmaps. Loadable bitmaps has to have the .xbm extension.

 
Command:TOOLBARS 
 
What to do ?  {ACTIVATE/LOADALL/RECREATE/}: 

ACTIVATE - activates an individual toolbar.

RECREATE - recreates built-in toolbars .

LOADALL - loads all toolbars from LinuxCAD support sub-directory (the one pointed to by LINCAD_DIR).



CMDSPOOLON

The CMDSPOOLON command enables automatic writing of all user commands to the spool file. The command requires you to enter a spool file name.

Example: 
 
Command:CMDSPOOLON 
 
Enter OS file/path to spool commands to: 

The spool starts.



CMDSPOOLOFF

When the spool is no longer needed, stop it using CMDSPOOLOFF command.



AUTOSAVE

Use AUTOSAVE command to specify the interval for regular saving of the current file.

 
 Example: 
 
Command:AUTOSAVE 
 
Enter Interval in seconds or OFF:60 
 

The AUTOSAVE command is accessible via "Options/Editor Settings/AutoSave"



HOST

The HOST command lets you run any OS command (Linux or Unix) without leaving LinuxCAD. Some usefull new feature are in the"Options/Editor Settings/OS services" menu branch.



STYLE

The STYLE command reports information about loaded SHX fonts and controls the fonts. The command puts SHX fonts in relationship to Logical style. At present time only SHX fonts of ACAD r. 10 and earlier are supported. Special TrueType like fonts in LTF format are supported too. .LTF is a Software Forge Inc. own aproximation of TrueType. LinuxCAD does require you to specify an extension of the font file. LinuxCAD will attepts to load font from current directory of from fonts directory under LINCAD_DIR.

 
Command:style 
 
Text style name(. - to keep default) or ? {STANDARD}:RMC 
 
New style. 
Enter SHX font file name for the style:romanc.shx 
 
Style RMC has been created successfully. 

When command STYLE reports success, that means LinuxCAD has actually gone out to the disk and loaded the specific SHX font.

? - as usuall will give you a list of text styles in the current drawing.



PICKBOX


PICKBOX sets the desired size of the object picking box.

 
Example: 
 
Command:PICKBOX 
 
Enter new PICKBOX side length  range ( 2 ... 20 ):6 
 
Pickbox size 6 has been set. 

PLINE


PLINE draws an AutoCAD style polyline. Polylines are chains of points that are associated together in a complex entity. Polylines can have a starting and ending line width for every segment. They can also have linetypes. There are two types of polyline segments in LinuxCAD: Arc and Line.

 
Command:PLINE

Enter  :LINE

Enter  :1.833333,9.968750

Enter  :6.668750,9.968750

Enter  :8.227083,8.456250

Enter  :7.677083,6.210417

Enter  :5.064583,7.356250

Enter  :ARC

Enter  :2.910417,6.714583

Enter  :4.079167,6.072917

Enter  :5.087500,5.912500

Enter  :HALFWIDTH

Start width <0.000000> or point to accept:0.2

End width <0.000000> or point to accept:0.7

Enter  :9.120833,6.783333

Enter  :10.495833,9.327083

Enter  :Nil


The subcommands of the PLINE command do the following:




PEDIT

PEDIT edits polyline command. You can edit the properties common to all vertexes. You can also change the location, insert, or remove individual vertexes. The editing of Arc type vertexes is not specifically supported. Thus all vertexes that are newly inserted by the PEDIT command will be inserted as Line type vertexes.

Subcommands of the PEDIT command:

Once you have selected EDIT_VERTEXES, the PEDIT command will switch to the edit vertexes mode. In this mode you may affect polyline locally at the current vertex position. The current vertex will be marked with a pink cross.

Subcommands of the PEDIT command in edit vertexes mode:
  • NEXT goes to the next vertex and makes it current.
  • PREVIOUS goes to the previous vertex.
  • BREAK breaks polyline at two diffrent polylines.
  • INSERT inserts new vertex before the current vertex.
  • MOVE moves current vertex in new location.
  • END exits form edit vertexes mode.

PLINEVEC

PLINEVEC creates polyline segment. The polyline segments is a new object type in LinuxCAD. It does not exist in AutoCAD. Unlike lines, the polyline segemnts can have starting and ending width and they have a linetype. These properties make them different from traces as well.

Command:PLINEVEC

Start width: <0.000000> or point to accept:0.1

End width: <0.000000> or point to accept:0.4

From point:2.222917,7.081250

To point:6.439583,9.120833

To point:9.693750,6.072917

To point:11.733333,9.739583

To point:Nil


PLINEARC

PLINEARC create a polyline segment of the Arc type. This entity is also a new object in LinuxCAD which does not exist in AutoCAD. This entity acts as an Arc in every way except it has a starting and ending width.

PLINEARC

Start width: <0.000000> or point to accept:0.1

End width: <0.000000> or point to accept:0.3

Enter  ((Start point:)/CENTER/):1.672917,8.708333

Enter  ((Second point:)/CENTER/END_POINT/):3.552083,10.060417

End point:4.056250,6.462500


ORTHO

ORTHO command controls a special drawing mode where you can only enter vertical or horizontal lines. This command is available from "Options/Settings/Ortho".

 
Example: 
 
Command:ORTHO 
 
Enter {?/ON/OFF/}:ON 
 
Ortho changed to ON . 


AXIS

The command controls the visibility of LinuxCAD Axes. This command is available from "Options/Settings/Axis"

Command:AXIS 
 
Enter {?/ON/OFF/SET/}:ON 
 
Axis changed to ON . 


SNAP

SNAP enables incremental cursor movement. If the SNAP is ON your cross hair or cursor position moves non-contiguously. It incrementally jumps between X0 = N*dx and X1 = (N+1)*dx and Y0 = N*dy and Y1 = (N+1)*dy This command is available from "Options/Settings/Snap"

 
Command:SNAP 
 
Enter {?/ON/OFF/SET/}:ON 
 
Snap changed to ON . 

SET - invokes SNAP setup dialog



GRID

GRID creates coordinate dots over the whole surface of the screen. This command is available from "Options/Settings/Grid"

 
Example: 
 
Command:GRID 
 
Enter {?/ON/OFF/SET/}:ON 
 
Grid changed to ON . 

SET - invokes grid setup dialog. Using the grid dialog you can customize all grid parameters. For example GRID can be made equal to SNAP.



SCREENEXT

SCREENEXT command is accessible from "Options/Settings/Screen Extents". The command changes the size of the black drawing area for graphics output between several predefined sizes.


Command:SCREENEXT 
 
Enter  
{SIZE640X480/SIZE800X600/SIZE1024X768/SIZE1024X1024/SIZE1400X1200/SIZE2048X2048/SIZE 
4096X4096/}:SIZE640x480 

Predefined sizes, are often enough for the majority of possible applications. It makes sense to use the highest number of pixels so that the largest amount of your screen is allocated to the drawing area. Keep in mind, after you have changed the screen extents you may loose sight of your drawing. You can solved this by using the command Zoom Extents and your drawing will come back.



DWGLIMITS

The command sets drawing limits for most US and international drawing formats. Drawing format and drawing extents as well as current zoom are stored in the drawing file. DWGLIMITS command can set A,B,C,D,E ANSI formats and A4,A3,A2,A1,A0 ISO formats in Portrait and Landscape configurations.

 
Example: 
 
 
Command:DWGLIMITS 
 
Enter: {Lower left point:/LANDSCAPE/PORTRAIT/A/B/C/D/E/ISOA4/ISOA3/ISOA2/ISOA1/ISOA0/}:B 


CIRCUM

This command sets the new value for the circumference parameter. It directly impacts the precision of LinuxCAD calculations. Circumference is the number of segments LinuxCAD breaks nonlinear curves into before processing them.

 
Example: 
 
CIRCUM 
 
Current Circumference = 360 
Enter new circumference: range ( 36 ... 360 ):30 

Although the upper limit of the circumference is 360, we do not recommend using values above 60. Doing so will unnecessarily increase computational workload for CAD engine and slow down redraw event processing. In general, LinuxCAD will work fastest and best if you minimize the number of Redraw events. One way to do that is to use the Tool Menus. Because Tool Menus not like Pull down Menus they do not obscure the drawing area. The Pull down menus cause redraws even when you are just navigating them. We will do something about redraws in the upcoming releases.







5. Commands for PostScript Output.

There is only one command that does it all. That is PRINTPS. This command, as well as some other hard copy commands, works in conjunction with DWGUNITS command.

The following options are available to you when you are exporting to Postscript with LinuxCAD's PRINTPS command:

VIEW - prints current visible part of the drawing to linuxcad.ps file.

WINDOW - lets you select the window and will print all the objects within the window to linuxcad.ps file .

EXTENTS - prints all objects of the current drawing to linuxcad.ps

US_A_SIZE_PORTRAIT , US_A_SIZE_LANDSCAPE These commands asks you to enter the location of a chamera that will take a shot of part of the current drawing. The size of the selection box will show you what part of the drawing will fit on a regular letter-sized page. The selected part of the drawing will be sent to linuxcad.ps as postscript formatted data.

ISO_A4_PORTRAIT , ISO_A4_LANDSCAPE Use these commands instead of the two commands above when you working in metric system and your drawing is in metric units.

The linuxcad.ps file in the current working directory is where you will find your output. To print the output or to view it, use the following command:

ghostview linuxcad.ps &

See documentation for GNU Ghostscript to learn more about what you can do with postscript data using Ghostscript. Ghostscript is included in every Linux distribution. If you do not have it, you probably have not installed the RPM in which it is located.

VIEW, WINDOW and EXTENTS branches sense the current DWGUNITS setting and cut the selected area on either US letter sized parts or IS A4 sized parts. The size of parts LinuxCAD breaks the total window into depends on whether it assumes the drawing are made in millimeters or in inches. LinuxCAD does not make educated guesses. It just queries for an internal variable which the user can affect using DWGUNITS command. It is very wrong to have DWGUNITS not properly set to millimeters when you are actually drafting in millimeters. In that case, LinuxCAD will mistakenly cut your drawing into postal stamp sized pieces, where every piece will be a separate page.

 
  Examples: 
 
Command:PRINTPS 
 
Method of printing {IN_COLORS/BLACK_AND_WHITE/DITHERING/}:IN_COLORS 
 
Choose what to print   
{VIEW/WINDOW/EXTENTS/US_A_SIZE_PORTRAIT/US_A_SIZE_LANDSCAPE/ISO_A4_PORTRAI 
T/ISO_A4_LANDSCAPE/}:US_A_SIZE_PORTRAIT 
 
Enter point:10.616133,1.662048 
 
Writing color PostScript picture. 

 
  Command:PRINTPS 
 
Method of printing {IN_COLORS/BLACK_AND_WHITE/DITHERING/}:BLACK_AND_WHITE 
 
Choose what to print   
{VIEW/WINDOW/EXTENTS/US_A_SIZE_PORTRAIT/US_A_SIZE_LANDSCAPE/ISO_A4_PORTRAI 
T/ISO_A4_LANDSCAPE/}:WINDOW 
 
First corner of print rectangle:-14.837713,-1.112343 
 
Second corner of print rectangle:27.449834,23.107776 
 
Writing monochrome PostScript picture. 
 
 

Occasionally you may want to designate a file other than "linuxcad.ps" as a recipient of the Postscript output. In this case you may choose the SETTINGS branch of the PRINTPS command dialog.

This is a sample of how to choose another output file name:

Command:PRINTPS

Drawing units are MILLIMETERS. Use DWGUNITS command to change if needed.
Method of printing  (N_COLORS/BLACK_AND_WHITE/SETTINGS):SETTINGS

What to set ? (OUTPUT_FILE/LINE_WIDTH):OUTPUT_FILE

Enter new output file name or RIGHT BUTTON to keep "linuxcad.ps":A1.PS

Method of printing (IN_COLORS/BLACK_AND_WHITE/SETTINGS):IN_COLORS

Choose what to print  (VIEW/WINDOW/EXTENTS/US_A_SIZE_PORTRAIT/US_A_SIZE_LANDSCAPE/ISO_A4_PORTRAIT
   /ISO_A4_LANDSCAPE/ISO_A3_PORTRAIT/ISO_A3_LANDSCAPE/ISO_A2_PORTRAIT/ISO_A2_LANDSCAPE):EXTENTS

Writing color PostScript picture.

In the example above, file a1.ps will be used instead of linuxcad.ps. Another parameter of Postscript output that can be changed is the width of thin lines. Unlike Traces and Polylines that can have width in the drawing, the thin lines created by the LINE command, the RECTANGLE command, the ARC command, the CIRCLE and similar commands have a width of zero. Obviously when you print or plot them they will be assigned some non-zero width by plotter or printer driver. That assigned width may be not the one we would prefer, that is why we have provided the opportunity to set thin lines width in the PRINTPS command. Just select sequentially PRINTPS/SETTINGS/LINE_WIDTH to do it.





6. Commands for printing to DeskJet, LaserJet and HP-GL plotters.

PRINTDJ - print to HP DeskJet type printer in Black and and White.

PRINTDJCOL - print to HP DeskJet type printer in Colors.

Both commands offer the same dialog to the user with the only difference been that one does not print in colors. The DeskJet printing implementation in LinuxCAD is compatible only to PCL 3 capable Desk Jets. Those are models are 660, 670, 850, 870, 890. Some of Desk Jets were designed as Windows only printers. So those PCL 3 implementations are in the MS-Windows driver, not in the firmware. Examples of Windows only deskjets are 720 and 820 models.

Both Desk Jet printing commands ask you "How many dots per inch you want to print?". They do it by giving a menu of acceptable DPI values:


Command:PRINTDJ

Choose what to print or set DPI { current dpi = 75}: :SET_DPI

Set number of dots per inch to print {current dpi = 75}: :DPI_150

Print quality for DeskJet has been set to 150 dpi.

The more dots per inch you print, the more precise your drawing will look. After selecting the DPI, the PRINTDJ ( or PRINTDJCOL ) command exits, but the printing accuracy is saved and applied to any print command that will follow. If you are satisfied with the DPI value which the LinuxCAD shows you as a default, you do not have to set DPI.

Other interesting options for DeskJet printing are:

VIEW - print View.

This subcommand works internally different from the other two. PRINTDJ/VIEW works similarly to print screen. It prints not in the Model sizes, but in the screen sizes, using the same number of pixels as corresponding objects occupy in the drawing area of the LinuxCAD.

You cannot print View in colors. To print View in colors Scale the drawing for required physical size and then use PRINTDJCOL/Window.

WINDOW - print Window. Just select corner points of your drawing format and LinuxCAD will cut it to the A size or ISO A4 size subparts and print them all, so you can glue them together later.

EXTENTS - prints all objects of the drawing to Desk Jet. This print can be easily distorted by insignificant objects out of view but within the same drawing file.



PRINTLJ - print to HP LaserJet type printer in Black and and White.

Command:PRINTLJ

Starting printing process.
Method of printing :Nil

Do not try to print to LaserJet "IN_COLORS". Even if you see the message, LinuxCAD will not tell the LaserJet to print in color. The reason for the option to print "IN_COLORS" is there, is because internally the Postscript output and LaserJet printing work about the same way with minor only differences.


DXFIN

Imports AutoCAD DXF files. DXF stands for Drawing Exchange Format. LinuxCAD has been tested and is compatible to DXF files exported by AutoCAD rel 10. and AutoCAD rel. 13. Support for other releases of DXF may be provided in future versions of LinuxCAD. We can also can develop the interface to a specific version of DXF on a special order.






7. Installation and LinuxCAD Extensions.


There are several methods of installation depending on the installation source. The two most common sources are: delivery by ftp and delivery in a shrink-wrapped box on diskettes or CD-ROM.


To Install when delivered by ftp:

From ftp.softwareforge.com LinuxCAD comes as a single tar-red and gzip-ed archive. Do the following to install:

  1. copy lin_tar.gz to the sub-directory you want the program installed.
  2. gzip -d lin_tar.gz
  3. tar xvf lin_tar


To Install when delivered on diskettes:

LinuxCAD may be delivered on 1.44MB 3.5'' floppy disks. Usually the disks will have an ext2 file system on them. Therefore in Linux, they must be properly mounted before you can copy their contents on a hard disk. Here is how you do it step by step:

  1. Create directory where LinuxCAD will reside:
    mkdir /usr/linuxcad
    or other directory of your choice

  2. Mount disk1 in your 1.44MB drive:
    mount -t ext2 /dev/fd0 /mnt

  3. Copy archive from disk1 to the LinuxCAD directory. Then expand it:
    cp /mnt/lcadexe.tar.gz /usr/linuxcad
    cd /usr/linuxcad
    gzip -d lcadexe.tar.gz
    tar xvf lcadexe.tar
    rm lcadexe.tar

  4. Unmount disk1 and mount disk2 in your 1.44MB drive:
    umount /mnt
    change disk
    mount -t ext2 /dev/fd0 /mnt

  5. Copy archive from disk2 to the LinuxCAD directory. Then expand it:
    cp /mnt/lcadoth.tar.gz /usr/linuxcad
    cd /usr/linuxcad
    gzip -d lcadoth.tar.gz
    tar xvf lcadoth.tar
    rm lcadoth.tar

  6. Put
    LINCAD_DIR=/usr/linuxcad
    export LINCAD_DIR
    in your profile and add /usr/linuxcad to your $PATH


To start the program:

linuxcad { drawing file name }

recommended extension for drawing files is ".dxs"


Optional LinuxCAD extensions

  1. Print option: Printing to DeskJet, LaserJet and to MS Windows based LinuxCAD print server - $100 (included in your release free of charge).

  2. Plot option: To HP-GL compatible plotters $100 (included in your release free of charge).

  3. DXF Import option $100 (included in your release free of charge). To access dxf import type use DXFIN command.

  4. Customization option: Includes hot keys menu and user-programmable pull down menu, command aliases, icon menus, GNU C/C++ programming interface, and Lisp programming interface. $200 ( partially included in your release free of charge).

  5. 3D design option: $200 ( partially included in your release free of charge).

  6. DWG compatibility option: provides native Acad-DWG files read and write for the versions of ACAD 10,11,12,13,14 ( partially included in your release free of charge), the full DWG capability may be obtained from Software Forge Inc. for $299.00 for existing LinuxCAD users. The version of LinuxCAD you have received may not support all DWG formats or it may only read and some read and write some of them. The LinuxCAD development team is trying to support all drawing formats of all versions of AutoCAD. It may sound ambitious, but we are trying to do a better job in format support then Autodesk does itself.

  7. LinuxCAD parallel computing extension: consist of LinuxCAD Remote Server and special TCP/IP enabled version of LinuxCAD client. You can set up one or more instances of LinuxCAD Remote Server on your LAN. When certain commands that require considerable calculations (mainly Hidden Line Removal and Rendering) are being executed your drawing editor (LinuxCAD client) will draw additional computing power from those LinuxCAD Remote Servers , you can then utilize the idle power in a "sleeping at LAN nodes computers" and speed up your work with the drawing. $899 (includes the right to install unlimited number of LinuxCAD Remote Servers)..

  8. LinuxCAD Hierarchical Multilayered Optimized Main Graphics Objects List: gives you significant speed-up in the REDRAW operation for large drawings by balancing all of your objects in the drawing according to their probability of being accessed. It replaces the core engine of your LinuxCAD so the complexity and calculations are moved from Redraw operation to Zoom operation, the later is executed relatively rarely and that produces significant better performance when working with large drawings. $699.

  9. LinuxCAD for Microsoft Windows NT $199.00.


All prices for extension modules are given for Intel X86 platform. For other platforms the price may be different.


Installation of LinuxCAD extensions.

All LinuxCAD extensions and optional modules utilize LinuxCAD loadable modules interface in order to run. Usually this is an extension supplied as a shared library .so - file To load extension module it has to be named in linuxcad.ads file and every line has to contain not more then one loadable module name. Linuxcad.ads file may reside either in current directory or in the LinuxCAD home directory.





Bug reports

Please send bug reports to cadsoftw@aol.com. Please include the name of the command you were running, what the command line prompt was, what you have pressed or typed and what happened.




Updates

You are entitled to free updates within 6 months of purchase. Free updates will not usually cover functionality given above as extensions. Sometimes they will be added at our discretion. Free updates will be delivered by e-mail only. Send e-mail to cadsoftw@aol.com. Please include the build type that works for you. The updates will come as a reply to those e-mails as soon as the update becomes available. If you are already a registeres user, you may request a password for the ftp and you will be able to download upgrades as they become available.





8. LinuxCAD C-programming interface.




8.1 Introduction in ADSL Programming for LinuxCAD.

Programmability is a unique and important benefit of LinuxCAD. Programmability allows the programming-literate user the opportunity to extend the system and further improve the performance of the one's work in LinuxCAD.

We call the technology and tool kit for extending LinuxCAD using external C-programs, The Application Development System for LinuxCAD (or ADSL for short). Application Development System for LinuxCAD and ADSL are trademarks of Software Forge Inc. Every C-application for LinuxCAD technically is a loadable shared library.

User may load existing ADSL programs using the LOADADSL command. The command asks you to, "Enter ADSL program file name:". LinuxCAD may load ADSL programs from any directory mentioned in the environment variable LD_LIBRARY_PATH. or in any other directory where Linux searches for shared library. Normally, it is /usr/lib.

There is a special file, linuxcad.ads, where the names of ADSL applications are saved so you don't need to load every ADSL application manually. When LinuxCAD starts, it loads every ADSL program mentioned in linuxcad.ads. The format of linuxcad.ads is very simple - one loadable module name per line.

Every loadable ADSL program must provide the following callbacks:

void ads_init_callback(void); - LinuxCAD calls this function when it is loading the module. Normally you have to use the code inside this module to allocate all dynamic objects and to register your functions as commands for LinuCAD.

void ads_save_callback(void);- LinuxCAD calls this function when it is about to save the current drawing. Use this function to save any persistent information besides the current drawing, that your application might manage.

void ads_exit_callback(void); Before returning control to the Operating System, LinuxCAD calls this callback for every loaded application. This is a good place to free dynamic memory or close files.

Besides the three functions above, LinuxCAD has a number of other functions which the loadable application program can use to your advantage. All ADSL function definitions are located in the header file linuxcad_c_exposed.h . You must include this header file in your ADSL applications. The most important ADSL function is ads_add_command_to_LinuxCAD . This function has a command name as the first parameter and a pointer to the function of type void()(void) which executes the command. Every command you add to LinuxCAD takes no arguments and returns no result. Everything the command needs, it can obtain by calling on another function or by talking to user by using the mouse pointer and the command line.

When programming in the LinuxCAD ADSL environment, the programmer operates using the following objects:

  • Entities, or graphics objects in the drawing, are represented by opaque data type DwgObj.
  • Entity Sets are sets of graphics objects that ARE NOT memebers of the drawing but may be added to it. Some ADS API commands may affect the Entity Sets by performing a uniform operation on all member objects. SelSet - is the opaque data type for Entity Sets. The Entity Sets may be added to the drawing or destroyed when you done with them, they can be viewed also.
  • Pick Sets are sets of graphics objects that ARE memebers of the drawing, a Pick Set can be always converted to an Entity Set but the opposite is not true. PickSet - is the opaque data type for Pick Sets. Pick Set may be obtained only by function ads_get_entities. Only one Pick Set may be active during entire execution time of any ADSL program. You can not retain the pickset between invokations of your commands.
  • Colors which are regular integers (int)- are 32 bit. LinuxCAD uses 4 lower bits to code fixed colors that are simlar to AutoCAD fixed colors 8 colors: BLACK, RED, YELLOW, GREEN, CYAN, BLUE, MAGENTA, WHITE, LIGHTRED, GREY. As you may know, LinuxCAD supports RGB colors allowing 8 bits per color so that every color of the RGB palette can have up to 256 levels of intensity in LinuxCAD. The 8 bit RGB values use the remaining parts of the 32 bit color value. A special ADSL function ads_create_color_from_rgb exists to create proper LinuxCAD color number from RGB.
  • Points - points are arrays of the following type: double[3] Points are passed to and from functions as double*. They may be dynamically allocated as (double*)malloc( sizeof(double) * 3 );. Many LinuxCAD commands take 2D points, even in this case it is recommended to set third number to zero. For the 3D API calls the third number in point array must always contain Z coordinate.
  • Scalar values, such as lengths and angles, have data type double .


8.2 ADSL Functions Reference.


Function to check the entity type

int ads_is_line( DwgObj *in_obj );
int ads_is_solid( DwgObj *in_obj );
int ads_is_point( DwgObj *in_obj );
int ads_is_circle( DwgObj *in_obj );
int ads_is_trace( DwgObj *in_obj );
int ads_is_ellipse( DwgObj *in_obj );
int ads_is_arc( DwgObj *in_obj );
int ads_is_doughnut( DwgObj *in_obj );
int ads_is_text( DwgObj *in_obj );
int ads_is_pline_vec( DwgObj *in_obj );
int ads_is_spline2D( DwgObj *in_obj );

The functions above return 1 only if the graphics object in_obj has the type specified in the respective function name.

Sometimes you may want to do a switch branching depending on the type of the LinuxCAD drawing objects you are dealing with. In this case you may use the following function:

int ads_get_dwgobj_id( DwgObj *in_obj );

LinuxCAD ADSL defines constants prefixed by ADS_DWGOBJ_ID_... that you may use to check the actual object type against the return value of the ads_get_dwgobj_id



get... functions are for getting user input.

int* ads_get_int( int *int_dflt_value, char* in_prompt );
double* ads_get_double( double *double_dflt_value, char* in_prompt );
char* ads_get_string( char* string_dflt_value, char* in_prompt );
double* ads_get_point2D( double *in_pnt_base , char* in_prompt );
DwgObj* ads_get_entity( char* in_prompt );
PickSet* ads_get_entities( char* in_prompt );
char* ads_get_kword( char* in_prompt, ... );

The second parameter of all three functions is the prompt to the user. The prompt appears in the command line of LinuxCAD. The first parameter is the pointer to default value. This can be NULL if you do not want to supply a default value.

Usually, the user can either enter what needs to be entered or a user may refuse to do so by pressing the Right Mouse button. If the value is or has been entered, it will be returned as a result of the function. You will assume the ownership of the value since the program has received it and you can then free the memory when you are done using the returned value. You should always check whether you received NULL instead of a valid pointer to a value. When you receive NULL, that usually means the user wants to stop your application. You have to exit the program and return control to the LinuxCAD pull down menu.

  For Instance:
  =============
         double *height ;
         height = ads_get_double( NULL, "Bar height:" );
         if ( height == NULL  )
         {
             ads_prompt( "Command aborted." ); 
             return ;
         };
ads_get_kword function accepts a variable length argument list. Every argument must be of the type char*. The last argument in a list must be NULL.


ads_prompt function

void ads_prompt( char* in_message_for_command_line );
Prints an informational message in the command line. User will not have to reply to a message or even press OK.


..._icon_menu functions

There are two functions displaying so called "Icon menus" which is an array of small pictures or pictograms. Both functions display menus on multiple pages. They work similarly but take different parameters. They both take "menu format" argument , slide library name argument, and menu title argument. Before you display the icon menu, you must prepare the slide library. Slide libraries (.SLB files) are the files which contain multiple slide files (.SLD) as members. You can create slides using the command MSLIDE of LinuxCAD. You can view slides using command VSLIDE and you can create a slide library with the SLIDELIB command of LinuxCAD.

char* ads_display_modal_icon_menu(        
                          char *NX_x_NY_menu_format,
                          char *in_slb_filepath, 
                          char* in_menu_title,
                          ...
);

Brings on the screen menu of the specified format. It takes slides from in_slb_filepath. The names of the slides follow in_menu_title argument. There can be many of them but all of type char* and the last slide name must have a NULL value.

 
char* ads_displ_mod_slb_icon_menu(        
                          char *NX_x_NY_menu_format,
                          char *in_slb_filepath,
                          char* in_menu_title 
);

Brings on the screen menu of the specified format. All slides of the specified library (in_slb_filepath) will be included in this screen menu. For all of these functions, possible values of the NX_x_NY_menu_format argument are: "2x2", "2x3", "3x3", 3x4", 4x4", ... etc.

char* ads_browse_blocklib_and_insert( char *in_blocklib_name,
                                      char *NX_x_NY_menu_format ,
                                      char* in_menu_title  );

This function does somewhat complex processing. It opens a block library and conducts dialogs with the user. During the dialog, the user will have a chance to pick the block he or she wants from an attractive icon menu. What is block library? Block library in LinuxCAD consists of two files: the slide library and the drawing archive. The slide library is a collection of viewable but not editable slides. These slides are actually the pictures you see in the icon menu. The Drawing archive has basically the same internal format as slide library, but its members are gzip-ed LinuxCAD drawings. For every slide with name X there should be a corresponding member or a drawing archive with name X. The ads_browse_blocklib_and_insert function returns NULL if the user canceled, if the block does not exist or the block name if everything went OK. If it returns successfully, that means it is garanteed that the block with the specified name exists in the current drawing in the local block table. The function will actually extract blocks from the library and insert them in the local block table of the drawing. If the function returns a non-NULL character pointer, the caller must free it when done.



Environment setup and query functions.

void ads_set_entmke_layer( int in_layer );
void ads_set_entmke_color( int in_color );
void ads_set_entmke_rgb_color( int in_red , int in_green , int in_blue );
void ads_set_entmke_ltype( int in_linetype );

int ads_get_entmke_layer();
int ads_get_entmke_color();
int ads_get_entmke_ltype();

Besides operating system environment your ADSL program runs also in LinuxCAD environment. The LinuxCAD environment consists of several variables that affect the user process and also the ADSL programs. Some of the environment parameters are color, linetype and layer of newly created objects. The functions prototyped above are for setting and querying such LinuxCAD environment parameters. Some other of LinuxCAD environment parameters are: circumference , trace width, chamfer distance, fillet radius and many others. Most of LinuxCAd environment parameters are not exposed to ADSL developers at this time but they can be exposed very easily by Software Forge Inc. when the specific need will arise or upon request from LinuxCAd application developers.



Object creation functions.


The following functions create objects in the drawing. As you can see below, there are two types of object creation functions. The ones sufixed with letter P allow you to specify properties such as color, linetype and layer. Object creation functions without P as a suffix use the current drawing editor parameters to obtain entity creation properties.

DwgObj* ads_mkeLineP( double *in_p1 , double *in_p2 , 
                      int in_color , int in_linetype , int in_layer ); 
DwgObj* ads_mkeSolidP( double *in_p1 , double *in_p2 , double *in_p3 ,
                       int in_color , int  in_layer );
DwgObj* ads_mkePointP( double *in_p ,
                       int in_color , int  in_layer );
DwgObj* ads_mkeCircleP(  double *in_p_center , double inR ,
                         int in_color , int  in_layer );
DwgObj* ads_mkeTraceP(  double *in_p1 , double *in_p2 , double in_TraceWidth ,
                        int in_color , int  in_layer );
DwgObj* ads_mkeEllipseP(  double *in_p_center , double in_rot_ang ,
                          double in_a , double in_b ,
                          int in_color , int  in_layer );
DwgObj* ads_mkeEllipseArcP(  double *in_p_center , double in_rot_ang ,
                             double in_a , double in_b ,
                             double from_arc_ang ,
                             double to_arc_ang ,
                             int in_color , int  in_layer );
DwgObj* ads_mkeDonutP( double *in_p_center , double in_Din , double in_Dout ,
                       int in_color , int  in_layer );
DwgObj* ads_mkeTextP(  double *in_start_p , double in_H ,
                       char *in_text , double in_Rot_ANG , double in_Mult_X ,
                       int in_color , int  in_layer );
DwgObj* ads_mkeSpline2DP( int in_color , int  in_layer , ...
                            /* double *in_p_vertex , ... */
                            /* variable list of arguments of the double* follows */
                            /* this vertex list should be terminated by NULL pointer */
        );


DwgObj*     ads_mkeLine( double *in_p1 , double *in_p2  );
DwgObj*     ads_mkeSolid( double *in_p1 , double *in_p2 , double *in_p3  );
DwgObj*     ads_mkePoint( double *in_p  );
DwgObj*     ads_mkeCircle( double *in_p_center , double inR  );
DwgObj*     ads_mkeTrace( double *in_p1 , double *in_p2 , 
                          double in_TraceWidth  );
DwgObj*     ads_mkeEllipse( double *in_p_center , double in_rot_ang ,
                            double in_a , double in_b  );
DwgObj*     ads_mkeEllipseArc( double *in_p_center , double in_rot_ang ,
                               double in_a , double in_b ,
                               double from_arc_ang ,
                               double to_arc_ang  );
DwgObj*     ads_mkeDonut( double *in_p_center , double in_Din , double in_Dout );
DwgObj*     ads_mkeText( double *in_start_p , double in_H ,
                         char *in_text , double in_Rot_ANG , double in_Mult_X  );
DwgObj*     ads_mkeTextCen( double *in_text_center_p , double in_H ,
                            char *in_text , 
                            double in_Rot_ANG , double in_Mult_X  );

Some times it is more convenient to create an object in the background first, without immediatly inserting it in the drawing. To do this, use ads_create... functions.

Create functions have the following prototypes:

DwgObj*     ads_createLine( double *in_p1 , double *in_p2  );
DwgObj*     ads_createSolid( double *in_p1 , double *in_p2 , double *in_p3 );
DwgObj*     ads_createPoint( double *in_p  );
DwgObj*     ads_createCircle( double *in_p_center , double inR  );
DwgObj*     ads_createTrace( double *in_p1 , double *in_p2 , 
                             double in_TraceWidth  );
DwgObj*     ads_createEllipse( double *in_p_center , double in_rot_ang ,
                               double in_a , double in_b  );
DwgObj*     ads_createEllipseArc( double *in_p_center , double in_rot_ang ,
                                  double in_a , double in_b ,
                                  double from_arc_ang ,
                                  double to_arc_ang  );
DwgObj*     ads_createDonut( double *in_p_center , 
                             double in_Din , double in_Dout );
DwgObj*     ads_createText( double *in_start_p , double in_H ,
                            char *in_text , double in_Rot_ANG , 
                            double in_Mult_X  );
DwgObj*     ads_createTextCen( double *in_text_center_p , double in_H ,
                               char *in_text , 
                               double in_Rot_ANG , 
                               double in_Mult_X  );



Rubberbanding functions.

One of the especially attractive and user friendly approaches to our CAD user interface design is the dynamic completion of the command while the user drags the mouse. It allows you, the user to see what the shape of the object will be after you enter the final point. In the simplest case, when creating a line for example, the picture resembles a rubberband from the last point to the current expected point. That is why this dynamic effect is called rubberbanding. It allows you to preview the command while it is pending and before you enter it.

LinuxCAD ADS provides two functions to support rubberbanding.

   void ads_create_rubberband_context( 
         void (*in_redrawing_xor_function)(double *in_pointer_wcs_location )
   );
   void ads_free_rubberband_context(void);
 

To use them, the programmer must provide a preview function ( redrawing_xor_function ) that takes only one point argument to recalculate the previewed graphics objects. We recommned that you use global static variables to pass any additional information to the redrawing_xor_function.

To activate the sliding preview of objects produced in redrawing_xor_function function one has to request that the user enter a point using ads_get_point2D_rb function call.


double* ads_get_point2D_rb( double *in_pnt_base  , char* in_prompt );

Unusually, theads_get_point2D , ads_get_point2D_rb calls redrawing_xor_function upon every move of the mouse.

When you have finished your rubberbanding and obtained the final input from the user, use the ads_free_rubberband_context function to untie callback and free LinuxCAD resources. The ads_uml.cpp sample LinuxCAD ADS program provides excellent examples of the useage of rubberbanding.




Raw display access API.

LinuxCAD provides a simplified graphics device interface, API for its main window. The prototypes of the display API functions are:

void ads_gdi_setcolor_rgb( int in_red_0_to_256 , 
                           int in_green_0_to_256 , 
                           int in_blue_0_to_256 );

void ads_gdi_setcolor_fixed( int in_ega_pallette_color );

void ads_gdi_putpixel( int in_x , int in_y );
void ads_gdi_putpixel_2( int in_x , int in_y );

void ads_gdi_line( int in_x1 , int in_y1 , int in_x2 , int in_y2 );
void ads_gdi_line_2( int in_x1 , int in_y1 , int in_x2 , int in_y2 );

void ads_gdi_bar( int in_x1 , int in_y1 , int in_x2 , int in_y2 );
void ads_gdi_bar_2( int in_x1 , int in_y1 , int in_x2 , int in_y2 );

void ads_gdi_set_solid_line(void);
void ads_gdi_set_xor_writemode(void);
void ads_gdi_set_copy_writemode(void);
void ads_gdi_set_dashed_line(void);

void ads_gdi_set_allscreen_viewport(void);
  
void ads_gdi_clearviewport(void);

void ads_gdi_setfont_Small(void);
void ads_gdi_setfont_Medium(void);
void ads_gdi_setfont_Big(void);

void  ads_gdi_moveto( int in_x , int in_y );
void  ads_gdi_outtext( char *str );
short ads_gdi_textwidth( char *str );
short ads_gdi_textheight( char *str );

The objects created by ..._dsp_ style functions are neither scalable, nor constant in the drawing. They can be used only for drawing on transient objects such as a system independent GUI which will work entirely within main LinuxCAD window, banners and logos, various progress bars, and animation. Rendering, although for rendering as such some form of persistence still would very desirable.

Functions ads_gdi_bar,ads_gdi_line,ads_gdi_putpixel accept coordinates where the Y coordinate origin is in top left corner of the display.

Functions ads_gdi_bar_2,ads_gdi_line_2,ads_gdi_putpixel_2 accept coordinates where the Y coordinate origin is in the bottom left corner of the display.




Entity data access API.

LinuxCAD provides you with the ability to extract and change any of the properties or attributes of any LinuxCAD drawing objects. There are things that are common between all drawing objects for example: color or line type. These are properties. Properties can be modified by the LinuxCAD user level command CHPROP. Every drawing object has also specific attributes that belong only to this object as a type. An example of such attributes would be: radius of a circle or first point of a line or width of the trace. These so called attributes of drawing objects can be modified by user level CHANGE command. Please open LinuxCAD now and practise to use CHANGE command, it is important for understanding of further explanation.

Here are the prototypes of the three functions that exist to read by drawing objects properties:

int ads_extract_color( DwgObj *in_obj );
char* ads_extract_layer( DwgObj *in_obj );
char* ads_extract_linetype( DwgObj *in_obj );

When using two functions above , please free the character pointer returned to you to avoid memory leaks.


And here are the functions to modify properties of drawing objects:

void ads_change_color( DwgObj *in_obj , int new_fixed_color );
void ads_change_rgb_color( DwgObj *in_obj , int new_red , int new_green , int new_blue );
void ads_change_layer( DwgObj *in_obj , char *in_layer_name );
void ads_change_linetype( DwgObj *in_obj , char *in_linetype_name );


The attributes that are specific to different LinuxCAD object types may be extracted from drawing objects and stored back using the set of ADSL functions below:

int ads_query_type( DwgObj *in_obj , char* in_change_command_tag );

int ads_extract_point( DwgObj *in_obj , char* in_change_command_tag , double *out_point_value );
int ads_extract_double( DwgObj *in_obj , char* in_change_command_tag , double *out_value );
int ads_extract_int( DwgObj *in_obj , char* in_change_command_tag , int *out_int );
int ads_extract_string( DwgObj *in_obj , char* in_change_command_tag , char **out_int );

int ads_change_point( DwgObj *in_obj , char* in_change_command_tag , double *in_new_point_value );
int ads_change_double( DwgObj *in_obj , char* in_change_command_tag , double in_new_value );
int ads_change_int( DwgObj *in_obj , char* in_change_command_tag , int in_new_value );
int ads_change_string( DwgObj *in_obj , char* in_change_command_tag , char *in_new_value );

Drawing object attributes differ by data type. They can be either points or real numbers or integers or strings. In the lists above you see separate C functions to modify or extract drawing object properties of every different data type. Usually you will know or have a good guess what is the type of the LinuxCAD object property you are after. But in some cases you may use the ads_query_type function to find out. The first argument of all functions above is a drawing object itself and the second argument is a change command name for an attribute. When you run a change command for example to change an ARC object you will see something like:

          Command:change
          Select object to change:4.997667,5.724584
          Found 1 object!
          What to change ? <CENTER/RADIUS/START_ANGLE/END_ANGLE/>:
The keywords that you see after "What to change ?" are change command tags, so you have to give one of those as the second argument to ads_extract_... or ads_extract_... functions. Besides that another thing to remeber about ads_extract_string function is that it returns newly allocated string in the pointer supplied by you. Therefore you will have to free that string later.




ADSL Command functions.

The commands you define using ads_add_command_to_LinuxCAD can run other LinuxCAD commands within themselves. Sometimes it will not work and LinuxCAD will crash but usually does work. Functions thet we discuss in this chapter are the ones you will use to simulate input from the user and initiate LinuxCAD commands from within your ADSL function.

void ads_command( char* in_command_string );
void ads_command_ent( DwgObj* in_entity );
void ads_command_real( double in_real );
void ads_command_int( int in_int );
void ads_command_sset( SelSet in_selection_set );
void ads_command_pause();
void ads_command_nil();
void ads_command_pnt2d( double* in_point );

ads_command starts LinuxCAD command as it would be enetered by user. You should realize that the minute you do this your ADSL program does not loose control and the user does not receive it either. You program continues to run like nothing happened. Actually the only change will be that you will see in the command line that LinuxCAD started a new command, the first message from the corresponding command will show up. For instance you will see "From point:" message after you have done ads_command( "LINE" ); Now you have a choice either respond to the message from your program by one of the functions: ads_command_ent , ads_command_real , ads_command_int , ads_command_sset , ads_command_nil , ads_command_pnt2d or pass the actual control to the user just for a little while using ads_command_pause function.

ads_command_ent submits entity to the LinuxCAD command, the same way as it would be entered by user.

ads_command_real submits real number to the LinuxCAD command, the same way as it would be entered by user.

ads_command_int submits integer number to the LinuxCAD command, the same way as it would be entered by user.

ads_command_nil submits Nil to the LinuxCAD command, the same way as it would be entered by user, Nil will cause most of the command to abort or to finish. If there is no command active the Nil will cause LinuxCAD to repeatedly initialize last succesfull command.

ads_command_pnt2d submits 2D point to the LinuxCAD command, same way as it would be entered by user.

ads_command_pause gives control to the user and lets him or her enter only one value whether it is point , number , or drawing object. Whatever LinuxCAD command is now serving the User will be able to enter but then the control will be passed again back to your program.



8.3 ADSL Sample Programs.

LinuxCAD comes with several sample ADSL programs that can be used to learn ADSL by programmers new to LinuxCAD. This chapters will help you understand the included sample programs. None of these programs are meant to be used for anything practically useful, they are just samples demonstrating the proper usage of many function calls available in ADSL. Sample programs and all ADSL related stuff located in the subdirectory /usr/linuxcad/ads. Lets recall thatonly dynamically build LinuxCAD allows loading ADSL applications. These days ( since version 2.27 ) LinuxCAD always comes with two executables builds. linuxcad executable is a static one, it will run at any Linux including probably a.out. It is included here only for compatibility purposes , so we at least can be sure that you'll get some LinuxCAD working. The static build allows all normal LinuxCAD commands including even AutoLisp. It has no limitations besides one (!). The static build can not load ADSL programs. To load ADSL programs you need to use dynamic build. The file name for dynamic build is linuxcad_dynamic. At this time we deliver dynamic build only for a single Linux brand. The very one on which we are developing LinuxCAD on. And that is RedHat 6.0 ( or Linux 2.2.5-15smp ). The dynamic build is guaranteed to work on only that Linux distribution. It is up to the user and his computing expertise to adopt dynamic build of LinuxCAD to work on your system. Some LD_LIBRARY_PATH tweaking may help, but not in every case. The special build of LinuxCAD may be done for you, and usually that will involve an extra charge. Also for sample ADSL programs to load automatically you need to have special lines in your linuxcad.ads file. These lines are:

           /usr/linuxcad/ads/adsl_cmd.so
           /usr/linuxcad/ads/aa.so
           /usr/linuxcad/ads/adsl_text_query_examp.so
           /usr/linuxcad/ads/adsl_rband.so
 
Every shared library listed in linuxcad.ads file is assumed to be an ADSL program and is loaded automatically by LinuxCAD.

Lets pretend that you are working on RedHAt 6.0 or any other compatible system. Start the dynamic build of LinuxCAD using the following command:

                  linuxcad_dynamic columbia.dxs
             
If everything is working properly and all ADSL sample programs have been loaded, you will these messages:
LinuxCAD ( or Freedom*Of*Choice*CAD ) v 2.27, Standard Edition.
Copyright (C)1998,1999,2000 Software Forge Inc. All rights reserved.
http://www.linuxcad.com , http://www.softwareforge.com
Loading ...
This machine uses "Intel" byte order.
BARCHART registered.
PULSEZOOM registered.
CMD registered.
OFFS registered.
PIECHART registered.
SFLOGO registered.
/usr/linuxcad/ads/adsl_cmd.so initialized.
LOGO DESIGN tool registered ('DT').
/usr/linuxcad/ads/ads_text_bycircle.so initialized.
QUERY_TEXT from ADS sample program  adsl_text_query_examp  registered.
/usr/linuxcad/ads/adsl_text_query_examp.so initialized.
"DXS" format detected.

If you see the messages above, then you can start trying the new commands exported by the ADSL applications adsl_cmd.so , ads_text_bycircle.so , adsl_text_query_examp.so .

Sample program adsl_cmd.cpp

When loaded the adsl_cmd.cpp defines several LinuxCAD commands , they are: BARCHART, PULSEZOOM, OFFS, CMD, SFLOGO. Type names of those commands in the LinuxCAD command line and see what each command does.

BARCHART - shows how dialog with user can be organized from ADSL program. Open file /usr/linuxcad/ads/adsl_cmd.cpp and search for the body of void sample_new_command(void) function. This is the function that implements BARCHART command. It uses ads_prompt function to post messages to command line. It uses ads_get_int to read an integer number from the user and it uses ads_get_kword to let user make a choice from two possible keywords. Please note that the pointer returned from ads_get_kword is later deleted using C-language free function. Further you program asks user to enter point using ads_get_point2D function.

SFLOGO - command is implemented by void sflogo_command(void) function from the same /usr/linuxcad/ads/adsl_cmd.cpp file. The SFLOGO command shows how the ADSL programmer can use LinuxCAD ADS Graphics Device Interface functions to draw on the LinuxCAD drawing area in a platform independent way.

CMD - command implemented by function void yetanother_cmd_func(void) shows a nice example of ADSL command functions( see chapter above ) in action. Please open the /usr/linuxcad/ads/adsl_cmd.cpp file , find the yetanother_cmd_func and follow the code. You'll see that the program asks user to enter point. Then it calculates the corner points of a cross. Then it gets more interesting, ADSL program submits the command back to LinuxCAD using ads_command function. It dispatches to LinuxCAD color change command first and then it creates complex trace command that includes coordinates of points and sends it to LinuxCAD for execution. It is obvious that the last object in the drawing is now the one created last , so we can store it to the e1 variable using ads_entlast function. More interesting is the last part, after initiating an ERASE command the program sends drawing objects back to the LinuxCAD command line. The later done by ads_command_ent function. And finally the ads_command_nil function is used to repeat the last command. In this case it is the CMD command itself. The commands that you run within are not counted.

PULSEZOOM - this sample command is very simple , it just demonstrates that it is possible to change current view very easily from within ADSL program. The command uses standard UNIX function sleep to delay its execution on one second between view changes.


Sample program adsl_text_query_examp.cpp

QUERY_TEXT - this command is defined within the adsl_text_query_examp.cpp source file in LinuxCAD ADS directory. The programs shows a way to access and modify drawing object parameters. Most of the text of adsl_text_query_examp.cpp program is listed below. The line numbers are written for every line so we can explain all important steps that program does.

The program text.

1: #include <stdio.h>
2: #include <stdlib.h>
3: #include <string.h>
4: #include <math.h>
5:
6: #include "linuxcad_c_exposed.h"
7:
8: void query_text(void)
9: {
10:DwgObj *selected_entity ;
11:selected_entity = ads_get_entity( "Please select text object:" );
12:if ( !ads_is_text( selected_entity ) )
13:{
14:ads_prompt( "This is not a text object. Aborting the command ..." );
15:return ;
16:};
17:
18:double height ;
19:double rotation_angle ;
20:double width_coefficient ;
21:char* the_text ;
22:double start_point[3] ;
23:
24:ads_extract_double( selected_entity , "HEIGHT" , &height );
25:ads_extract_double( selected_entity , "ROTATION_ANGLE" , &rotation_angle );
26:ads_extract_double( selected_entity , "WIDTH_COEFFICIENT" , &width_coefficient );
27:ads_extract_string( selected_entity , "TEXT_STRING" , &the_text );
28:ads_extract_point( selected_entity , "START_POINT" , start_point );
29:
30:ads_print_double( "Text height" , height );
31:ads_print_double( "Text Rotation Angle" , rotation_angle );
32:ads_print_double( "Text Width Coefficient" , width_coefficient );
33:ads_print_string( "The Text Sting" , the_text );
34:ads_print_point( "Text Start Point" , start_point );
35:
36:rotation_angle = 45.00 ;
37:ads_string_toupper( the_text );
38:start_point[_X_] = start_point[_X_] = + 2.0 ;
39:start_point[_Y_] = start_point[_Y_] = + 2.0 ;
40:
41:ads_change_double( selected_entity , "ROTATION_ANGLE" , rotation_angle );
42:ads_change_string( selected_entity , "TEXT_STRING" , the_text );
43:ads_change_string( selected_entity , "TEXT_STRING" , the_text );
44:ads_change_point( selected_entity , "START_POINT" , start_point );
45:
46:free( the_text );
47:ads_prompt( "Done. Ok." );
48: }
49:
50:
51: #ifdef __cplusplus
52: extern "C"
53: #endif
54: void ads_init_callback(void)
55: {
56:ads_add_command_to_LinuxCAD( "QUERY_TEXT" , &query_text );
57:ads_prompt( "QUERY_TEXT from ADS sample program adsl_text_query_examp registered." );
58: }

Please note on line 6 , the inclusion of the linuxcad_c_exposed.h header file. Line 56 tell LinuxCAD to invoke function query_text when the user enters QUERY_TEXT command. On line 11 program gets drawing object by allowing the user to select it with a mouse. Further on line 12; the program verifies whether the selected object is text. Lines 24 to 28 extract the internal attributes of the text object. Then ADSL print utility functions used to print extracted values in the LinuxCAD command line. Further the program modifies the attributest of a text on lines 36 through 39. Like when the rotation angle is being set to 45 degrees , text data converted to uppecase and start point moved. New modified attribute values store back to the original text object using ads_change_... functions on lines 41-44 .


Sample program adsl_rband.cpp

This program shows how to use LinuxCAD rubberbanding functions and LinuxCAD SelSets. The program defines a new LinuxCAD command DRAW3DBOX. As the name implies the new command creates several lines in a way that they are together perceived by the obverser as a 3D object.

The program text.
1:
2: #include <stdio.h>
3: #include <stdlib.h>
4: #include <string.h>
5: #include <math.h>
6:
7: #include "linuxcad_c_exposed.h"
8:
9: #define RELATIVITY_BASE_DISTANCE 25.0
10: #define RELATIVE_STAIRSTEP 1.5
11: #define SHADOWBOX_RELATIVE_STAIRSTEP 3.5
12:
13: class point2D
14: {
15: private:
16: double X ;
17: double Y ;
18: public:
19: point2D() { X = 0 ; Y = 0 ; };
20: ~point2D();
21: void setpoint2D( double in_x , double in_y )
22: {
23: X = in_x ; Y = in_y ;
24: };
25: double x() { return( X ); };
26: double y() { return( Y ); };
27: };
28:
29: static void swap_points_xy_to_max_min( point2D *in_p_out_p_min , point2D *in_p_out_p_max )
30: {
31: double xmin , ymin , xmax , ymax ;
32:
33: xmin = (*in_p_out_p_min).x();
34: ymin = (*in_p_out_p_min).y();
35: if ( xmin > (*in_p_out_p_max).x() ) xmin = (*in_p_out_p_max).x();
36: if ( ymin > (*in_p_out_p_max).y() ) ymin = (*in_p_out_p_max).y();
37:
38: xmax = (*in_p_out_p_min).x();
39: ymax = (*in_p_out_p_min).y();
40: if ( xmax < (*in_p_out_p_max).x() ) xmax = (*in_p_out_p_max).x();
41: if ( ymax < (*in_p_out_p_max).y() ) ymax = (*in_p_out_p_max).y();
42:
43: (*in_p_out_p_min).setpoint2D( xmin , ymin );
44: (*in_p_out_p_max).setpoint2D( xmax , ymax );
45: }
46:
47: static double *local_arrow_start_p ;
48: static SelSet* (*local_object_generator_function)( double *in_p_begin , double *in_p_next );
49: static void box_generic_xorview_function( double *in_drag_point )
50: {
51: double bp[3] ;
52: ads_pset( bp , 0.0 , 0.0 );
53: SelSet* tmp ;
54: tmp = (*local_object_generator_function)( local_arrow_start_p , in_drag_point );
55: ads_move_SelSet( tmp , bp , local_arrow_start_p );
56: ads_xorview_SelSet( tmp );
57: ads_free_SelSet( tmp );
58: }
59: static void box_generic_freeze_function( double *in_drag_point )
60: {
61: double bp[3] ;
62: ads_pset( bp , 0.0 , 0.0 );
63: SelSet* tmp ;
64: tmp = (*local_object_generator_function)( local_arrow_start_p , in_drag_point );
65: ads_move_SelSet( tmp , bp , local_arrow_start_p );
66: ads_setcolor_SelSet( tmp , ads_get_entmke_color() );
67: ads_setlayer_SelSet( tmp , ads_get_entmke_layer() );
68: ads_freeze_SelSet( tmp );
69: ads_free_SelSet( tmp );
70: }
71:
72:
73: static void box_processor_and_placer( SelSet* (*object_generator_function)( double *in_p_begin , double *in_p_next ) )
74: {
75: local_arrow_start_p = ads_get_point2D( NULL , "Enter first point:" );
76: if ( local_arrow_start_p == NULL )
77: {
78: ads_prompt( "Command aborted." );
79: return ;
80: };
81:
82: rept: ;
83:
84: local_object_generator_function = object_generator_function ;
85: ads_create_rubberband_context( &box_generic_xorview_function );
86:
87: double *end_point ;
88: end_point = ads_get_point2D_rb( local_arrow_start_p , "Enter second point:" );
90: if ( end_point == NULL )
91: {
92: free( local_arrow_start_p );
93: ads_prompt( "Command aborted." );
94: return ;
95: };
96:
97: box_generic_freeze_function( end_point );
98:
99: ads_free_rubberband_context();
100:
101: free( local_arrow_start_p );
102: free( end_point );
103: }
104:
105:
106: SelSet* uml_box3D_object_generator( double *in_p_begin , double *in_p_next )
107: {
108: point2D p_min ;
109: point2D p_max ;
110:
111: p_min.setpoint2D( in_p_begin[0] , in_p_begin[1] );
112: p_max.setpoint2D( in_p_next[0] , in_p_next[1] );
113:
114: swap_points_xy_to_max_min( &p_min , &p_max );
115:
116: double dist_X , dist_Y , dist_min , d_step ;
117: dist_X = p_max.x() - p_min.x();
118: dist_Y = p_max.y() - p_min.y();
119: dist_min = dist_X ;
120: if ( dist_min > dist_Y ) dist_min = dist_Y ;
121: d_step = ( dist_min / RELATIVITY_BASE_DISTANCE ) * RELATIVE_STAIRSTEP ;
122:
123: point2D p1 , p2 , p3 , p4 , p5 , p6 , p7 , p8 , p9 , p10 ;
124: point2D p11 , p12 , p100 , p101 ;
125: double p1s[3] , p2s[3] , p3s[3] , p4s[3] , p5s[3] , p6s[3] , p7s[3] , p8s[3] , p9s[3] , p10s[3] ;
126: double p11s[3] , p12s[3] , p100s[3] , p101s[3] ;
127:
128: p1.setpoint2D( 0.0 , 0.0 );
129: p2.setpoint2D( p1.x() + dist_X , p1.y() );
130: p7.setpoint2D( p1.x() + dist_X , p1.y() - dist_Y );
131: p8.setpoint2D( p1.x() , p1.y() - dist_Y );
132:
133: p3.setpoint2D( p2.x() + d_step , p2.y() - d_step );
134: p4.setpoint2D( p3.x() + d_step , p3.y() - d_step );
135:
136: p9.setpoint2D( p8.x() + d_step , p8.y() - d_step );
137: p10.setpoint2D( p9.x() + d_step , p9.y() - d_step );
138:
139: p6.setpoint2D( p7.x() + d_step , p7.y() - d_step );
140: p5.setpoint2D( p6.x() + d_step , p6.y() - d_step );
141:
142: p11.setpoint2D( p3.x() - d_step , p3.y() );
143: p12.setpoint2D( p4.x() - d_step , p4.y() );
144:
145: p100.setpoint2D( p9.x() , p9.y() + d_step );
146: p101.setpoint2D( p10.x() , p10.y() + d_step );
147:
148: ads_pset( p1s , p1.x() , p1.y() );
149: ads_pset( p2s , p2.x() , p2.y() );
150: ads_pset( p2s , p2.x() , p2.y() );
151: ads_pset( p3s , p3.x() , p3.y() );
152: ads_pset( p4s , p4.x() , p4.y() );
153: ads_pset( p5s , p5.x() , p5.y() );
154: ads_pset( p6s , p6.x() , p6.y() );
155: ads_pset( p7s , p7.x() , p7.y() );
156: ads_pset( p8s , p8.x() , p8.y() );
157: ads_pset( p9s , p9.x() , p9.y() );
158: ads_pset( p10s , p10.x() , p10.y() );
159:
160: ads_pset( p11s , p11.x() , p11.y() );
161: ads_pset( p12s , p12.x() , p12.y() );
162: ads_pset( p100s , p100.x() , p100.y() );
163: ads_pset( p101s , p101.x() , p101.y() );
164:
165: SelSet* tmp_sset ;
166: tmp_sset = ads_create_SelSet();
167:
168: ads_ssadd_SelSet( tmp_sset , ads_createLine( p1s , p2s ) );
169: ads_ssadd_SelSet( tmp_sset , ads_createLine( p2s , p7s ) );
170: ads_ssadd_SelSet( tmp_sset , ads_createLine( p7s , p8s ) );
171: ads_ssadd_SelSet( tmp_sset , ads_createLine( p8s , p1s ) );
172:
173: ads_ssadd_SelSet( tmp_sset , ads_createLine( p2s , p4s ) );
174: ads_ssadd_SelSet( tmp_sset , ads_createLine( p7s , p5s ) );
175: ads_ssadd_SelSet( tmp_sset , ads_createLine( p8s , p10s ) );
176:
177: ads_ssadd_SelSet( tmp_sset , ads_createLine( p4s , p5s ) );
178: ads_ssadd_SelSet( tmp_sset , ads_createLine( p5s , p10s ) );
179:
180: return( tmp_sset );
181: }
182:
183: void draw_3d_box(void)
184: {
185: box_processor_and_placer( uml_box3D_object_generator );
186: }
187:
188:
189: #ifdef __cplusplus
190: extern "C"
191: #endif
192: void ads_init_callback(void)
193: /* allocate all dynamic memory here and all other
194: initialization here, it is called after _init routine lcAPI
195: if it was defined in your .so , register any LinuxCAD
196: commands you add here
197: */
198: {
199: ads_add_command_to_LinuxCAD( "DRAW3DBOX" , &draw_3d_box );
200: ads_prompt( "New LinuxCAD command \"DRAW3DBOX\" is now available." );
201: }

draw_3d_box is the function that implements new command ( see lines 183 - 186 ). DRAW3DBOX command as we can see implemented by calling a generic placement function box_processor_and_placer.

The later is not a standard LiuxCAD function but the function implemenmted by some ADSL programmer. The text of the box_processor_and_placer occupies lines from 73 to 103. The box_processor_and_placer function has been designed so that it can now be used to draw any type of object that is fully given by two points. First the first point is picked by the user, then a rubber band like changing image of the future object appears and slides and scrolls until user fixes the second point on line 88.

Please recall ads_create_rubberband_context ADSL API Call. This ADSL call takes a single parameter - function pointer. Funtion that is specified there must draw the sliding shape of the object every time it is called, because it writes to the screen in a special XOR mode we can call it XOR-function. In our sample program box_generic_xorview_function is used as a xor function ( lines 49 - 58 ).

This xor function as you can see also is hollow. It is written in such a clever way that it can handle any type of a sliding rubber made figure. The shape definition function that is invoked via local_object_generator_function function pointer actually defines the shape of the moving image. The design contract is such that the function that local_object_generator_function function pointer points to returns an entire set of objects ( line 54 ). Once the SelSet of objects is received by box_generic_xorview_function function the later moves them into current location and displays the entire group of objects using ads_xorview_SelSet ( see line 56 ). Once objects are displayed the limited goal of the box_generic_xorview_function is accomplished and the objects returned from shape definition function are freed at the line 57.

Lets come back now to box_processor_and_placer function where we have left off. So far we know that rubber banding effect is happily on and going after we have passed line 85. Now to complete the creation of 3D box we need to ask the user for one more point, the final or freeze point. And that is what the program does at the line 88. Once again after final point is obtained the generic freezer function box_generic_freeze_function is called at the line 97.

The box_generic_freeze_function function is defined on lines 59 to 70. It's working principle is the same. It calls shape definition function indirectly via pointer. Then it moves the returned group of objects at their final location. Then it sets color and layer for all objects of the group to the values from the current LinuxCAD environment ( see lines 66 , 67 ). The most important is line 68. The ads_freeze_SelSet function of the ADSL API adds a copy of every object in specified SelSet to the drawing. Once a copy of objects has been added to the drawing itself they are no longer needed, so the objects of the SelSet and SelSet itself are freed at the line 69.

One more observation is good to make here. Lines 106 through 181 contain the code for the shape definition function specific to this type of box. If you look at the uml_box3D_object_generator function you'll see it does a bunch of trivial geometric calculations first. Then it creates the selection set to be returned ( see line 166 ) using ADSL API call ads_create_SelSet. The SelSet is populated with objects on lines 168 through 178. Please note that ADSL API calls which start from ads_create.. do not create objects in the drawing, they just return objects. Lines 168 through 178 show typical usage of ads_create.. functions. You call the function and you add the return value immediately to some sort of SelSet and process it later. An entire moving image ready to be either XOR-viewed or frozen is returned to the caller at the line 180. Now revisit line 185 and see how everything is tied together with the function call and the function parameter there.



Sample program adsl_export_text.cpp

This program implements EXPORT_TEXT command. The task at hand is to export to an external file all text objects from the one selected by the user set of objects. Let see how it is done. In fact this practically useful program was written by a member of Software Forge Inc. development staff within some 15 minutes ( including the testing ). That demonstrates what a powerful tool ADSL really is.

The program text.
1: #include <stdio.h>
2: #include <stdlib.h>
3: #include <string.h>
4: #include <math.h>
5: #include "linuxcad_c_exposed.h"
6:
7: void export_text(void)
8: {
9: char filename[2000]; char *out_fname ;
10:
11: ads_prompt( "This command will export all selected text to the external file." );
12:
13: out_fname = ads_get_string( "text.out" , "Please enter file name:" );
14: if ( out_fname == NULL )
15: {
16: ads_prompt( "Command aborted." );
17: return ;
18: };
19: ads_strcpy_safe( filename , out_fname , sizeof(filename) );
20: free( out_fname );
21:
22: SelSet* copies_of_all_objects ;
23: SelSet* copies_of_text_objects_only ;
24:
25: PickSet* all_selected_objects ;
26: all_selected_objects = ads_get_entities( "Select objects:" );
27: if ( all_selected_objects == NULL )
28: {
29: ads_prompt( "USER Error: No objects selected." );
30: ads_prompt( "Command aborted." );
31: return ;
32: };
33:
34: copies_of_all_objects = ads_duplicate_PickSet( all_selected_objects );
35: copies_of_text_objects_only = ads_create_SelSet();
36:
37: DwgObj* obj_i ;
38: int n ;
39: n = ads_SelSet_getsize( copies_of_all_objects );
40: int i;
41: for (i=0;i< n ;i++)
42: {
43: obj_i = ads_SelSet_get( copies_of_all_objects , i );
44: if ( ads_get_dwgobj_id( obj_i ) == ADS_DWGOBJ_ID_TEXT )
45: {
46: ads_ssadd_SelSet( copies_of_text_objects_only , ads_DwgObj_copy( obj_i ) );
47: };
48: };
49: ads_free_SelSet( copies_of_all_objects );
50:
51: FILE *out_f ;
52: out_f = fopen( filename , "w" );
53: if ( out_f == NULL )
54: {
55: char msg[200]; msg[0]= 0x00 ;
56: sprintf(msg,"Could not open output file: \"%s\" ." , filename );
57: ads_prompt( msg );
58: ads_prompt( "Command aborted." );
59: return ;
60: };
61:
62: n = ads_SelSet_getsize( copies_of_text_objects_only );
63: for (i=0;i< n ;i++)
64: {
65: obj_i = ads_SelSet_get( copies_of_text_objects_only , i );
66:
67: char* text_i ;
68: ads_extract_string( obj_i , "TEXT_STRING" , &text_i );
69: ads_strcat_realloc( &text_i , "\n" );
70: fwrite( text_i , strlen(text_i) , 1 , out_f ); fflush(out_f);
71: free( text_i );
72: };
73: ads_free_SelSet( copies_of_text_objects_only );
74:
75: {
76: char msg[200]; msg[0]= 0x00 ;
77: sprintf(msg,"%d lines of text was written to: \"%s\" file." , n , filename );
78: ads_prompt( msg );
79: };
80:
81: fclose(out_f);
82: }
83:
84: #ifdef __cplusplus
85: extern "C"
86: #endif
87: void ads_init_callback(void)
88: {
89: ads_add_command_to_LinuxCAD( "EXPORT_TEXT" , &export_text );
90: ads_prompt( "New LinuxCAD command \"EXPORT_TEXT\" is now available." );
91: }

The program asks the user to enter a file name. Then it copies the entered fil name from dynamically allocated memory to an automatic variable. Here it uses ADS API ads_strcpy_safe which is just an improved version of strcpy function. Then the dynamic variable is released.

On line 26 the program allows the user to select objects. Here a user can select any number of any type of objects. But we are interested only in objects of type text. After selecting objects on line 34 we create shadow copies of all selected objects with ads_duplicate_PickSet. This new SelSet now contains all copies of every object selected by the user. On line 35 the program creates a new SelSet object that will be used for storing only text objects.

ADS API function ads_SelSet_getsize on the line 39 is used to find out the total number of objects kept in the copies_of_all_objects object set. After the number of objects is known, the program loops through all objects of the copies_of_all_objects object set accessing them one by one. ADS API function ads_SelSet_get is used to access individual objects in the set. Please note instead of returning the copy of the object ads_SelSet_get returns a direct pointer to it. Therefore this pointer must not be added to any other selection set. The reason why is that every selection set owns it's objects. All selection set objects will be destroyed with the deallocation of the selection set itself. You must avoid having the same objects in two selection sets on most ocassions. A single exception from this rule may occur when ads_unbind_all_objects function is properly used to revoke the object ownership.

On line 44 the ADS API call ads_get_dwgobj_id is used to query the object id of every object. Whenever this ID says "object is text" the object is added to another selection set.

On line 49 we deallocate copies_of_all_objects object set. We no longer need it because we already copied all text objects to copies_of_text_objects_only selection set.

On lines 51 - 60 we make sure that the output file is available for writing. And starting line 62 we do another loop against all text objects we copied at the previous stage of the process. On line 68 we extract the actuall text string from a Text drawing object and then we write it to the external file.

A Grep like feature on the Text drawing objects or any other kind of search could have been implemented in a similar manner to this.






9. LinuxCAD support for symbol and part libraries.


9.1 Introduction.

In most cases, you may use Block Libraries for symbols and parts. Blocks are simple associations of the drawing objects. Blocks do not have any other parameters besides text attributes. Editing commands of LinuxCAD treat every Block as single monolithic graphics object. When you wish to create a block to put in your library you will have to:

  1. Create all objects you want to put in a block, using usual drawing commands: LINE,CIRCLE,TRACE,TEXT etc.
  2. Define attributes for the block in the top level of the current drawing. You can do attribute definition with ATTDEF command.
  3. Decide where you are going to have the base center point of the block.
  4. And finally, use the block command to unite the primitives you desire by block definition


LinuxCAD stores Block definitions in the current drawing. If you have the Block defined in the current drawing, you can insert the block an unlimited number of times and LinuxCAD will use the same prototype from the system block table for every block instance. The different block instances may have different insertion points, rotation angles and scale factors. And also the may have different attribute values. What is an attribute? Attribute is a kind of variable in the drawing or block. An attribute will have a name and a value. Attributes are useful for integration of 2D and 3D graphics to the databases. The database may store data about parts, where to order them, the amount in the inventory, warehouse number, pricing and so on. In the mean time your drawing will contain only parts numbers as attributes. The value of the attribute may change in every insertion of the block but it does not have to !!! If it has to be the same, you may define the default value for the attribute and accept it whenever you insert the block. Or you may mark the attribute as Constant.

Any DXS file and DWG file (if you have purchased DWG compatibility option) as well can be inserted as a block.

The specific feature related to LinuxCAD blocks is Block Library. Block Libraries are external files that contain multiple blocks within them. We will add several Block Library types in the future. But for now, we do only ".dxl" type Block Libraries. User can create the ".dxl" - type block libraries by using the BLOCKLIB command.

The ".dxl" block library has a similar structure to slide library but it contains binary large objects instead of slides. It is up to LinuxCAD to know that these BLOBS are actually .dxs drawings which have been gzip-ed before going into the library.

You may attach a block library to LinuxCAD by using the ATTACHLIB command. LinuxCAD will consult all attached libraries when running the INSERT command. When the required block is found in the Library, LinuxCAD will extract it and copy it to the current drawing.

LinuxCAD searches for a block in the following order:

  1. Local Block table of the current drawing.
  2. Attached Block Libraries.
  3. External Files in current directory and LinuxCAD directory.

Block libraries are unique to LinuxCAD extension. They do not exist in AutoCAD and many other CAD systems.

Block library sample_blib.dxl is included with LinuxCAD. Its members are: BOX1, BOX2, BOX3, BOX4, ARROWL, ARROWR, ARROWU, ARROWD. This library is included as a sample only. You may create libraries of your own which will be more sophisticated and applicable for your specific uses. Software Forge Inc. also will create libraries according to your requirements for an additional charge. Contact us for further information.

The directory of any .dxl library may be printed in LinuxCAD using the BLOCKLIB command, option LIST.


9.2 Commands for managing Blocks and Attributes.




BLOCK

The command creates a block from one or more existing objects and/or attribute definitions. The command can be found in menu Edit/Edit2/Create Block

 
Command:BLOCK

Block Name ( or ? ):BLK2

Insertion base point:-3.581432,15.608237

Select object:-1.536537,16.185002

Found 1 object!
Select object:1.189991,18.387197

Found 1 object!
Select object:-0.540306,13.720641

Found 1 object!
Select object:Nil

As you can see, we have created a block with name BLK2 and added three objects to the block. Using the same block command, we may display a whole list of block names in the current drawing. Do that by enetering a question mark sign instead of the block name.

Command:BLOCK

Block Name ( or ? ):?

------------------------------------------------------
The following blocks are defined:
------------------------------------------------------
A
NA
PRT
NESTED
BLK2

In the example above you see the new block name in the list. The block we have just defined - BLK2.


INSERT

Use this command to insert a block in the drawing with a specified insertion location, rotation angle and scale. The command can be found in menu Draw/Draw.../Insert

 
Command:INSERT

Block Name ( or ? ):a

Insertion point:-6.622559,18.229898

Enter scale factor:-4.944696,16.499601

Enter rotation angle:-3.686299,20.065060

Enter part number: <1>:
Enter part number: or right button to accept default:34

Command:

The last questions invite you to enter the value of some attribute. Every attribute value type prompt appears at the end of the command. When you answer all the questions, the block image appears in the drawing area. Blocks can contain other block insertions.


ATTDEF

This is the command for creating attribute definitions (Attdef-s). Usually you create attribute definitions in your current LinuxCAD drawing and then you assign them to a block later with the BLOCK command. The command can be found in menu Draw/Draw.../Attdef

 
Command:ATTDEF

Invicible:OFF  Constant:OFF, Enter I/C or RIGHT BUTTON to continue:i

Invicible:ON  Constant:OFF, Enter I/C or RIGHT BUTTON to continue:Nil

Attribute tag:ATR1

Attribute prompt:Enter attribute ATR1:

Default attribute value:A

Enter :-4.577663,10.364915

Height  <0.100000> or point to accept:-3.004667,12.042778

Rotation angle  <0.000000> or point to accept:-3.109533,13.196309

In the example above, we have defined the invisible attribute ATR1, with attribute prompt "Enter attribute ATR1:" to be displayed during related INSERT command. In this command, use letters I and C to toggle attribute flag modes between Visible and Invicible, Constant and not Constant.


EXPLODE

Replaces the block with a set of objects using block template. After separation with command EXPLODE, former members of the block loose any relationship between each other and can be moved, deleted and copied independently. The EXPLODE command will replace attributes of the block with regular text objects in the main drawing. The command can be found in menu Edit/Edit2/Explode

 
Command:EXPLODE

Select block to explode:6.433312,11.466012

Found 1 object!
It is useful to know that this command can also separate polyline to segments and it can also split a text object to separate letters. When exploding text string a number of single letter strings will be created instead.


ATTACHLIB

Binds the specified block library to the current drawing editor session so LinuxCAD will start searching for blocks being inserted there too. After a block has been inserted from the library, it is not necessary to keep the library around. The block is actually copied inside the drawing file, so the only time the library is needed is during insertion itself. That makes behavior of block libraries different from the SHX fonts, as SHX fonts have to be accessed every time you access a drawing file.

 
Command:ATTACHLIB
LinuxCAD searches blocks in attached Block Libraries first.
Attach Block Library name (extension ".dxl" is assumed):sample_blib
Library attached. OK.

Another example, here you have actually specifying path to the library, the path is rooted to LINCAD_DIR. On Windows version of LinuxCAD you can specify unix like or windows like path delimiters ( either like "libs\elect\diode" or "libs/elec/diode" is fine).

Command:attachlib  
LinuxCAD searches blocks in attached Block Libraries first.  
Attach Block Library name (extension ".dxl" is assumed):libs\elec\diode  
Library attached. OK.  

Command:insert  
Block Name ( or ? ):dioz  
Looking for local block "DIOZ".  
Looking for block "DIOZ" in all attached libraries.  
Block library member length = 673 .  
Reading block "DIOZ" from file "C:\TEMP\lcad_158_tmp_blk_dxs" .  
FILE: "C:\TEMP\lcad_158_tmp_blk_dxs" EXISTS , READING IT AS BLOCK...  
Insertion point:13.750000,10.750000  
Enter scale factor:20.500000,0.000000  
Enter rotation angle:20.000000,-0.750000  

As you saw in the examples above you must not specify extension. The ".dxl" extension is assumed and enforced for dxs.gz member type libraries.

To learn how to create LinuxCAD block libraries see the BLOCKLIB command description.

Please notice that even after attaching the library, the blocks in it will not be visible on LinuxCAD BLOCK/? command. And this is certainly inconvenient, because you need to know the block name when you inserting.

Normally when you work with an attached library you would have a list of all blocks in that library in front of you (it is assumed that blocks in library have meaningful names).

To obtain a LinuxCAD block library listing do the following:

  1. Enter command BLOCKLIB, select option LIST.
  2. Enter command HISTORY and then you will see the text window click on "Save Text".
  3. Now open linuxcad.history file using any text editor, find the output of BLOCKLIB command and cut and paste it, print it and do whatever you want with it.


PURGE

You can use command PURGE to remove unused blocks from the drawing.

   For instance:

Command:PURGE

Purge unused  (BLOCKS/LAYERS/LINETYPES/STYLES/ALL):BLOCKS

Block NEST2 is NOT used. Purging.
All unused blocks have been removed from the drawing.
Command:

Unlike in AutoCAD, this command can be used any time during the drawing editor session, and not only at the begining of work. Some things we do even better then Autodesk after all.



WBLOCK

WBLOCK command writes block to the external OS file.

   For instance:

Command:WBLOCK

Block Name ( or ? ):box1

Output file ( "box1.dxs" ).
File name to write block, or RIGHT BUTTON to accept the above:Nil

Writing block box1 to "box1.dxs".

Command:WBLOCK

Block Name ( or ? ):box1

Output file ( "box1.dxs" ).
File name to write block, or RIGHT BUTTON to accept the above:bbb.dxs

Writing block box1 to "bbb.dxs".

Any block that has been previously defined in the drawing can be written to a separate external file using WBLOCK command. As you have seen in the example above, LinuxCAD will assign the same name to the external file as name of the block. If this is not what you want, you can specify the name of your choice. The rule is: when you accept default extension DXS is assumed, when you specify another name, you have to type the extension as well.



BLOCKLIB

This command will do all you ever need to do in order to maintain the block libraries. It can create new block libraries, list blocks in existing block libraries, and browse block libraries. We must mention that for browsing you need two libraries: a block library to hold parts to be inserted and a slide library so you can browse them in icon menus. Names of the members in both libraries should be the same since that is how LinuxCAD matches selected icon to a block to insert.

Let go over the process of how to create a block library. First you have to specify all the blocks you want in the block library, each in a separate .dxs file.

That can be done two ways:

  1. Open the file with the name you want as new and draw the block there or,
  2. Draw all blocks in the same file, define them as separate local blocks using BLOCK command, write every one of defined blocks to separate file using WBLOCK command.

Either way you are going to end up with a bunch of .dxs files of your blocks.

Now compress everyone of them separately using gzip command.

Suppose these are our files after we have done all of the above:

arrowd.dxs.gz arrowl.dxs.gz arrowr.dxs.gz arrowu.dxs.gz
box1.dxs.gz box2.dxs.gz box3.dxs.gz box4.dxs.gz

Having eight of these gzip-ed external blocks we may create one Block Library out of them. That is exactly what we do with the option CREATE of the BLOCKLIB command.


Command:BLOCKLIB

What to do about a block library? ( CREATE/LIST/BROWSE ):C

You are about to create new Block Library.
Your member files must have extension ".dxs.gz" .
Enter Block Library name only ( ext ".dxl" is assumed:sample_blib

Enter name only ( no ext. ) of the member file:box1
Enter name only ( no ext. ) of the member file:box2
Enter name only ( no ext. ) of the member file:box3
Enter name only ( no ext. ) of the member file:box4
Enter name only ( no ext. ) of the member file:arrowd
Enter name only ( no ext. ) of the member file:arrowu
Enter name only ( no ext. ) of the member file:arrowl
Enter name only ( no ext. ) of the member file:arrowr
Enter name only ( no ext. ) of the member file:Nil

Block Library: "sample_blib.dxl" written successfully.

The library created in the example above is included in your distribution as a sample. Let us now see how we can use option LIST of the BLOCKLIB command to display the names of all blocks in the block library.

Command:BLOCKLIB

What to do about a block library? ( CREATE/LIST/BROWSE ):L

Enter Block Library name only ( ext ".dxl" is assumed:sample_blib

------------------------------------------------------------
DIRECTORY OF: sample_blib.dxl
------------------------------------------------------------
BOX1
BOX2
BOX3
BOX4
ARROWD
ARROWU
ARROWL
ARROWR
------------------------------------------------------------

The last and perhaps the best ability of the BLOCKLIB command is to bring up on the screen the iconic menu of all blocks in the library, wait until you pick the one you would like to insert and run the INSERT command as a conclusion.

Here is how it works:

Command:BLOCKLIB

What to do about a block library ? ( CREATE/LIST/BROWSE ):B

Enter Block Library name only ( ext ".dxl" is assumed:sample_blib

Browsing: "sample_blib"
FILE: "/tmp/linuxcad_3159_temp_block.dxs" EXISTS, READING IT AS BLOCK...
Insertion point:6.347917,7.402083

Enter scale factor:7.860417,7.127083

Enter rotation angle:5.568750,7.333333


Command:BLOCKLIB

What to do about a block library ? ( REATE/LIST/BROWSE ):B

Enter Block Library name only ( ext ".dxl" is assumed:sample_blib  

Browsing: "sample_blib  "
Insertion point:11.320833,8.318750

Enter scale factor:12.168750,6.164583

Enter rotation angle:12.489583,8.410417

In the protocol above, in both cases the same block was inserted. It was loaded from the library only once, as in second command the same block was actually inserted from the local block table of the current drawing. Even in the second case, the block was selected using the iconic menu. Block names from the current drawing will override the names of external blocks and blocks from attached or browsed libraries.



MSLIDE

The command creates a slide. Slide is a not editable drawing mostly used for viewing library catalogs in LinuxCAD. You can create a single stand alone slide by specifying slide name. LinuxCAD will add an extension .SLD to the file name that you specified. Whenever user pressed right mouse key instead of entering name here the name of the slide to be created will be the same as the name of the current drawing with the extension replaced to .SLD . You can also write you slide directly to a slide library. To do that specify name of the library and then slide member name in parenthesis.


Command:mslide
Enter Slide Name ( "victor1.sld" )or RIGHT BUTTON to accept:Nil
Writing file: "victor1.sld" .

Command:mslide
Enter Slide Name ( "victor1.sld" )or RIGHT BUTTON to accept:explicitly_named
Writing file: "explicitly_named.sld" .


Command:mslide
Enter Slide Name ( "victor1.sld" )or RIGHT BUTTON to accept:aaalib(member1)
Saving member member1 to library aaalib.slb
Writing file: "/tmp/lcad_9222_tmp.sld" .
Opening files ...
Writing header ...
Reading library directory ...
Writing new directory to temp file ...
Adding directory record for new slide ...
Writing end of catalog record ...
Writing all old memeber BLOBs ...
 slide vv22 ...
 slide vv22 , length 727 , wanted len = 727 ...
 slide vv23 ...
 slide vv23 , length 727 , wanted len = 727 ...
 slide vv44 ...
Appending new slide: "member1" ...
Removing temporary files...
.SLB library "aaalib.slb" processed. Member "member1" added. Ok.
Done. Ok.
Command:



SLIDELIB

This command creates a slide library from existing slide files. Slide is non-editable capture of the LinuxCAD drawing editor screen. It is used mainly for illustrative and presentational purposes. Slides are kept in the files with the extension .sld. To create slides, use MSLIDE command. To verify whether the slide library in question has been created correctly use command BROWSESLB.

The creation of the satellite slide library for our sample block library will look like this:

Command:SLIDELIB

You are about to a create new slide library.
Enter name of the slide library (.SLB-file) to create:sample_blib

Enter slide name:arrowd
Enter slide name:arrowl
Enter slide name:arrowr
Enter slide name:arrowu
Enter slide name:box1
Enter slide name:box2
Enter slide name:box3
Enter slide name:box4
Enter slide name:Nil

Slide library: "sample_blib.slb" written succesfully.

Command:BROWSESLB

Enter .slb file name:sample_blib

The slide you have selected is: "".



VSLIDE

The command displays an existing slide. Slide is a not editable drawing mostly used for viewing library catalogs in LinuxCAD. You display a single stand alone slide by specifying slide name. LinuxCAD will add an extension .SLD to the file name that you specified. You can also display slide directly from a slide library. To do that specify name of the library and then slide member name in parenthesis.

        Examples:

Command:vslide
Enter slide name:lcad
Done.

Command:vslide
Enter slide name:aaalib(vvv5)
Done.





LinuxCAD Symbol Libraries.


LinuxCAD has the following application symbol libraries:

  1. Universal Modelling Language for Object Oriented Modelling
  2. Computing and Computer Network Diagramming
  3. Electric and Electronics
  4. Architecture
  5. Maps and Geography
  6. Symbols for mechanical drawings
  7. Presentation graphics
  8. Process enginering symbols

Please note that not all distributions of LinuxCAD contain the specified libraries. The method of accessing libraries could be different depending on the way your copy of LinuxCAD was built. There are two distinct ways that LinuxCAD may be packaged: static build and dynamic build.

Static build will work without modification on any Linux box and the commands to access symbol libraries will be included inside.

In the earlier versions of the dynamic build of LinuxCAD, the commands to access symbol libraries and relevant menus are located in a separate loadable module: adsl_libs.so. The name of every module that you want to load automatically must be present in the linuxcad.ads file in the LinuxCAD home directory. In newer versions this requirement was eleminated because everything related to symbol libraries is now built in.

Either way, whether you have a static or a properly configured dynamic build of LinuxCAD, the following commands should be accessible to you:

  1. UMLTOOL command to bring up the Universal Modelling Language for Object Oriented Modelling related menus
  2. LIBS command to bring up menus to access all LinuxCAD symbol libraries
  3. COMPUTING command to bring up symbol menus for Computing and Computer Network Diagramming
  4. ELECTRIC command to bring up symbol menus for Electric and Electronic schemas
  5. ARCHIT command to bring up symbol menus for Architecture
  6. MAPS command to bring up symbol menus for Maps and Geography





10. Commands for 3D modeling.


You can model 3D scenes with LinuxCAD. The 3D volume of LinuxCAD is processed separately from 2D drawings. In AutoCAD speak the LinuxCAD 3D volume is so called model space. And the 2D drawing canvas of LinuxCAD is something that AutoCAD users refer as paper space. You can specify up to 4 viewports which define different mappings from 3D volume to 2D paper space. The 2D drawing does not go via the viewport pipeline. So you cannot see your 2D objects within the viewports. We do not reccomend that you attempt to mix 2D and 3D objects in editing commands. You cannot edit 3D objects by 2D editing commands, but you can print the viewport contents as they appear on the screen using 2D print and plot commands. Only one of four viewports is active at a time. The viewport can be active and visible or invisible. You can select 3D objects in the active viewport only. Selected objects will be highlighted in all viewports where they are visible. The erase and property change commands affect 3D objects as well as 2D. The basic building blocks in LinuxCAD 3D space are only of 2 types; 3D Lines and 3D Faces. More complex objects are made as a superposition of these primitive types.

Starting from release 1.96, we have introduced the so-called Elevation. An elevation is a distance of inherently 2D objects from the plane Z==0.0. In our opinion, elevation-like modeling of depth is not the right approach, but we still brought the support of elevation in LinuxCAD mainly because this is something that exists in AutoCAD and its DWG files. An Elevated Solid LinuxCAD object may look like 3D Face with the exception that it will always be parallel to the XY/Z==0.0 plane. From obvious reasons the HIDE (hidden lines removal) command will not improve the view of a 3D scene composed of elevated objects. Inherently 3D objects as 3DFaces and 3DLines can be elevated too, but that does not mean the HIDE command will stop processing them, it will handle them as well as before. The 3D features of LinuxCAD were greatly enchanced and extended in versions 4.3 and 5.0 of LinuxCAD, some of the 3D commands were much improved. The architecture of LinuxCAD is such that objects and points can be entered or selected only in current viewport. That may be a little inconvenient especially when you already started a command and realized that you can not select objects because the viewport that you looking at is not current. Use command PICKVPORT to switch the active viewport to the one you are looking at. This command is also attached to hot key F7. It is obvious in 3D design it is one of the most often used commands.

ARRAY3D - creates circular and rectangular arrays in 3D space from 3D objects.

AXIS3D - controls visibility of the helper vectors, which show you the direction of the 3D coordinate axis and the origin of the 3D coordinate system.

CMD3DMNU - bring up a graphics menu of most important 3D drawing commands.

CONE - builds a 3D cone.

COPYROT3D - copies and rotates a set of 3D objects. The operation is defined by three starting points and three destination points that together uniquely define the location of new objects in 3D space.

CYLINDER - builds a 3D cylinder.

DIST3D - measures a distance in 3D space.

DLGVPORT - allows you to change all parameters of the current 3D view like camera and target locations, view scale and twist, as well as place mapping onto a 2D canvas.

F3D - creates a single 3D Face.

HIDE - removes hidden lines from a group of 3D objects.

INVISIBLE - turns an edges or anothewords a ribs of a 3D Face to invisible state. This command will usually be used on adjacent 3D Faces that belong to the same 3D plane.

ENDHIDE - reverts back to normal view of original 3D objects and removes the nice picture produced by last HIDE command from the screen.

EXTRUDE - extrudes polyline which must lay in the XY and Z==0.0 plane towards +Z or -Z. Every polyline segment becomes a 3D Face.

EXPORTOGL - exports 3D geometry to special .ogl file. The file can be later read by linuxcad_renderGL program that produces photorealistic.

KEEPHIDE - add a flat resulting view of the last HIDE command to the current drawing and remove from the drawing original 3D objects. KEEPHIDE is needed when you want to print or plot the results of the HIDE command. Do not forget to backup your file before using this command, because the original 3D objects will be gone after KEEPHIDE.

L3D - creates a single 3D line.

LIGHT - places a light source in the drawing. This command becomes significant only when you export your drawing to OpenGL.

MIRROR3D - mirrors 3D objects across the specified plane.

MOVE_3D - moves 3D objects in 3D space.

P3D - create named 3D point in the drawing.

QUBE - draws a 3D qube composed of 3D Faces.

REVOLVE - create 3D body of rotation by revolution of polyline.

ROTX_3D - rotates 3D objects in 3D space around 0X axes.

ROTY_3D - rotates 3D objects in 3D space around 0Y axes.

ROTZ_3D - rotates 3D objects in 3D space around 0Z axes.

ROT_3D - rotates 3D objects in 3D space around an arbitrary line in 3D space.

SCALE_3D - scales 3D objects in 3D space.

SETVPORT - sets current active 3D Viewport.

SPHERE - builds a sphere in 3D space.

SETP3DS - controls visibility of 3D points and

TO3D - Converts any 2D object to look-alike 3D object.

TORUS - builds a torus in 3D space.

VIEW3D - specify the parameters of the current 3D viewport.

VSPROD - shows a vector product of two other vectors.

WHICHPORT - The command exists to increase convenience of working with 3D viewports. Use it when you want to find out through which viewport a particular view of 3D object is projected.

ZOOMW3D - currently not implemented.





ARRAY3D

The command creates the whole array from selected 3D objects. It may be a rectangular three dimensional array or circular array. LinuxCAD architecture promotes deeper separation of 3D objects and 2D objects then that of AutoCAD. Looking at LinuxCAD, you may say it is essentially two editors under one roof as it includes a 2D paper space editor and a 3D model space editor. None of the 3D editing commands will affect any of the 2D objects. LinuxCAD will verify whether you have selected any 3D objects before continuing any of the 3D commands further.

  For instance:

Command:ARRAY3D

Select object:-304.663810,22.907101

Found 1 object!
Select object:-260.643362,73.699926

Found 1 object!
Select object:Nil

The selected Set contains no 3D objects.
This command operates only on 3D objects.
Command aborted !
Command: 

To select between rectangular 3D array and circular, use keys R and P when the message "Rectangular or Polar array < R/P/ > :" appears.

   Sample dialog for rectangular 3D array:

Command:ARRAY3D

Select object:c

1-st Crossing point-167.523184,117.720374

2-nd Crossing point-1.599958,-70.213077

Found 400 objects.
Select object:Nil

Rectangular or Polar array  :R

Number of Rows (---)  range ( 1 ... 1000 ):3

Number of Columns (|||)  range ( 1 ... 1000 ):3

Number of Levels (...)  range ( 1 ... 1000 ):3

Unit cell or distance between Rows (---):100

Distance between Columns (|||):100

Distance between Levels (...):100



AXIS3D

When you work in 3D it is very useful to know where the coordinate axes are. The AXIS3D command controls the visibility of 3D axes markers. The command will provide you with a 3-way choice: Enter (?/ON/OFF):

? - print the status of AXIS whether the axes markers are visible or not.

ON - enable marker's visibility.

OFF - disable marker's visibility.

When markers are visible GREEN has the direction of OX positive, BLUE of OY positive, and YELLOW of OZ positive.



CONE

Draws a cone in 3D space. Most of the 3D drafting commands allow you to select the accuracy of approximation, all of them are approximated by 3D faces. The cone in our example below is extremely precise. It consist of 300 narrow triangular 3D faces. Unfortunately in most of the commands, you will have to enter all three coordinates X, Y and Z separately. Something will be done to improve this in future versions. We can write custom drivers for your specific 3D digitizers, if the manufacturer will provide us with the necessary programming documentation.


   Example:

Command:CONE

Enter X  of the Cone foundation center point:3

Enter Y  of the Cone foundation center point:3

Enter Z  of the Cone foundation center point:3

Enter X  of the Cone vertex.:10

Enter Y  of the Cone vertex.:10

Enter Z  of the Cone vertex.:10

Enter Diameter of the foundation:100

Enter Number of Faces:300



REVOLVE

Creates 3D body of rotation by revolution of polyline. Via one or two steps every LinuxCAD 2D object can be converted to Polyline therefore this command can create fairly complex bodies of rotation.

Command:REVOLVE

Select polyline to revolve in 3D:5.477083,6.760417

Found 1 object!
First 2D point of rotation axis (x,y,z=0.0):10.289583,6.325000

Second 2D point of rotation axis (x,y,z=0.0):6.760417,9.235417

First 3D point of rotation axis (x,y,z):0,0,0

Second 3D point of rotation axis (x,y,z):0,1,0

Angle to fill (in degrees):360

Number of cells to aproximate:25

The command may exhibit some errors when given a vertical axis of rotation in 2D. We recommend to avoid entering vertical line in answer to questions "First 2D point of rotation axis" and "Second 2D point of rotation axis". The 3D center line of rotation axis can be vertical. You can avoid vertical lines without loosing generality and this is not a limiting factor.



SETP3DS

The command controls visibility of 3D points and their names in all 3D viewports.

Command:SETP3DS

Would you like 3D points displayed ? :YES

3D Points: displayed.
Would you like 3D point NAMES displayed ? :YES

3D Point Names: displayed.



VSPROD

Computes vector and scalar product of two vectors. This command is normally located in "Inquires 3D" submenu.

Command:VSPROD

FIRST VECTOR Start Point 3D point (x,y,z):1,1,1

FIRST VECTOR End Point 3D point (x,y,z):1,3,0.5

SECOND VECTOR Start Point 3D point (x,y,z):0,0,0

SECOND VECTOR End Point 3D point (x,y,z):2,1,3.5

First vector: [2.000000 1.000000 3.500000] , from point(0.000000,0.000000,0.000000) to point(2.000000,1.000000,3.500000) Length = 4.153312
Second vector: [0.000000 2.000000 -0.500000] , from point(1.000000,1.000000,1.000000) to point(1.000000,3.000000,0.500000) Length = 2.061553
Vector Product : [-7.500000 1.000000 4.000000] Length = 8.558621 , Scalar Product = 0.250000





11. Command Scripts.


A Command Script is a sequence of LinuxCAD commands that you may execute again and again by reading it from the text file. You may create scripts using any text editor or you may record them when you run LinuxCAD.

You may use the commands CMDSPOOLON and CMDSPOOLOFF to start and stop script recording. Script may contain any number of any LinuxCAD commands. But this is not all, script may contain Script Subroutines as well. This feature is unique to LinuxCAD and exceeds the script capabilities of AutoCAD.

LinuxCAD subroutines may contain regular LinuxCAD commands and parameters. The parameters are substituted at the moment of script invokation.

   Sample script:

   PROCEDURE FLY_UP(  Up_Dist_on_0Y_Direction )
   MOVE_3D
   p
   Nil
   0
   &Up_Dist_on_0Y_Direction
   0
   ENDPROC


   Sample script invocation:

       FLY_UP 120.0

   in this call above the &Up_Dist_on_0Y_Direction will receive the 
value of 120.0 .

You have to define your script subroutines in the same file you run. You cannot import them from elsewhere. To invoke a script subroutine just specify its name. No script subroutine may have the same name as any LinuxCAD command. If you use the same name as a native LinuxCAD command, the LinuxCAD command will take priority and the script most probably will fail.

To select and run a script file you may use "S" button at the upper left corner of LinuxCAD window. It is located just to the left of the coordinate display.








12. LinuxCAD Lisp.


LinuxCAD supports Lisp language as one of its customization tools. LinuxCAD Lisp has most of the features that AutoLisp provides. However, not all features work identically. To invoke LinuxCAD Lisp interpreter you should use the command LISP. The Lisp command will ask you for a file name that it will then load the Lisp program from there. LinuxCAD Lisp observes the following data types: String , Integer , Real , File Handle, Pick Set and Entity. In adition, whenever Point is required for the Lisp function, LinuxCAD Lisp will expect a list of 2 reals. The first element is the X coordinate and the second element is the Y coordinate. This manual is not intended to teach you how to program in Lisp. The purpose of this chapter is just to delineate the features and differences of LinuxCAD Lisp from other kinds of Lisp-s and from AutoLisp (the Lisp language embed- ded in AutoCAD). As far as implementation, all Lisp constructs split to two groups, the group of instant evaluation and the group of deferred evaluation. Constructs like Progn, while and if belong to a deffered evaluation group. Most of the statements that affect the flow of execution are deffered. Instant evaluation functions are divided into several large groups: 1.ariphmetic functions 2.predicates 3. functions that control LinuxCAD 4. Functions that provide for a dialog with User.

Two special LinuxCAD commands are realted to running Lisp programs. The LISP command is used to initiate an execution of a LinuxCAD Lisp program. ATOMS command is used to print the LinuxCAD Lisp Atom table to standard output.

LinuxCAD Lisp flow control statements:


    (progn
          any number of any Lisp statements or functions
    )

combines any sequence of statements to a block so they appear to the program outside as a single statement. The most common usage of this is to enclose THEN and ELSE branches of the LinuxCAD Lisp IF statement.


    (if condition_expression
         then_expression
         else_expression
    )

The conditional statement if evaluates the conditional expression first and if it returns anything but Nil then then_expression is executed. If the condition expression returns Nil then else_expression is executed.


    (while  condition_expression
          expressions ...
    )

the expressions inside while are executed in a loop as long as the condition expression is evaluated as not Nil.






List of all implemented Lisp functions.



12.1 LinuxCAD Lisp Drawing Functions.


         (mk_point  X_of_point  Y_of_point)   draws a point in the current drawing. 
                                              Both parameters are numbers.


         (mk_point  PointOne )   draws a point in the current drawing. 
                                  The parameter is a list of two numbers,
                                  created as such: (setq pnt1 (list X0 Y3))


         (mk_line  X_of_point1  Y_of_point1   X_of_point2  Y_of_point2 )  
                draws a line in the current drawing.  All parameters are numbers.


         (mk_line  PointOne PointTwo )  
                draws a line in the current drawing.  Both parameters are point lists.


         (mk_solid  X_of_point1  Y_of_point1   
                    X_of_point2  Y_of_point2 
                    X_of_point3  Y_of_point3 
         )  
                draws a filled triangle in the current drawing.  All parameters are numbers.


         (mk_solid  PointOne PointTwo PointThree )  
                draws a filled triangle in the current drawing.  The parameters are point lists.


         (mk_circle  X_of_center Y_of_center Radius )  
                draws a circle in the current drawing.  All parameters are numbers.


         (mk_circle  PointOne Radius )  
                draws a circle in the current drawing.  The first parameter is a point list
              and a second parameter is a number.


         (mk_arc   X_of_center Y_of_center  Radius  Start_Angle  End_Angle )  
                draws an arc in the current drawing.  All parameters are numbers.


         (mk_arc   PointOne  Radius  Start_Angle  End_Angle )  
                draws an arc in the current drawing.  The first parameter is a list of
                 two numbers or one point and all others are numbers.


         (mk_text    X_of_start_point  Y_of_start_point 
                     Text_Height  Text_String  Rotation_Angle  Width_Coefficient )  
        
            draws a text string in the current drawing.
            The Text_String parameter is a type string and all others are of type real.       


         (mk_text    PointOne
                     Text_Height  Text_String  Rotation_Angle  Width_Coefficient )  
        
            draws a text string in the current drawing.
            The Text_String parameter is a type string.  PointOne is a list of two numbers
        and all others are of type real.       


         (mk_ellipse    X_of_center Y_of_center  Rotation_Angle  
                               A_Axis_Length B_Axis_Length  )  
        

         (mk_elliptic_arc    X_of_center   Y_of_center Rotation_Angle  
                                    A_Axis_Length B_Axis_Length 
                                Start_Angle End_Angle
         )  
        

         (mk_trace X_of_point1 Y_of_point1     
                          X_of_point2 Y_of_point2  Trace_Width  )  
        

         (mk_trace  PointOne  PointTwo  Trace_Width  )  
        

         (mk_donut    X_of_center Y_of_center    
                             Inner_Diameter   Outer_Diameter  )  
      
             draws a filled doughnut in the drawing.  

         (mk_donut    PointOne   Inner_Diameter   Outer_Diameter  )  
      
             draws a filled doughnut in the drawing.  

         (mk_plvec     X_of_point1  Y_of_point1   X_of_point2  Y_of_point2  
                       Start_Width   End_Width  )  
       
              draws a polyline vector segment in the drawing. 

         (mk_plvec   PointOne   PointTwo  Start_Width   End_Width  )  
       
              draws a polyline vector segment in the drawing.  Points are to be
             specified as lists of two numbers each. 

         (mk_plarc    X_of_center Y_of_center  Radius  Start_Angle  End_Angle   
                       Start_Width   End_Width  )  
       
              draws a polyline arc segment in the drawing. 

         (mk_plarc    PointOne  Radius  Start_Angle  End_Angle   
                       Start_Width   End_Width  )  
       
              draws a polyline arc segment in the drawing. 

         (mk_attdef    Attribute_Name_String  Attribute_Default_Value_String 
                       Attribute_Prompt_String  Total_Field_Length_Integer
                       X_of_text_start_point   Y_of_text_start_point 
                       Text_Height Text_Rotation_Angle Text_Width_Coefficient
         )  
       
              draws an attribute in the drawing.  All parameters except the first three
           are numbers.

         (setcolor  Color_Name_String )  
       
              You can specify any of the standard eight LinuxCAD colors here, 
          in upper, lower or mixed case.

         (setrgbcolor  RedComponent_As_integer   BlueComponent_As_integer  
                              GreenComponent_As_integer )  
       
             LinuxCAD accepts an interger here to specify intencity levels from 0 to 255.
          Negative numbers will be taken as 0 and numbers larger then 255 
          will be taken as 255.





12.2 LinuxCAD Lisp Zooming Functions.


         (zoomw  
                 X_of_lower_window_corner Y_of_lower_window_corner 
                 X_of_upper_window_corner Y_of_upper_window_corner 
         )  
       

         (zoomw LowerLeft_Point  UpperRight_Point )  

         (zoomscale  New_View_Scale_Factor )  

         (pan  
                 X_of_start_point Y_of_start_point 
                 X_of_end_point Y_of_end_point 
         )  
       

         (pan StartPoint EndPoint )  
       




12.3 Selection Set Functions.



         (ssadd  EntityName  SelectionSet ) 

             adds an entity to a selection set. 
       

         (ssdel  EntityName  SelectionSet ) 

             deletes an entity from a selection set. 
       

         (ssfirst  SelectionSet ) 

            obtains the first entity from a selection set and therefore
          starts a new enumeration of a selection set. 
       

         (ssnext  SelectionSet ) 

            obtains next entity from a selection set and therefore
          continues enumeration of a selection set. 
       

         (sslength  SelectionSet ) 

            obtains next entity from a selection set and therefore
          continues enumeration of a selection set. 
       

         (ssget  mode_String PointOne PointTwo ) 

           When called without arguments, this function returns an empty 
          selection set.
           mode_String can be one of the two:

              "W"  - select by Window frame ,
              "C"  - select by Crossing frame.

           PointOne is on the lower left corner of the frame.

           PointTwo is on the upper right point of the frame.
       


12.4 LinuxCAD Lisp User Interaction functions.

Most of these functions are for requesting user input in various formats.
         (initget string1 string2 ... stringN )  

            prepare LinuxCAD lisp for executing getkword function.

         (initget string1 string2 ... stringN )  

            prepare LinuxCAD lisp for executing getkword function.

         (getkword prompt_string )  

            asks user to enter one of the keywords set previously using 
       initget function. Whatever keyword user selects will be returned.

         (geting prompt_string )  

            asks user to enter integer number.

         (getreal prompt_string )  

            asks user to enter a real number.

         (getstring prompt_string )  

            asks user to enter a string.


12.5 LinuxCAD Lisp Numeric Functions.


         (+ arguments )  

            returns the sum of all arguments.

         (- arg0 arguments )  

            substracts all subsequent arguments from argument arg0.

         (* numeric_arguments )  

           returns the product of all arguments.

         (/ numeric_arguments )  

           divides first argument by the product of the remaining arguments.

         (incr numeric_argument )  

           increases the argument by an increment of one and returns the result.

         (decr numeric_argument )  

          decreases the argument by an increment of one and returns the result.

         (abs numeric_argument )  

          returns the absolute value of the argument.

         (atan numeric_argument )  

          returns the the arctangent of the numeric_argument in radians.

         (cos ang )  

          returns the cosine of an angle in radians.

         (sin ang )  

          returns the sine of an angle in radians.

         (exp number )  

          returns the constant e raised to a specified power.

         (expt number )  

          returns a number raised to a specified power.

         (print expression )  

          prints the value of the expresion.

         (log number )  

          returns the natural log of a number.

         (float number )  

          converts a number to a floating point value if it is an integer.
        It does not change it if it is already real.

         (fix number )  

          rounds down the real number to the closest integer of the number.

         (max numeric_arguments ... )  

          returns the maximum of its arguments.

         (min numeric_arguments ... )  

          returns the minimum of its arguments.

         (mod divident_number divisor_number )  

          divides the first number by the second and returns the remainder.

         (sqrt number )  

          returns the square root of its argument.

         (zerop argument )  

          returns T if the argument is zero.

         (minusp argument )  

          returns T if the argument is negative.

         (numberp argument )  

          returns T if the argument is a number.

         (atoi string )  

          converts a string to an integer if possible.  If not possible, the result
      will be zero.

         (itoa integer )  

          converts an integer to a string.

         (str number )  

          converts any kind of number (integer or real) to a string .

         (= number1 number2 )  

          compares two arguments and returns T if they are numerically equal.

         (/= number1 number2 )  

          compares two arguments and returns T if they are not numerically equal.

         (< number1 number2 )  

          compares two arguments and returns T if the first argument is smaller
        than the second.

         (<= number1 number2 )  

          compares two arguments and returns T if the first argument is lesser than
        or equal to the second.

         (> number1 number2 )  

          compares two arguments and returns T if the first argument is greater
        than the second.

         (>= number1 number2 )  

          compares two arguments and returns T if the first argument is greater
        than or equal to the second.


12.7 LinuxCAD Lisp String Functions.

LinuxCAD Lisp strings are limited to 200 bytes. You cannot create a string larger then 200 bytes.


         (strcat  string_1 ... string_N )  

          concentrates all string arguments and returns combined large string.

         (strlen  string_arg )  

          returns the number of characters in the string type argument.

         (strcase  string_arg  which_case )  

          if which_case is ommited or evaluates to nil, all characters
         will be converted to uppercase.  If which_case is present and not nil
         then the string is converted to lowercase.

         (substr  string start length )  

          returns a substring of a string starting from position start and 
       of a specified length. If length is not specified, the substring 
       continues to the end of a string.



12.8 LinuxCAD Lisp List Handling Functions.

Originally Lisp was considered a List processing language. These days most people who use and know Lisp use it because it is implemented in the CAD systems such as AutoCAD and LinuxCAD. Even LinuxCAD Lisp provides a minimal set of the functions to handle Lists.

LinuxCAD Lisp keeps and processes points as lists of two or three numeric elements.


         (list  arg1 ... argN )  

          joins all its arguments in a list. The most common way to create a 2D point 
     in LinuxCAD Lisp is to do something like:  (list X Y) or  (list X Y Z)  .

         (car  argument_of_type_list )  

          returns first member of a list.  This is a natural way to obtain an X coordinate
       from a point.

         (cdr  argument_of_type_list )  

          returns the remainder of a list.

         (cadr  argument_of_type_list )  

          returns first member of the remainder of a list.  This is a natural 
       way to obtain a Y coordinate from a point.

         (listp  argument )  

         this is a specialized function  that answers a yes or no question. 
           It returns T only if the argument is indeed a list as opposed to 
         a constant or an atom.

         (nth  argument_of_type_list  )  

         returns the element number N of a list.

         (cons  argument_one argument_two  )  

         Joins two arguments in a list.

         (reverse  argument_one argument_two  )  

         Reverses a list so the last element becomes the first and the 
     first is now the last.

         (atom  argument )  

         Returns T if an argument is an atom and Nil if it is a list.

         (last   argument_of_type_list  )  

         Returns last element of a list.

         (length   argument_of_type_list  )  

         Returns number of elements in a list.


12.9 LinuxCAD Lisp Miscellaneous Functions.


         (angle  PointOne PointTwo )  

            returns the point an angle in radians of the line defined by two points.

         (distance  PointOne PointTwo ) 
      or 
         (distance   X_of_Point1 Y_of_Point1    X_of_Point2 Y_of_Point2  )  

            returns point an angle in radians of the line defined by two points.

         (polar  PointOne Angle_Number Distance_Number )  

            returns point at a specified angle and a distance from the base point.


   Alternative of polar function:

         (polar   X_of_base_point Y_of_base_point
                                 Angle_Number   Distance_Number   )  


         (inters  PointOne_of_LineOne PointTwo_of_LineOne
                  PointOne_of_LineTwo PointTwo_of_LineTwo
                  where_boolean )  

            returns the point of intersection of the two lines or Nil if they do
          not intersect. If  where_boolean  argument is present and is Nil,
          the lines are considered infinite in length, the function returns the 
          point where they intersect even if the point is off the end of one 
          or both of the lines.


         (setq atom_name expression )  

           assigns the value of the expression to an atom atom_name.

         (trace trace_mode_Integer )  

          sets the trace mode.  When being called without arguments, 
          this function enables tracing to LinuxCAD command line window, 
          otherwise the single argument has to be one of the following values:
                 0 - to disable trace,
                 1 - to enable trace to LinuxCAD comman line,
                 2 - to enable trace to standard output.


         (untrace)     disables trace mode.


         (command ... arguments ... )   

            run one or more LinuxCAD commands.  Arguments can be of
        any of the following types: strings, points as (list x y),
        references to entities, selection sets, real and integer numbers.
          When using this function, one has to be very careful to provide exactly the type
         of data LinuxCAD expects when programming on LinuxCAD Lisp and
         using this function.


         (pointp  argument )   

            this is a predicate function.  It returns T if the argument
          is a point or Nil if the the structure of argument does not allow 
          interpretation as a point.


         (ver)  

          returns the version number of the Lisp interpreter. 
     At this time LinuxCAD returns string: 
                          "LinuxCAD Lisp 1.0".

         (and expression1 ... expressionN )  

          this function is to be used in IF statements mostly.  It returns
         T only if all of its arguments return not NIL.

         (or expression1 ... expressionN )  

          this function is to be used in IF statements mostly.  It returns
        NIl only if all of its arguments return NIL. Anotherwords
       even if only one of its arguments is not NIL function will return
       not NIL.

         (prompt  string )  

         prints the message to LinuuxCAD command line window.


         (redraw)  

         Refreshes the LinuxCAD graphics window.  This function has no arguments.


         (exit)   
         (quit)     
         (abort)  

         All three functions take no arguments and will cause current Lisp
      program execution to terminate.


         (type   argument_of_type_list  )  

         Returns type of the argument. The type is encoded by the 
    following identification strings:
        REAL for real numeric constants
        INT  for integers constants 
        STR  for string constants
        SUBR for built in functions
        LIST for lists
        T    for T (or logical truth)
        Nil  for Nil (or any athom that is not bound to anything)
        FILE for file object
        ENAME for entity name
        PICKSET for a selection set

       

         (getenv  environment_variable_name )  

         Reads the value of the OS environment variable. For example:
           (setq user_home_dir (getenv "HOME"))





13. LinuxCAD Fonts.


LinuxCAD works with vector fonts only. There are two types of vector fonts that are supported .shx fonts and .ltf fonts. The SHX font format is a standard font format that is used in popular AutoCAD software. .LTF format is a proprietary font format of Software Forge Inc. LTF is a contraction from LinuxCAD True Type Fonts. The LTF format provides similar capabilities as usually True Type fonts provide. And more then that majority of existing true type fonts can be automatically converted to the LTF format.

LinuxCAD distinguishes automatically the font type of the specified font file. The font format is transparent to the application. It is worth to note we do not recommend to use LTF fonts in the drawings that will be exported to AutoCAD. For such drawings to use font number 0 ( STANDARD ) is the best solution.

LTF fonts contain glyphs for every character of the font. The glyphs represent actual character configuration. In practise the need to modify existing font is rare. But still LinuxCAD can help you to do that. There is a group of commands that give you the power to modify any character of any LTF font. These commands are: EDLTFCHR_TOOL, EDLTFCHR_BEGIN, EDLTFCHR_DEL, EDLTFCHR_ADD, EDLTFCHR_END, EDLTFCHR_SAVEFONT. Before starting to edit an LTF font it is helpful to draw all characters in the font using DRAWFONT command.

EDLTFCHR_TOOL - Brings up the font editing tool.

EDLTFCHR_BEGIN - Selects the character to edit, this implicitely also selects a font that we edit. User selects the character by clicking at text object. This text object must contain only a single character.

EDLTFCHR_DEL - Delete part of the character glyph.

EDLTFCHR_ADD - Add new line or bezier curve to the character glyph.

EDLTFCHR_END - Finish editing of the character. After this command is issued the editing of another character can be activated again by EDLTFCHR_BEGIN command.

EDLTFCHR_SAVEFONT - Saves modified version of the font from LinuxCAD memory to the external font file on the disk. The font will be saved always in the same file from where it was loaded from.





14. LinuxCAD Customization Guide.


LinuxCAD is a highly customizable system. LinuxCAD can be customized on a variety of levels using different customization features. User and third party developer can adopt and change LinuxCAD to suit his(her) work idustry and country standards. You can create your own Toolbars,Graphics Menus, Linetypes,Hatch Patterns,Commands,Command Aliases and Keyboard shortcuts. Many of these customization opportunities were already described else where in this manual. This chapter will cover the customization features that we have not yet described in other chapters.




14.1 LinuxCAD Keyboard Shortcuts.

You can assign command scripts to hot keys in LinuxCAD. Hot key is a key combination that when pressed simultanously will invoke an entire command script or single command or several commands squentially. Your ability to attach to certain key combinations is platform dependent. Some key combination may work on X-Window platform and may not work on MS-Windows platform and vice versa. Generally you should be able to attach to all alphanumeric keys from A to Z and from 0 to 9 when they are modified by Control key or Alt key ( Control is being held down when the key is pressed ). For example you can attach a LINE command to Ctrl/l combination and LINETYPE command to Ctrl/L combination. When entering key combinations that require uppercase letters it is recommended avoid using Chaps Lock and use Shift instead. You can not change the meaning of Ctrl/C or Ctrl/c using the keyboard shortcuts feature. Some Operating Systems may reserve some keys for special purposes. For example, on Linux Alt/c and Alt/Q and Alt/W are reserved and therefore not available for customization. Some keys may get intercepted by Windowing system or Window manager or keyboard driver before they passed to LinuxCAD. We will accept and answer no technical support requests regarding the keyboard shortcuts feature. Support requests such as Please help me I can not attach my favorite block to Control/P will be discarded. We recommend the user to pick the hotkey that works on his specific configuration of computer software. If the key combination does not work, just pick another key combination.

A sample contents of LinuxCAD keyboard shortcuts description file linuxcad.key

#######################################################################
## Line type settings attached to Uppercase letters modified by Control
#######################################################################
# sets dotted linetype
*Ctrl D LINETYPE
SET
DOTTED
Nil
CHGCOL
YELLOW

# sets hidden linetype
*Ctrl H LINETYPE
SET
HIDDEN
Nil
CHGCOL
RED

# sets normal linetype
*Ctrl N LINETYPE
SET
CONTINUOUS
Nil
CHGCOL
WHITE

#######################################################################
## Editing Commands attached to Lower case letters modified by Control
#######################################################################
*CTRL t TRIM

*CTRL e EXTEND

*CTRL f FILLET

*CTRL m MOVE

*CTRL r ROTATE

*Ctrl s SCALE

#########################################################################
## Attachement to a special signs modified by ALT.
#########################################################################

*alt ! DDHATCH

*alt @ DLGVIEW3D
CURRENT

# Bring all toolbars up
*ALT # TOOLBARS
LOADALL

# Bring all toolmenus up
*ALT $ TOOLMENU
LOADALL


linuxcad.key file may contain comments that has to have a # sign in the first character of a line.

There is a quite reliable way to determine whether certain hot key combination is available on your Linux system to attach shortcut to. When you start LinuxCAD with a -testhotkeys LinuxCAD will echo every recognized key combinaton to the standard output. If the key combination can be reached like that it most likely can be attached to. The linuxcad.key provided only as an example of customization, the key combination defined in it neither standard nor recommended. It is better to discard original linuxcad.key file once you will come up with your own.






15. LinuxCAD Dimensioning Commands.


LinuxCAD alows to create dimensions in the drawing automatically. The common hub for dimensioning commands of LinuxCAD is accessible via: Draw/Dimensions/Menu pull down menu. That will bring up user friendly iconic graphical menu to select a dimensioning feature. The main dimensioning commands are: DIMHOR - create horizontal dimension. DIMVERT - create vertical dimension. DIMRAD - create radius type dimension. DIMDIAM - create diameter type dimension. DIMANG - create angular dimension. DIMLEAD - create leader(or anotherwords dimensioning arrow) with dimension text or without. DIMROT - create rotated dimension. DIMALIGN - create aligned dimension. You can try all those commands and see what they produce that will certainly help in your learning. TXTBOX - command also related to dimesioning it wraps a box frame around the text. And that is sometimes required while specifying tolerances. It was described earlier that LinuxCAD dimensioning system is controlled by dimensioning variables. The layer at which dimensions are created , the color of dimensional arrows and text as well as the size of all dimesioning components are stored in DIM-variables. LinuxCAD takes DIM variables from the OS environment or falls back on default built-in values if the environment is not specified. You can fine-tune the dimensioning variables using DIMVAR command.



DIMVAR

This command controls parameters of LinuxCAD Dimensioning. The DIMVAR command has the following modes available:

 "?"           - prints current settings of DIM variables.
 "SIZE_WIZARD" - adjusts all geometric size related DIM variables suiultaneously,
                 user only required to enter new value of "DIMTEXT_HEIGHT".
 "CHANGE"      - allows for fine tuning of every individual DIM variable.
 "SAVE"        - writes all current values of all DIM variable to "dimstyle.sh" shell
                 script in current directory, the script can be renamed or customized later.
 "LOAD"        - loads "dimstyle.sh" or another script in similar format.

The dimstyle.sh that LinuxCAD can write and read has the following format:

variable_name=variable_value
export variable_name
You can cut and paste the contents of this file to the LinuxCAD startup script or you can use DIMVAR/LOAD to load the dimensioning style directly. The DIMVAR/LOAD allows to specify the file name enabling you to keep several dimensioning styles each for it's own purpose. Normally after you customized your dimensioning variables the way you wanted them, you must use the DIMVAR/SAVE option to preserve your customization.






15. LinuxCAD Rendering.


The rendering or shading process that creates somewhat realistically looking images more or less resembling photographs has been around in computer graphics for a while. LinuxCAD version 5.0 brings direct rendering to LinuxCAD, now you do not have to worry about exporting your 3D models from LinuxCAD to Open GL , now you can perform basic rendering right inside LinuxCAD.

The /usr/linuxcad/3d_samples/shading directory contains a LinuxCAD rendering tutorial files. These files contain 3D models and parallel lights. That is all that is needed to render a 3D scene. Just open any of the below files using LinuxCAD and use commands of the "Display/Render" pull down menu to produce a scene.

render_test.dxs
render_test_1_light.dxs
render_test_allvports_visible.dxs
render_test_panoram_of_lights.dxs
render_test_re.dxs
render_test_spheres.dxs

Your ability to produce a good looking picture on the computer and system you are using depends from your display capability and the software sypport of that capability. While most of the currently sold display devices allow true color rendering to be performed not all display drivers support that.

LinuxCAD contains a "loop back test" that allows you determine "in advance" whether rendering of 3D scene is possible.

  Do the following to check whether you can render 
anything good at all in LinuxCAD:

 1) Select greyscale 255 colors palette.
   Display/Render/Renderer Config/PALETTE/GREY255

 2) Display palette on the screen.
    Display/Render/Show Render Palette

At this point if you can see color of the LinuxCAD display area smoothly gradually changing from more to less dark then everything fine and you can render or shade your 3D model.

If your X/Server is misconfigured or your display driver does not support required color resolution you will not see the smooth change of colors when displaying LinuxCAD rendering palette.

To actually render a scene do "Display/Render/Render Scene" or just type RENDER in LinuxCAD command line. Now select objects of your 3D model that you want to render and wait a few minutes. The rendering of any of the samples here takes not more then 2 minutes each(probably even less) on 500Mhz Pentium computer.

The LinuxCAD version 5.0 (second official build of it actually) is the first release that includes renderer. The current renderer implementation will evolve but for now it only supports parallel light sources.

The parallel light sources are added in the drawing using PARLIGHT command. For renderer only the direction of light rays of the parallel source, it's intensity and it's diffuse reflection coefficient are important, the location of the parallel light in 3D model is irrelevant it is presumed located in infinity anyway. For all that matters you can even place all your parallel sources in the orighin (X=0,Y=0,Z=0) it'll still work just as good.

The recommended rendering algorithm to use is PRECISE_RENDER , it will shade in greyscale of any chromatic configuration your scene.

The other "interesting" rendering algorithm is PRIMECOLOR_RENDER, this one will shade objects in the colors that they are, but it will only process the objects of 7 primary colors: white,red,green,blue, cyan,yellow,magenta. Objects in RGB colors will be threated as "white" by this rendering algorithm.

When you select PRIMECOLOR_RENDER you must also select PRIM_25 or PRIM255 rendering palette.

The PERSISTENT rendering mode is not efficient in terms or memory consumprion and drawing file size, this will be corretcted in near future in the order of user wishlists priority. In the mean time the FAST_PREVIEW is the rendering MODE configured by default and is the one you want to use. To save your rendering results use FAST_PREVIEW and screen capture.

The LUMINANCE_COMPUTING rendering configuration option can be set to SUM or PRODUCT. The PRODUCT mode will produce Okey rendering results almost always but the intensity and reflection coefficients will have only marginal if any impact on the results. If you want "more control" use the SUM luminance computing mode. The specular reflection coefficient is the one that affects quality of the picture the most. Ambient intensity and ambient reflection does not matter much here becuase LinuxCAD notrmalizes the rendering results therefore insuring that all bits and pieceas of the 3D model are visible and none appears as totally black.










Thank you very much for purchasing LinuxCAD.


All questions and comments should be addressed to:

Software Forge Inc.

http://www.linuxcad.com

http://www.softwareforge.com
Phone: 913 663 1724
e-mail: cadsoftw@aol.com or unixguy@aol.com