XREF Load Status App Review

The app mentioned in this post saved my sanity while opening drawings that contained a large amount of XREFs (External References). The “XREF Load Status” app is available from the Autodesk Exchange Apps store in a free version that will only work with XREFs that are .dwg files or a paid version that will work with XREFs that .dwg, .DGN and various image files. I spent the $5 for the full version since I knew that I would be dealing with various file types from time to time. I usually don’t do a review like this but this app needs deserves it.

The app is made by RedTransit Consultants. They have other apps available and also services to develop custom apps as well.

The project that I used this app on had a ridiculous amount of XREFs some of which were huge. Some files referenced over 140 other files and the disk size was well over 350 megabytes and it took multiple minutes to open. And the thing is that maybe the only edit that was needed to be made was a text edit or Attribute edit.

That’s where this app came in to save the day.

Shown below is a well known file that contains multiple XREFs. Lets say you wanted to be able to control which XREFs will open when you open your file. With this app you can control this – it could be a few XREFs or none…

XRLS 1

 

After installing the XREF Load Status APP, it should appear under the “Plugins” tab of the ribbon. Click to start.

Note that you should launch the app from another drawing or in a blank drawing. Basically, you are controlling the XREFs in a drawing without being in that drawing…

XRLS 2

Once the tool starts, you will see the dialog box shown below.
Click the long button  that says “Select Drawing File to Open…

XRLS 3

Navigate to the file and select it and click open:

XRLS 4

The drawing’s XREFs will display in the dialog box and the various option of how the XREFs are loaded will be shown.

Note that the current “Load Status” is shown under the corresponding sides of the dialog box. Files in the left column are not currently loaded (UNLOADED) and the files in the right side are currently loaded

There are a few choices to help you select which XREFs are loaded or unloaded:

  • Sort Ascending – will sort the list of XREFs in alphabetical order
  • Check All – will check all of the check-boxes in the list
  • Clear All – unchecks all of the check-boxes in the list
  • Invert All Toggles – Will let you easily switch the checks in the check-boxes. This is great becasue otherwise you would have to use the select all button and then go through and deselect the XREFs that you want loaded. So – to use this option, you go through the list of XREFs and check the ones that you want loaded and then click this button to “invert” those selections.

Once you have made your selections, you are given the choice of what to do with these changes, You can simply save these setting in that file without opening it and move on to the next one, or you can apply these settings and open the file.

XRLS 5

 

Shown below is a list of the XREFs that are “Unloaded”

XRLS 7

The drawing shown below is the file with all of the XREFs not being loaded upon opening.

XRLS 8

 

~enjoy

Posted in Customization, XREFs | Leave a comment

AutoLISP: Closed Objects to Wipeout updated

It has been a while since using this LISP routine, but apparently the routine that was posted a couple of years ago (found here: http://autocadtips.wordpress.com/2011/05/28/autolisp-objects-2-wipeout/) and written by Giles Chanteau stopped working in newer releases of AutoCAD because it now needs to call upon a different .ARX file (AutoCAD Runtime eXtension).

OB2WO 3

The LISP routine creates a wipeout object from selecting a closed object. This might not seem like a big deal since you can do the same thing with the WIPEOUT command, but this routine lets you select closed curved objects with the exception of SPLINE objects.

Here’s how:

  • Load the code below
  • Use OB2WO <enter> in the command line to start.
  • Select  a closed object whose shape from which you would like to create a wipeout (Circle, Ellipse, Closed Polyline with or without arc segments).

OB2WO 4

  • After selecting the object, you are asked if the object that you selected should be erased after the wipeout is created. By default, “No” is selected and the object will remain and the wipeout that is created is placed on the current layer. so make sure that the layer you want it on is set current,
Hatch with various shapes covering the hatch

Hatch with various shapes covering the hatch

The above picture shows a Hatched area with some curved closed shapes.

Shown below, The wipeouts have been created and the original selected object remains.

OB2WO 2

 

Thanks to Giles Chanteau for his routines and for his presence on the various forums always willing to ask and answer question in a pleasant manner, Thanks again Giles

~Greg


;;; OB2WO (gile) -Gilles Chanteau- 10/03/07
;;; Creates a "Wipeout" from an object (circle, ellipse, or polyline with arcs)
;;; Works whatever the current ucs and object OCS
;;; http://forums.autodesk.com/t5/Visual-LISP-AutoLISP-and-General/wipeout-with-arcs/m-p/786490#M12148

(defun c:ob2wo (/ ent lst nor)
  (vl-load-com)
  (if (and (setq ent (car (entsel)))
	   (member (cdr (assoc 0 (entget ent)))
		   '("CIRCLE" "ELLIPSE" "LWPOLYLINE")
	   )
	   (setq lst (ent2ptlst ent))
	   (setq nor (cdr (assoc 210 (entget ent))))
      )
    (progn
      (vla-StartundoMark
	(vla-get-ActiveDocument (vlax-get-acad-object))
      )
      (makeWipeout lst nor)
      (initget "Yes No")
      (if
	(= (getkword "\nDelete source object? [Yes/No] <No>: ")
	   "Yes"
	)
	 (entdel ent)
      )
      (vla-EndundoMark
	(vla-get-ActiveDocument (vlax-get-acad-object))
      )
    )
  )
)


;;; ENT2PTLST
;;; Returns the vertices list of the polygon figuring the curve object
;;; Coordinates defined in OCS

(defun ent2ptlst (ent / obj dist n lst p_lst prec)
  (vl-load-com)
  (if (= (type ent) 'ENAME)
    (setq obj (vlax-ename->vla-object ent))
  )
  (cond
    ((member (cdr (assoc 0 (entget ent))) '("CIRCLE" "ELLIPSE"))
     (setq dist	(/ (vlax-curve-getDistAtParam
		     obj
		     (vlax-curve-getEndParam obj)
		   )
		   50
		)
	   n	0
     )
     (repeat 50
       (setq
	 lst
	  (cons
	    (trans
	      (vlax-curve-getPointAtDist obj (* dist (setq n (1+ n))))
	      0
	      (vlax-get obj 'Normal)
	    )
	    lst
	  )
       )
     )
    )
    (T
     (setq p_lst (vl-remove-if-not
		   '(lambda (x)
		      (or (= (car x) 10)
			  (= (car x) 42)
		      )
		    )
		   (entget ent)
		 )
     )
     (while p_lst
       (setq
	 lst
	  (cons
	    (append (cdr (assoc 10 p_lst))
		    (list (cdr (assoc 38 (entget ent))))
	    )
	    lst
	  )
       )
       (if (/= 0 (cdadr p_lst))
	 (progn
	   (setq prec (1+ (fix (* 25 (sqrt (abs (cdadr p_lst))))))
		 dist (/ (- (if	(cdaddr p_lst)
			      (vlax-curve-getDistAtPoint
				obj
				(trans (cdaddr p_lst) ent 0)
			      )
			      (vlax-curve-getDistAtParam
				obj
				(vlax-curve-getEndParam obj)
			      )
			    )
			    (vlax-curve-getDistAtPoint
			      obj
			      (trans (cdar p_lst) ent 0)
			    )
			 )
			 prec
		      )
		 n    0
	   )
	   (repeat (1- prec)
	     (setq
	       lst (cons
		     (trans
		       (vlax-curve-getPointAtDist
			 obj
			 (+ (vlax-curve-getDistAtPoint
			      obj
			      (trans (cdar p_lst) ent 0)
			    )
			    (* dist (setq n (1+ n)))
			 )
		       )
		       0
		       ent
		     )
		     lst
		   )
	     )
	   )
	 )
       )
       (setq p_lst (cddr p_lst))
     )
    )
  )
  lst
)


;;; MakeWipeout creates a "wipeout" from a points list and the normal vector of the object

(defun MakeWipeout (pt_lst nor / dxf10 max_dist cen dxf_14)
  (if (not (member "acismui.arx" (arx)))
    (arxload "acismui.arx")
  )
  (setq	dxf10 (list (apply 'min (mapcar 'car pt_lst))
		    (apply 'min (mapcar 'cadr pt_lst))
		    (caddar pt_lst)
	      )
  )
  (setq
    max_dist
     (float
       (apply 'max
	      (mapcar '- (apply 'mapcar (cons 'max pt_lst)) dxf10)
       )
     )
  )
  (setq cen (mapcar '+ dxf10 (list (/ max_dist 2) (/ max_dist 2) 0.0)))
  (setq
    dxf14 (mapcar
	    '(lambda (p)
	       (mapcar '/
		       (mapcar '- p cen)
		       (list max_dist (- max_dist) 1.0)
	       )
	     )
	    pt_lst
	  )
  )
  (setq dxf14 (reverse (cons (car dxf14) (reverse dxf14))))
  (entmake (append (list '(0 . "WIPEOUT")
			 '(100 . "AcDbEntity")
			 '(100 . "AcDbWipeout")
			 '(90 . 0)
			 (cons 10 (trans dxf10 nor 0))
			 (cons 11 (trans (list max_dist 0.0 0.0) nor 0))
			 (cons 12 (trans (list 0.0 max_dist 0.0) nor 0))
			 '(13 1.0 1.0 0.0)
			 '(70 . 7)
			 '(280 . 1)
			 '(71 . 2)
			 (cons 91 (length dxf14))
		   )
		   (mapcar '(lambda (p) (cons 14 p)) dxf14)
	   )
  )
)
Posted in AutoLISP: Creating, AutoLISP: Modify, AutoLISP: Polylines, Wipeouts | 6 Comments

Missing Hatch Ribbon or Dialog Box setting

Hatch Ribbon 1The hatch ribbon has become the “norm” for the last couple of releases of AutoCAD but you may have switch how you place and edit hatches to the legacy dialog box version. But what happens if you switch to the dialog box version and then want the Hatch “contextual ribbon” back?

Tip: a “Contextual Ribbon” is a ribbon tab that appears only when a particular command is being used or particular object. Another example of a Contextual Ribbon tab is while placing MTEXT (Use the alias T <enter> to place MTEXT…)

Tip 2: From within the Hatch contextual ribbon, you can open the Hatch dialog box by clicking the diagonal arrow in the “Options” panel (shown below)

Hatch Dialog 2

 

The system variable that controls which version (ribbon or dialog box) is HPDLGMODE (shown below).

The out-of-the-box setting which displays the contextual ribbon is <2>

 

 

 

Out of the box Hatch ribbon 1

 

~enjoy

Posted in BASICS, Hatch | 1 Comment

Rotate Objects to Reference an Angle

The Rotate command can be used to match an angle of an existing object or allow you to input an angle.

Rotate_Reference_1

 

This tip is especially helpful when you don’t know the angle of the objects. maybe all you know is that the objects need to be rotated to match something else…

Here’s how:

Start the ROTATE command.
The alias to start the command is RO <enter>

Rotate_Reference_2

Select The objects that need to be rotated.

Hit <enter> when finished

Tip: You can Start the Rotate command from the right-click menu. Simply select the objects and then right-click and select “Rotate” Also note the other command that are available from this menu.

Rotate_Reference_1a

Specify the base point for the rotation. The base point is the pivot point that the objects will rotate around.

Rotate_Reference_3

 

Use the sub-option “Reference” of the command by either selecting the blue R in the command line or by using R <enter>

Then pick 2 points to define the angle of the objects. This angle will match the angle in the next step.

 

Rotate_Reference_6

Use the sub-option “Points” by clicking the blue P or by using P <enter> in the command line.

Pick 2 points to define the angle for the rotated objects.

Note: The order of the picked points from the “Reference” option will match the order of the “Points” option of the command.

Rotate_Reference_4

 

The result will be similar as shown below:

Rotate_Reference_5

 

 

Tip: The hot-grip method of the “Rotate” command does not have the “Points” sub-option of the command so it will help have the same result.

Just in case you don’t know how to start the hot-grip method:
The hot grip method lets you start some command without entering a command. You simply select the objects and then click on any grip. Notice how it becomes red? This is a “hot-grip.” Now if you right click, you see a limited (and different) right click menu. You can start other command from this menu.

Rotate_Reference_1b

Posted in BASICS, Modifying, TIPS | 11 Comments

AutoLISP: Convert 2D Solid to Polyline Outline

Since 2D solids aren’t very friendly after you place them and are hard to edit, you may need find this tool helpful for converting the solid into a polyline that represents the outline of the solid.

An example of its use is editing existing drawings… I have been adjusting blocks from an older block library where some parts of the blocks contain “arrowheads” but they are really just 2D solids. This is helpful so that the users don’t actually snap to these arrows. But a few of them no longer conform to our new CAD standards and sadly, some of the geometry was drawn incorrectly. So I have been using this routine to adjust these stubborn objects.

Here’s how:

  • OUTLINESOLID <enter>
  • Select the 2D Solid
Convert 2D Solid to Polyline

Convert 2D Solid to Polyline


;;; Select a 2D solid and this will delete the solid and replace its outline with a polyline
;;; http://forums.autodesk.com/t5/Visual-LISP-AutoLISP-and-General/Solid-object-to-Polyline/td-p/783079
;;; Posted By: Schamenek, Alex
(defun c:outlinesolid(/ solid pt1 pt2 pt3 pt4)
   (prompt "\nPlease select the solid you want to outline.")
   (WHILE (NOT (setq solid (ssget ":S" '((0 . "SOLID")))))
      (prompt "\nPlease select the solid you want to outline."))
      (SETQ pt1 (cdr (assoc 10 (entget (ssname solid 0))))
         pt2 (cdr (assoc 11 (entget (ssname solid 0))))
         pt3 (cdr (assoc 12 (entget (ssname solid 0))))
         pt4 (cdr (assoc 13 (entget (ssname solid 0))))
       );SETQ
   (COMMAND "_.PLINE" PT1 PT2 PT4 PT3 "C")
   (command ".erase" solid "")
);DEFUN
Posted in AutoLISP, AutoLISP: Modify, AutoLISP: Polylines | 8 Comments

View Fonts Used in Styles Without Opening A Drawing

Continuing the previous blog post concerning how to control what font is being used as the “Standard” text style – One issue that has come up is that upon opening a drawing that has the “Standard” text style defined as something other than what your machine has it set as, the text in the drawing is being changed  before the user has any control over it. Therefore they might not even know what the initial font was set as when the drawing was sent to them.

One way to check this is to use the Reference Manager tool that installs with AutoCAD.

This tool lets you see what a file’s needed references are and repath them if they are located in a different location without opening the file. (XREFs, .ctb files, Printer Configuration files [.pc3] fonts…

Here’s how:

Open the Reference Manager tool

Start > All Programs > Autodesk >  AutoCAD (version) > Refernce Manager

Opening the Reference Manager

Opening the Reference Manager

Upon opening, You are prompted to load all references (nested) or only the top level of references. If all you want to see is the drawing in question and it doesn’t have any references, use the bottom option.

Reference Manager Prompt

Reference Manager Prompt

When the Reference Manager loads – Simply “Add Drawings” and navigate to the drawing you need more information about. After “adding” the drawing. Notice that the font and the corresponding Text Style are shown. Simply jot this down and you now know what font goes with what Style.

Reference Manager for Text Style Fonts 2

 

Posted in Customization, Manage, Text, TIPS | 2 Comments

Change the “Standard” Font in AutoCAD Template

Some drafting standards require a text “font” that is something other than the “Arial” font, yet AutoCAD seems to keep reverting back to this font even after changing what font the text style is using. Some people almost have conniption fits because their text keeps changing…

Shown below: “Standard” text style using Arial.ttf

Standard Style using Arial.ttf

Standard Style using Arial.ttf

One reason is that the default acad.dwt  that is used for new drawings has this font defined for the “Standard” style. My first suggestion would be to not use a style named “Standard” as this can cause obvious conflicts. But even if you have no control over this, you can try the following:

Navigate to your AutoCAD Template folder and locate the “acad.dwt” file – The below screen shot is of the AutoCAD 2014 template folder.

AutoCAD 2014 Template location

AutoCAD 2014 Template location

Copy the file to another location as a back up in case something goes wrong.

Rename the file so that it is “acad.dwg” not a “.dwt” file

change file type to .dwg

change file type to .dwg

Open the in AutoCAD and change the Text Style in the “Text Style Manager” by using the command ST <enter>

Change the “Standard” style to the desired font under the “Font Name:” dropdown list.

Standard Style Set to "RomanS.shx"

Standard Style Set to “RomanS.shx”

  • Save and close the drawing. Note: Prior to closing, you may want to “SAVEAS” to an earlier version so that other AutoCAD users that use older version of AutoCAD can use this same file.
  • Change the file type from .dwg to .dwt so that it is once again a template file
  • Place the “acad.dwt” file back in the support folder.
Posted in Customization, Manage, Text, TIPS | 5 Comments