Continue A Table In A New Column With A Table Break

AutoCAD table objects are great in how they act similar to Microsoft Excel allowing you to add columns and rows and with the controls available, you can format the table in many ways to add style to the table.
Today’s tip is useful for tables that are long in length. If the table is long in length and you scale it to fit on a sheet in order to print, everything might be too small and run together, thus making your print unreadable.

Below is a simple example of an AutoCAD table (note: it isn’t a very long table…)

Table Break 1

 

To get the table to “break” and have a continuation:

  • Select the Table
  • Click the arrow grip at the bottom-middle of the table

Table Break 2

 

Click to re-position the arrow grip somewhere higher on the screen (within the table). You should see the table overflow into new columns to the right.

Table Break 3

 

The distance that you defined by re-positioning the arrow will be the new length for this table. So as new rows are added to the table, once the table reaches that defined length it will overflow once more into a third column.

Displaying The Labels In The Table Breaks:

Once these table breaks have been applied, you can add the descriptive top area of the table that is shown in the first rows of the table. This will help clarify what the second column is in the third table break for instance.

The first 2 rows of the table are called “Labels” and can be designated as a “Header” or “Title.” (These are defined in the Table Style manager). The important thing to know is that if both a “Title” and “Header” are defined, they are BOTH considered a label and will be repeated.

Table default content

 

To turn on the repeating labels:

  • Select the Table
  • Right-Click and select “Properties” to open the properties palette

Table Break 4'

 

  • In the properties palette, scroll down to the “Table Breaks” section
  • Change “Enabled” to “Yes”
  • Change “Repeat top labels” to “Yes”
  • The result should be a repeated “Label” in the Table Breaks

Table Break 5

Posted in Modifying, Tables | 2 Comments

OFFSET Polyline True Distance – OFFSETGAPTYPE

The OFFSET command creates parallel copies of an object away from the original object.

Here’s the scenario – You have an electrical drawing with limited space. You also have an oddly shaped electrical box that requires a 4 foot space between it and anything else around it.

Since the drawing is tight on room, you want to make sure that you adhere to the recommended space requirements but you also need to maximize efficiency.

Below is the oddly shaped electrical box. It is represented by a polyline
OFSS1

 

When you offset the polyline by 4 feet, it creates a parallel copy around the polyline (shown below)

OFSS2

But after further inspection, you notice that not all of the outer polyline is really 4 feet away from the electrical box.

(Below) The sections of the outer polyline that touch the green areas are 4 feet away, but the sections of the outer poyline that touch the red areas are greater than 4 feet.

This will result in wasted space.
OFSS3

How do you fix this?
Change the system variable OFFSETGAPTYPE to <1>

This will create rounded edges at the corners of the polyline, thus maintaining a true offset distance of 4 feet all the way around the electrical box.

OFSS5

 

Shown below is the result of the OFFSET using OFFSETGAPTYPE set to <1>

Please note – to only use this when needed! It is not recommended to keep this setting as a permanent setting. However, it is good to know about.

 

 

OFSS4

 

 

Posted in BASICS, Modifying, Polylines, TIPS | 1 Comment

Cant See .ctb files: CONVERTPSTYLES

When opening a drawing that is from someone else, they may have set the drawing to plot/print using a “Style” that has a file extension of “.stb” instead of a “.ctb”

What is a “.stb”?
The settings that define how a drawing looks when it is printed can be defined by either how it handles each color in the drawing (.ctb = Color Dependent Plot Style) or by wrapping up many of the various plot settings as a “Style” (.stb = Named Plot Style).

NO CTB 1

When you come across a drawing that has plot styles (,stb) and not your usual .ctb files simply use the command CONVERTPSTYLES <enter>

 

It will notify that it will no longer be looking for .ctb files

Click OK

NO CTB 2

 

Just to verify that it worked, look in the command line…

NO CTB 3

 

Now the drawing should be able to see your .ctb files when plotting.

NO CTB 4

Posted in BASICS, Printing - Plotting | 10 Comments

CADWorx Equipment Palette

Here is a quick tip for CADWorx Equipment users.

The user interface for CADWorx Equipment is simply a tool palette and maybe a toolbar…

The common problem is closing the Equipment palette and not knowing how to get it back open as you had it.

Here’s how:

  • _CADWORXEQUIPMENT <enter>
    Note: Use the underscore before the command

If the Equipment palette seems to flash and then disappear, use the command SHOWPALETTES <enter> and the Equipment palette should stay open

~enjoy

CADWorx Equipment Palette

Posted in CADWorx, Manage | 3 Comments

Use Align Space to Easily Align A Viewport View

Rotating a view within a viewport can be quite involved when using the DVIEW command as was shown in this post: https://autocadtips.wordpress.com/2013/06/03/dview-with-a-twist-rotating-a-viewport-view/

But as a guest named Nick pointed out, the ALIGNSPACE command from the Express Tools is a quick way in which rotating the view within a viewport to match that of a line in Paper Space is easy as using the ALIGN command.

It is really that easy too!!!

Align Space 1

Here’s how:

  • Make sure that you have a reference line in both model space and paper space.
  • Activate the viewport in which the view is to be rotated.
  • Start the ALIGNSPACE command. Found on the “Express Tools” tab > “Layout” panel > “Align Space” tool

Align Space 2

  • Pick 2 points within the viewport that define the angle
  • Pick 2 points in Paper space to define the desired angle
  • Click inside a viewport to apply the rotation to that viewport and then hit <enter>

Align Space 3

Note: The order in which you define the 2 points within the viewport and the order of the 2 points in paper space will be aligned accordingly.

Posted in Manage, Modifying, Paper Space, TIPS, Viewports | 8 Comments

Express Tool: EXPLAN – Improved PLAN command

The PLAN command is commonly used in 3D to get your view back to “home” and squared up so that you are looking down onto your drawing. It is also helpful when working in 2D drawings and the view has been rotated. Using PLAN will un-rotate your view back to “home.”
The EXPLAN command is an Express Tool and is a better version of the PLAN command (in my opinion). I usually tell CAD users to use PLAN to reset their view back to “home.” This works fine but the PLAN command does a ZOOM EXTENTS after the view has been adjusted. So the user has to navigate (zoom) back to where they were in the drawing prior to using the PLAN command.

With EXPLAN you can “square-up” your view based on an object that you select without doing a ZOOM EXTENTS.

Here’s how:

Shown below is a 3D view of an area of a drawing.

Explan 1

 

By using the usual PLAN <enter><enter> the result is a view that is perpendicular to the World UCS (WCS) but with a Zoom Extents applied to the result (shown below)

EXPLAN 2

 

On the other hand, Using the EXPLAN command found on the Express Tools tab > Tools panel > Extended Plan (shown below) asks you the same series of questions as the PLAN command but includes the ability to select an object.

Example:

  • EXPLAN
  • Select object – The view will be centered about the selected object.
  • <enter>
  • <enter>

EXPLAN 3

 

The result is shown below.

~enjoy

EXPLAN 4

Posted in 3D Intro, Express Tools, TIPS | 2 Comments

AutoLISP: Great Dialog Box to Turn On Layers from Various States

If you’re like me, you have a handful of routines, scripts or macros that let you basically “turn on” layers
Thaw those frozen layers; Unlock those locked layers; Turn on those Off layers…
The routine featured today combines all of those functions into one dialog box. The great thing about this routine is that it shows you only those layers that are currently Off, Frozen or Locked so that you don’t have the other layers that are turned on cluttering up your view. There is an optional function that lets you control these same layer states if they exist in an XREF. Simply check the box next to “Xrefs layers” for the ability to control these layers as well.

Here’s how:

  • Layer_On <enter> to start
  • Check the boxes under the “Properties” section that you would like to be turned “On”
  • Check the box next to “Xrefs Layers” to gain control over those layers as well

Select the layers under the “Layer List” section that you want to be turned “ON”. If all layers are needed to be selected, click the “Select all” button.

Layer On 1

 

This routine was provided by Stefan M. at the Autodesk forums. Please refer questions about the routine there: http://forums.autodesk.com/t5/Visual-LISP-AutoLISP-and-General/Thaw-layers-from-custom-dialogue-box/td-p/3944033/page/2


 ; Turn ON selected layers
 ; Stefan M. - 05.06.2013
 ; http://forums.autodesk.com/t5/Visual-LISP-AutoLISP-and-General/Thaw-layers-from-custom-dialogue-box/td-p/3944033/page/2
(defun C:LAYER_ON (/ *error* acDoc filen filew id l layers r prop var labels keys final l_name selected_layers)
  (vl-load-com)
  (setq acDoc (vla-get-activedocument (vlax-get-acad-object)))
  (vla-startundomark acDoc)

  (defun *error* (m)
    (and
      m
      (not (wcmatch (strcase m) "*CANCEL*,*QUIT*"))
      (princ (strcat "\nError: " m))
      )
    (vla-endundomark acDoc)
    )

  (defun remove_duplicates (lst)
    (if lst
      (if (vl-position (car lst) (cdr lst))
        (cons (car lst) (remove_duplicates (vl-remove (car lst) (cdr lst))))
        (cons (car lst) (remove_duplicates (cdr lst)))
        )
      )
    )

  (defun prompt_list ()
    (setq final (remove_duplicates (apply 'append (mapcar '(lambda (a b) (if (eq "1" a) b)) var l))))
    (if (eq "0" (last var))
      (setq final (vl-remove-if '(lambda (a) (wcmatch a "*|*")) final))
      )
    (if final (setq final (acad_strlsort final)))
    (start_list "a_list")
    (mapcar 'add_list final)
    (end_list)
    )

  (setq prop   '((LayerOn . 0) (Freeze . -1) (Lock . -1) (Plottable . 0))
        labels '("OFF Layers" "Frozen Layers" "Locked Layers" "UnPlottable Layers" "Xrefs Layers")
        keys   '("tog1" "tog2" "tog3" "tog4" "tog5")
        l      '(nil nil nil nil)
        )

  (vlax-for la (setq layers (vla-get-layers acDoc))
    (setq l (mapcar
              '(lambda (a b)
                 (if (= (vlax-get la (car a)) (cdr a))
                   (cons (vla-get-Name la) b)
                   b
                   )
                 )
              prop
              l
              )
          )
    )
  (setq l (reverse (cons (vl-remove-if '(lambda (a) (eq (strcase a) "DEFPOINTS")) (last l))
                         (cdr (reverse l))
                         )
                   )
        )

  (if (vl-some 'vl-consp l)
    (progn
      (setq filew (open (setq filen (strcat (getvar 'dwgprefix) "temp_layer_dialog.dcl")) "w"))
      (write-line
        "layer_on_dialog : dialog { label = \"SELECT LAYERS\";
       : row {
       : list_box { label = \"Layer List\"; key = \"a_list\"; width = 30; height = 15; multiple_select = true; allow_accept = true;}
       : column {
       : boxed_column { label = \"Properties\"; fixed_height = true;  alignment = top;"
        filew
        )
      (mapcar
        '(lambda (a b c)
           (if c
             (write-line (strcat "       : toggle { label = \"" a "\";    key = \"" b "\"; }") filew)
             )
           )
        labels keys (append l '(T))
        )
      (write-line "       }: button { label = \"Select all\"; key = \"selall\"; alignment = bottom;}
       }}ok_cancel;}" filew)
      (close filew)

      (if
        (>= (setq id (load_dialog filen)) 0)
         (if
           (new_dialog "layer_on_dialog" id)
            (progn
              (setq var (subst "0" nil (read (cond ((getenv "layer_dialog_box_settings")) ("(\"1\" \"0\" \"0\" \"0\" \"0\")")))))
              (prompt_list)
              (action_tile "a_list" "(setq selected_layers $value)")
              (action_tile "selall" "(set_tile \"a_list\" (setq selected_layers (apply 'strcat (mapcar '(lambda (a) (strcat (itoa (vl-position a final)) \" \")) final))))")
              (mapcar
                '(lambda (a b)
                   (if b
                     (progn
                       (action_tile
                         a
                         "(setq var (mapcar 'get_tile keys) selected_layers nil) (set_tile \"a_list\" \"\") (prompt_list)"
                         )
                       (set_tile a (nth (vl-position a keys) var))
                       )
                     )
                   nil
                   )
                keys
                (append l '(T))
                )
              (setq r (start_dialog))
              (unload_dialog id)
              (if var
                (setenv "layer_dialog_box_settings" (vl-prin1-to-string var))
                )
              )
            (princ "\nWrong dialog definition")
            )
         (princ "\nDCL file not found")
         )
      (if (findfile filen) (vl-file-delete filen))
      (if
        (and (= r 1) selected_layers)
        (progn
          (foreach x (read (strcat "(" selected_layers ")"))
            (mapcar
              (function
                (lambda (a b c)
                  (if
                    (and
                      (eq "1" c)
                      (vl-position (setq l_name (nth x final)) a)
                      )
                    (vlax-put (vla-item layers l_name) (car b) (- (1+ (cdr b))))
                    )
                  )
                )
              l
              prop
              var
              )
            )
          (if
            (or
              (eq (nth 1 var) "1")
              (eq (nth 2 var) "1")
            )
            (vla-regen acDoc acActiveViewport)
          )
        )
      )
    )
    (princ "\nAll layers are on and plottable.")
    )
  (*error* nil)
  (princ)
  )
Posted in AutoLISP, AutoLISP XREFs, AutoLISP: Manage, AutoLISP: Modify, Layers | 1 Comment