Turn On CADWorx Ribbon Tabs and Menu Bar

If you have lost your CADWorx Ribbon tabs or Menus (from the menu bar) you can simply load them by using the following in the command line:


CADWorx ribbon tabs and menu

CADWorx 2013 and AutoCAD 2013 are shown in the above pic

For loading the CADWorx Equipment palette or toolbars see the following post: https://autocadtips.wordpress.com/2013/06/21/cadworx-equipment-palette/

A friend of mine also has a great blog post explaining how to load both the CADWorx Plant and Equipment modules in the same session found here: http://streamlined-design.blogspot.com/2013/07/use-acadrx-to-load-cadworx-plant-and.html

Please keep the Streamlined Design blog in mind for some terrific advanced AutoCAD customization tips & techniques for CAD managers and CAD admins. There are also some .NET programming examples available


Posted in CADWorx, Manage | Leave a comment

AutoCAD List of Command Aliases and Shortcut Keys

Today’s tip is simply a link to an excellent AutoCAD alias and shortcut reference guide provided by Autodesk & The AutoCAD team.

The link is found here: http://www.autodesk.com/store/autocad/autocad-shortcuts

I highly recommend learning command aliases like using XR in the command line instead of XREF or W instead of WBLOCK.

Note: There are many other useful examples in the linked resource. So don’t get overwhelmed or try to memorize all of them. If I could make a suggestion, skim the list of aliases or hot keys for the commands or tools that you use the most in your daily drafting routines and make a note of a few of them and try to utilize a couple one day at a time.

One more thing to note is that these are the default (out of the box) shortcuts and command aliases. Once you are comfortable with some of these default shortcuts you might realize that there are some default aliases that since they are assigned to an existing command. Luckily you can easily create brand new aliases and assign them to a command or you can assign an unused alias to a command.

A couple of examples of custom aliases that I use are CC = COPY, RR = ROTATE, SS = SELECTSIMILAR.

These aliases can be edited in the “Alias Editor” which appends the acad.pgp file.

For more help in running the ALIASEDIT command, refer to this previous post: https://autocadtips.wordpress.com/2010/11/06/system-variables-dialog-box/



Thank you to the AutoCAD team for making this list of shortcuts & aliases available in such an easy and thorough format.


Posted in Uncategorized | 11 Comments

Creating A Data Link With An Excel Table

Linking an Excel spread sheet to an AutoCAD drawing and displaying the excel table as an AutoCAD  “Table” is very helpful depending on how you “link” the Excel file to the AutoCAD table.

In this post, I describe how to make an AutoCAD “Data Link” first, and then inserting a table using this Data Link.

I have seen a few examples where using other methods have cause issues. So after testing various ways, I think that this method is a solid method.

In this scenario, we have engineers who need to update a drawing list that happens to be an excel file (.xlsx) and they would like to link this to AutoCAD so that when they make changes to the table, those changes are included in the AutoCAD file.


First we need to make a “Data Link”

Click the “Data Link” button on the “Linking & Extraction” panel of the “Insert” tab of the ribbon.

Data Link 1

  • When the “Data Link Manager” opens, click “Create a new Excel Data Link
  • Give the Data Link a unique name
  • Then click OK

Data Link 2


  • Now link the “Data Link” to an excel file by clicking the ellipsis button ( 3 dot button)
  • Navigate to the Excel file and select it
  • Then click “Open

Data Link 3


The dialog box called ” New Excel Data Link” will display and an additional preview is now shown in the bottom portion.

One very important thing to note about this Dialog Box is to expand it by clicking the right arrow. This allows for additional formatting options for the AutoCAD Table.

Data Link 4


Now you will insert an AutoCAD Table (shown below)

When the “Insert Table” dialog box displays, click “From a data link

Select the Data Link that you named earlier from the drop down list

Then click OK

Data Link 5


Place the table in the drawing

After the table has been placed, you should be good to go.

Lets say that an engineer updates the Excel spreadsheet. You will either get the below notification when the person has saved and checked in the file or the next time you open the drawing.

Data Link Update


The AutoCAD table will not update by itself, you will need to update it manually.

To do this:

  • Place the cursor in a cell of the table
  • Click the “Download from Source” button in the ribbon

Data Link 6


There are many other options available while placing a Data-Linked table so please look further in to this topic to meet your needs. This is a high-level look at adding a data link table to a drawing.



Posted in Tables, TIPS | 16 Comments

Changing A Block Insertion Point

You may come across blocks in a drawing where either the insertion point of the block doesn’t meet your needs. Hopefully this post will help you save some time editing your block and also there’s an added bonus, I will show you how to add extra insertion points to your block – Yes, you can have multiple…

In the picture below, the scenario is that I have multiple instances of a block that contains attributes and the insertion point for this block is located at an odd location.

Block Insertion Points 1


Without exploding the block and then recreating it, I suggest using the “Block Editor”

You can use the BEDIT command ( or command alias BE )and select the block from the list. Or an easier way is to:

  • Simply select an instance of the block that you would like to edit
  • Right click
  • Select “Block Editor”

Block Insertion Points 2


As you can see, the “Block Editor” option is greyed out which means that I am unable to use the block editor. And as shown below, when I use the BEDIT command, the command line says that the “Block Editor is disabled.”

Block Insertion Points 3


This okay, there is an AutoCAD system variable (setvar) that many CAD managers set that prevents users from editing blocks.

The AutoCAD system variable is BLOCKEDITLOCK (shown below) and has a very simple On & Off setting

Block Insertion Points 4


As shown below, simply enter BLOCKEDITLOCK in the command line and set it to 0 (zero) to allow the block editor to be used.

Block Insertion Points 5

  • You can now select your block and right click and select “Block Editor.”

Your block will now open in the magical world of the block editor.
Notice that the background color is different (grey) which is good so that you remember that you are in the block editor and not in a drawing space (model or paper).
Also note that the current ribbon tab is a “contextual tab” called “Block Editor” and the tools in this tab are helpful for editing blocks and that there is a palette called the “Block Authoring Palette”

One important thing to notice is that when you want to exit the block editor, the furthest right button on the tab labeled “Close Block Editor” is what you want to use.

Block Insertion Points 6


Selecting all of the objects in the block editor, I will now move them using the MOVE command to orient the desired “main” insertion point to 0,0 (shown below)

Block Insertion Points 7


If moving the insertion point is all that you need done to a block, you can now use the “Close Block Editor” button and click “Save changes…” so that the block will reflect the moved insertion point.

To add another (or multiple) insertion point(s) to the block:

  • Click on the “Parameters” tab of the palette
  • Click “Point” from the palette
  • Click to place the new point
  • Move the cursor away from the point you just picked, and place the “Parameter”
    (Note: usually when you place something from the “Parameters” tab, you need to also apply an action to that “parameter.” This is usually how you make a dynamic block. but placing these extra points alone, requires no other “actions” to be applied to make it “dynamic” for our purpose)

Block Insertion Points 8



  • Click “Close Block Editor
  • Click “Save the changes to (your block name)

Block Insertion Points 9Because our block has attributes, you might notice that the attributes didn’t move. This is because when the block was created, the “Lock Position” option was set to “Yes” when the Attribute was created.

Block Insertion Points 10


To fix this, Use the ATTSYNC command which can be found on the “Insert” tab of the ribbon > “Block Definition” panel drop down > Click on “Synchronize

  • Select the block that needs to be “synced”
  • Verify that you would like to sync the block by selecting Yes

Block Insertion Points 11


Now that the block is ready for use, you can make use of those extra insertion points by using the INSERT command (or command alias I )

  • Select the name of the block from the list to insert
  • Prior to placing the block, use the CTRL key to toggle through the various insertion points.

Block Insertion Points 12


Posted in Blocks, Manage, Modifying | 4 Comments

AutoLISP: ReOrder Polyline Origin

Taking into consideration the previous posts about determining the origin of a closed polyline, Finding the direction of a polyline and being aware that the REVERSE command will change the origin of a closed polyline – the LISP file in this post will help you have control of defining the “Origin” or first vertex of a polyline. And as a bonus, it even works on 3D Polylines.

Here’s how:

  • Load the lisp file
  • REORDERPOLY [enter]
  • Select the polyline
  • Click an endpoint to define the new origin

ReOrder Polyline Origin


3D Polyline shown below


ReOrderPoly 3D Poly

;;; T Willey
;;; Re Order Polyline Origin
;;; http://www.theswamp.org/index.php?topic=12624.msg154976#msg154976
(defun c:ReOrderPoly (/ Sel Pt Pobj EntData Ptype PtList VertexPt PtListIndex StWd EndWd PolyList OldIndex StPos cnt
                        tmpList ShouldClose)

(defun ChangeOldStyle (Ent Pt / Pent cnt EntData PolyInfoList StPos StPt ShouldClose)

(setq Pent Ent)
(setq cnt 0)
  (setq Ent (entnext Ent))
  (setq EntData (entget Ent))
  (= (cdr (assoc 0 EntData)) "VERTEX")
 (setq PolyInfoList
    (cdr (assoc 10 EntData))
    (cdr (assoc 42 EntData))
    (cdr (assoc 40 EntData))
    (cdr (assoc 41 EntData))
 (if (equal cnt 0)
  (setq StPt (cdr (assoc 10 EntData)))
 (setq cnt (1+ cnt))
 (setq ShouldClose (equal StPt (cdr (assoc 10 EntData)) 0.0001))
(foreach Lst PolyInfoList
 (if (equal Pt (cadr Lst))
  (setq OldIndex (car Lst))
(setq PolyInfoList (reverse PolyInfoList))
(setq StPos (vl-position (assoc OldIndex PolyInfoList) PolyInfoList))
(setq cnt StPos)
(setq Ent Pent)
  (setq Ent (entnext Ent))
  (setq EntData (entget Ent))
  (= (cdr (assoc 0 EntData)) "VERTEX")
 (setq EntData (subst (cons 10 (cadr (nth cnt PolyInfoList))) (assoc 10 EntData) EntData))
 (setq EntData (subst (cons 42 (caddr (nth cnt PolyInfoList))) (assoc 42 EntData) EntData))
 (setq EntData (subst (cons 40 (cadddr (nth cnt PolyInfoList))) (assoc 40 EntData) EntData))
 (setq EntData (subst (cons 41 (last (nth cnt PolyInfoList))) (assoc 41 EntData) EntData))
 (entmod EntData)
 (setq cnt (1+ cnt))
 (if (> cnt (1- (length PolyInfoList)))
  (setq cnt 0)
(if ShouldClose
  (setq EntData (entget Pent))
  (entmod (subst '(70 . 1) (assoc 70 EntData) EntData))
(entupd Pent)
(command "_.undo" "_end")
(command "_.undo" "_group")
  (setq Sel (entsel "\n Select polyline: "))
  (setq Pt (getpoint "\n Select new starting point: "))
  (setq Pobj (vlax-ename->vla-object (car Sel)))
  (setq EntData (entget (car Sel)))
  (wcmatch (setq Ptype (cdr (assoc 0 EntData))) "*POLYLINE")
 (if (= Ptype "POLYLINE")
  (ChangeOldStyle (car Sel) Pt)
   (setq PtList (vlax-get Pobj 'Coordinates))
     (= (vla-get-Closed Pobj) :vlax-false)
     (equal (car PtList) (nth (- (length PtList) 2) PtList) 0.0001)
     (equal (cadr PtList) (last PtList) 0.0001)
    (setq ShouldClose T)
   (setq VertexPt 0)
   (setq PtListIndex 0)
   (repeat (/ (length PtList) 2)
    (vla-GetWidth Pobj VerTexPt 'StWd 'EndWd)
    (setq PolyList
        (nth PtListIndex PtList)
        (nth (1+ PtListIndex) PtList)
       (vla-GetBulge Pobj VertexPt)
    (setq VertexPt (1+ VertexPt))
    (setq PtListIndex (+ 2 PtListIndex))
   (foreach Lst PolyList
    (if (equal (list (car Pt) (cadr Pt)) (cadr Lst))
     (setq OldIndex (car Lst))
   (setq VertexPt 0)
   (setq PtList nil)
   (setq PolyList (reverse PolyList))
   (setq StPos (vl-position (assoc OldIndex PolyList) PolyList))
   (setq cnt StPos)
   (repeat (length PolyList)
    (setq tmpList (nth cnt PolyList))
    (setq PtList (append PtList (cadr tmpList)))
    (vla-SetBulge Pobj VertexPt (caddr tmpList))
    (vla-SetWidth Pobj VertexPt (cadddr tmpList) (last tmpList))
    (setq VertexPt (1+ VertexPt))
    (setq cnt (1+ cnt))
    (if (> cnt (1- (length PolyList)))
     (setq cnt 0)
   (vlax-put Pobj 'Coordinates PtList)
   (if ShouldClose
    (vla-put-Closed Pobj :vlax-true)
(command "_.undo" "_end")


Posted in AutoLISP, AutoLISP: Modify, AutoLISP: Polylines, Polylines | Leave a comment

Reverse Polyline Moves Origin

Today’s tip is more of a “head’s up” to be aware of when using the REVERSE command on a closed polyline.

The Reverse command will reverse the direction of selected objects. What is reversed is the direction or the order of the way that the objects were drawn.

You can use the command REVERSE to launch this command or it is located on the ribbon on the Home tab > Modify Panel > Reverse (shown below)

Reverse Command on Ribbon


You can find the “origin” of a polyline by selecting the polyline, then right-click and select “Properties” to open the properties palette.

Click inside “Current Vertex” section of the palette. The first vertex will have a temporary marker “X” on-screen at the “origin.”

Polyline Vertex Reverse 1


When you click on the up or down arrows of the “Current Vertex” section, you will see the direction of the polyline. clicking the Up arrows will show the direction in which the polyline was created. Clicking down will go backwards…

Polyline Vertex 3 initial direction


when using the Reverse command so that the direction is changed, note that the origin changes on closed polylines. This may not be a big deal for most situations but there are instances when each vertex is included in a report and its coordinates are included in the report. And maybe the person who drew the polyline drew the polyline in the wrong direction. Hopefully, this can be corrected by using the REVERSE command.

Below is the polyline as shown above and its origin after the reverse command is used on it. Notice that the origin changes.

Polyline Vertex Reverse 2


Polyline Vertex 4 After REVERSE command

Posted in Modifying, Polylines, TIPS | 2 Comments

AutoLISP: Polyline Direction preview

The simplicity of this routine is why I like it so much. You simply run the command and then select a polyline and it displays temporary arrows that show the direction of the polyline. Once you either zoom in or out, or even use RE [enter] for a REGEN, the temporary arrows will stop displaying.

All credit goes to Luis Esquival and RonJon from the.swamp.org for sharing and editing this routine.

Below – Various polylines have their directions shown

PolyLine Direction

As an extra bonus, this routine works on 3DPOLYLINEs. Even though the arrows aren’t exactly aligned, it is still nice to have a way to show the direction…

PolyLine Direction 3DPOLY


;; Original Code by Luis Esquival http://www.theswamp.org/index.php?topic=9441.msg169894#msg169894
;; Displays the direction of polylines with temporary arrows
;; Modified by RonJonP
;; http://www.theswamp.org/index.php?topic=35706.msg409414#msg409414
(defun getarcsegment (cen r fromvertex p2 / a1 a2 d)
  (if (and fromvertex p2)
    (progn (setq a1 (angle cen fromvertex)
		 a2 (angle cen p2)
	   (if (or (< a1 a2) (equal a1 a2 0.001))
	     (setq d (* r (- a2 a1)))
	     (setq d (* r (- (+ 6.2831853 a2) a1)))
    ;; is a circle
    (setq d (* r 6.2831853))

(defun getbulgedata (bulge fromvertex p2 / dir theta beta radio dat)
  (setq	dir   (cond ((minusp bulge) -1.0)
		    (t 1.0)
	theta (* 4.0 (atan (abs bulge)))
  (if (> theta pi)
    (setq theta	(- (* 2.0 pi) theta)
	  dir	(* -1.0 dir)
  (setq	theta (/ theta 2.0)
	radio (abs (/ (distance fromvertex p2) (* 2.0 (abs (sin theta)))))
	beta  (+ (angle fromvertex p2) (* (- (/ pi 2.0) theta) dir))
	pc    (polar fromvertex beta radio)
  (getarcsegment pc radio p2 fromvertex)

(defun getlwpolydata
       (vla_poly / name endparam param closed fromvertex p2 midp bulge vlist)
  (setq closed (vla-get-closed vla_poly))
  (setq endparam (vlax-curve-getendparam vla_poly))
  (setq param endparam)
  (setq i 0)
  (while (> param 0)
    (setq param (1- param))
    (setq fromvertex (vlax-curve-getpointatparam vla_poly i))
    (if	(vlax-property-available-p vla_poly 'bulge)
      (setq bulge (vla-getbulge vla_poly (fix i)))
    (setq nextvertex (vlax-curve-getpointatparam vla_poly (+ i 1)))
    (setq dis (distance fromvertex nextvertex))
    (setq midpt (vlax-curve-getpointatparam vla_poly (+ i 0.5)))
    (if	(and bulge (not (zerop bulge)))
      (progn (setq bulge (getbulgedata bulge fromvertex nextvertex))
	     (setq etype "ARC")
      (progn bulge (setq etype "LINE"))
;;;;;;    (if	(not :rcmPrefixArcText)
;;;;;;      (setq :rcmPrefixArcText "L="))
    (setq vlist	(cons (list ;; vertex number
			    (+ i 1)
			    ;; object type
			    ;; midpoint
			    ;; start vertex
			    ;; ending vertex
			    ;; curved or straight length
;;;;;;	       (if (= eType "ARC")
;;;;;;		 (strcat
;;;;;;		   :rcmPrefixArcText
;;;;;;		   (rtos bulge (rcmd-getUnits-mode) :rcmPrec))
;;;;;;		 ;; is straight
;;;;;;		 (rtos dis (rcmd-getUnits-mode) :rcmPrec))
    (setq i (1+ i))
  (reverse vlist)

(defun dib_flechdir (lst_dat / unidad angf dirf pfm pf1 pf2 pf3 pf4 pftemp)
  ;; set arrow length according to screen height
  ;; to draw the same arrows at any level of zoom
  (setq unidad (/ (getvar "VIEWSIZE") 15))
  (foreach dat lst_dat
    (setq angf (cadr dat)
	  dirf (caddr dat)
	  pfm  (polar (car dat) (+ angf (/ pi 2)) (* unidad 0.3))
	  pf1  (polar pfm (- angf pi) (/ unidad 2.0))
	  pf2  (polar pfm angf (/ unidad 2.0))
    (if	(= dirf 1)
      (setq pf3	(polar pf2 (- angf (/ (* pi 5.0) 6.0)) (/ unidad 4.0))
	    pf4	(polar pf2 (+ angf (/ (* pi 5.0) 6.0)) (/ unidad 4.0))
      (setq pftemp pf1
	    pf1	   pf2
	    pf2	   pftemp
	    pf3	   (polar pf2 (+ angf (/ pi 6.0)) (/ unidad 4.0))
	    pf4	   (polar pf2 (- angf (/ pi 6.0)) (/ unidad 4.0))
    (if	flag_dir
      (progn ;; draw green arrow
	     ;; when you are changing direction
	     (grdraw pf1 pf2 3)
	     (grdraw pf2 pf3 3)
	     (grdraw pf2 pf4 3)
      (progn ;; draw arrow
	     (grdraw pf1 pf2 4)
	     (grdraw pf2 pf3 4)
	     (grdraw pf2 pf4 4)
  (setq flag_dir nil)

;;; Command for test...
(defun c:PLD (/ pol obj pol_data)
  (setq	pol	 (car (entsel "\nSelect polyline: "))
	obj	 (vlax-ename->vla-object pol)
	pol_data (getlwpolydata obj)
    (setq lst_dat
	     (mapcar (function (lambda (i)
				 (if (nth 2 i)
				   (list (nth 2 i) (angle (nth 3 i) (nth 4 i)) 1)
Posted in AutoLISP, AutoLISP: Polylines, Polylines, TIPS | 5 Comments