The code posted below will purge all Page Setups except for the current page setup (if one is applied).
If you have ever received a drawing with many page setups this routine will help reduce the amount of setups that you have to navigate.
;; Function to delete all user plot set ups
;; Posted by; CAB @ http://forums.augi.com/showthread.php?63099-page-setup-import-vlisp
(defun c:Del_Pagesetups (/ curdwg pslayout x)
curdwg (vla-get-ActiveDocument (vlax-get-Acad-Object))
pslayout (vla-get-Layout (vla-get-PaperSpace curdwg))
) ;_ end of setq
;; Call RefreshPlotDeviceInfo before GetPlotDeviceNames
(vlax-for x (vla-get-Plotconfigurations curdwg)
) ;_ end of vlax-for
) ; End Plot_config_list
Not knowing what to call this routine, I think that it is more of a combination of an advanced Offset command that automates the placement of the vertices at the (M2P) Mid-Between-2-Points.
If you need an offset that is between 2 polylines and the 2 polylines are not truly parallel to each other, the result of the polyline might not be the desired result.
This process is automated by using this routine written by Alan Thompson and found at CADTutor: http://www.cadtutor.net/forum/showthread.php?73308-Multiple-Offsets&p=535978&viewfull=1#post535978
(Please refer questions or requests to the forum where the lisp routine was originally posted)
Note: that the output offers an option for the created polyline (LWPolyline or Polyline)
As an added bonus, the routine handles polylines that are at different elevations (z values) and it even handles 3DPolylines pretty well.
- LBL <enter> to start
- Select the 1st polyline
- Select the 2nd polyline
- Specify the output polyline (LWPoline or Polyline)
- RE <enter> or REGEN <enter> to get rid of the temporary dashed red lines
(defun c:LBL (/ foo AT:GetSel _pnts _pline _lwpline _dist e1 e2)
;; Draw (LW)Polyline between two selected curves (at midpoint of vertices).
;; Alan J. Thompson, 09.29.10
(defun foo (e)
(and (wcmatch (cdr (assoc 0 (entget (car e)))) "LINE,*POLYLINE,SPLINE")
(not (vlax-curve-isClosed (car e)))
(defun AT:GetSel (meth msg fnc / ent)
;; meth - selection method (entsel, nentsel, nentselp)
;; msg - message to display (nil for default)
;; fnc - optional function to apply to selected object
;; Ex: (AT:GetSel entsel "\nSelect arc: " (lambda (x) (eq (cdr (assoc 0 (entget (car x)))) "ARC")))
;; Alan J. Thompson, 05.25.10
(progn (setvar 'ERRNO 0)
(setq ent (meth (cond (msg)
("\nSelect object: ")
(cond ((eq (getvar 'ERRNO) 7) (princ "\nMissed, try again."))
((eq (type (car ent)) 'ENAME)
(if (and fnc (not (fnc ent)))
(princ "\nInvalid object!")
(defun _pnts (e / p l)
(cond ((wcmatch (cdr (assoc 0 (entget e))) "ARC,LINE,SPLINE")
(list (vlax-curve-getStartPoint e) (vlax-curve-getEndPoint e))
((wcmatch (cdr (assoc 0 (entget e))) "*POLYLINE")
(repeat (setq p (1+ (fix (vlax-curve-getEndParam e))))
(setq l (cons (vlax-curve-getPointAtParam e (setq p (1- p))) l))
(defun _pline (lst)
(if (and (> (length lst) 1)
(entmakex '((0 . "POLYLINE") (10 0. 0. 0.) (70 . 8)))
(foreach x lst (entmakex (list '(0 . "VERTEX") (cons 10 x) '(70 . 32))))
(cdr (assoc 330 (entget (entmakex '((0 . "SEQEND"))))))
(defun _lwpline (lst)
(if (> (length lst) 1)
(list '(0 . "LWPOLYLINE")
'(100 . "AcDbEntity")
'(100 . "AcDbPolyline")
(cons 90 (length lst))
(cons 70 (* (getvar 'plinegen) 128))
(mapcar (function (lambda (p) (list 10 (car p) (cadr p)))) lst)
(defun _dist (a b) (distance (list (car a) (cadr a)) (list (car b) (cadr b))))
(setq e1 (_pnts (car (AT:GetSel entsel "\nSelect first open curve: " foo))))
(setq e2 (_pnts (car (AT:GetSel entsel "\nSelect next open curve: " foo))))
(not (initget 0 "Lwpolyline Polyline"))
(setq *LBL:Opt* (cond ((getkword (strcat "\nSpecify line to draw: [Lwpolyline/Polyline] <"
((setq *LBL:Opt* "Lwpolyline"))
((if (eq *LBL:Opt* "Lwpolyline")
(mapcar (function (lambda (a b)
(if (and a b (not (grdraw (trans a 0 1) (trans b 0 1) 1 1)))
(mapcar (function (lambda (a b) (/ (+ a b) 2.))) a b)
(if (< (_dist (car e1) (car e2))
(_dist (car e1) (last e2))
This new feature is cool in many ways but one reason why is that I remember reading somewhere like the Augi wish list (http://www.augi.com/wishlist) or even on twitter that Jimmy B from http://www.jtbworld.com/ simply wished that he could easily select the layers from the Layer Proprieties manager and tell them to merge into another layer. And the next thing you know, that same feature shows up in AutoCAD 2014. So it is cool to know that Autodesk listens.
This new feature is really as simply as described above.
Open the Layer properties manager: LA <enter>
You can select a single layer or multiple layers. To select multiple layers use the normal multiple selection method either with the CTRL button or Shift button
Once the Layers are selected, right Click
Select “merge selected layer(s) to…”
Select the a layer from the pop-up box. These are layers that were not included in the selection of layers that you previously made because these are the “destination” layers. If you do not see your destination layer in this list, it is most likely because it was included in the selection of layers. So you will need to back up a little and re-select your layers. This time DON’T include the destination layer in the selection set.
Once you have selected a destination layer from the “Merge to Layer” dialog box, click OK
Then verify that the layer will be merged to the specified layer and click “Yes”
The result is that the Layers and all of their objects have been merged into the layer that you specified and the old layers have been purged from the drawing.
With AutoCAD 2014, the ARC command has a simple-but-needed improvement. By default in AutoCAD, arcs are created counter clockwise. With 2014 you can control the creation of arcs to be clockwise or counter clockwise by simply holding the CTRL button.
See below for a more detailed look:
Simply opening the Arc tool’s flyout, there isn’t any obvious, visible change.
The direction that arcs are created are controlled in the UNITS dialog box
Although the new ARC direction option is available in all of the various arc tools, the most practical and obvious uses of the new ARC direction option are found in the ARC options shown below.
In the picture below, the upper arc that is being created shows the default ARC direction. The lower arc shows the new ARC direction option by hold the CTRL button during the command
There are times when an image needs to be included in a drawing. For example, a client logo that needs to be part of the title block. It would be better to convert the logo into a block object by tracing over the image in AutoCAD and applying hatching as needed. But there are some logos that are not so simple and therefore using an embedded image is preferred.
If you have dragged and dropped the image into the drawing or used the OLE method, you realize that file is being referenced and therefore the separate picture file needs to be included when you send the file to the client.
Today’s tip shows how to bring the picture into a drawing so that it is not a reference and is therefore one less file to have manage…
Click here for original post: http://wp.me/p1aURt-uO
- Navigate to the picture file
- Right click on the file and select “edit”
- You could also open the picture in from the Windows Paint program
- Select either the whole picture by using Ctrl + A or select a portion of the picture by dragging a window over the area you would like to insert into your drawing.
- Copy the selected picture either using Ctrl + C or by clicking the Copy button
- To paste the image in AutoCAD, use the command PASTESPEC or click the “Paste Special” button found on the Home tab > Clipboard panel > Paste drop down list > “Paste Special”
- Accept the default option of “Paintbrush Picture” in the Paste Special dialog box
- Click OK
- Place the picture in the drawing and specify the scale
(In this example, the image is placed in paperspace)
- Verify that the image is not an XREF by entering XR <enter> or XREF <enter> in the command line