AutoLISP: ATTWIPE Clear Selected Attribute Values

Here is one that lets you easily clear the selected attribute tag(s).

This is especially helpful for when you are editing titleblocks that have populated attributes or when you copy a block (symbol) that already has attribute values already populated.

Here’s how:

(After loading of coarse)

  • ATTWIPE [enter]
  • Select the individual attributes that you would like to clear…
  • hit [enter] when finished to end the routine

ATTWIPE1

 


;; ------------------------------------------------------------------------------
;; AttWipe - © 2005 by Chuck Chauvin
;; Posted at: http://www.theswamp.org/index.php?topic=4934.0;all
;; Clears (wipes) the value of a selected attribute
;; ------------------------------------------------------------------------------
(defun C:AttWipe (/ AttSel AttLoc)
  
  (defun *error* (msg)
    (princ "\nInvalid selection.")
    (princ)
  );_ end defun *error*

  (defun SelectIt (msg)
  (setq AttLoc (cadr (setq AttSel (entsel (strcat "\nPick " msg " to wipe: ")))))
    );_ end defun SelectIt

  (defun WipeIt (/)
    (command "-attedit" "y" "" "" "" AttLoc "" "v" "r" "" "n")
    );_ end defun WipeIt

  (setvar "cmdecho" 0)
  
  (SelectIt "attribute")
  (WipeIt)
  (while AttSel
    (SelectIt "next attribute")
    (if	(= (type AttSel) 'list)
      (WipeIt)
      (setq AttSel nil)
      ) ;_ end if
    ) ;_ end while
  (princ)
  );_ end defun AttWipe
;; ------------------------------------------------------------------------------
Posted in Attributes, AutoLISP, AutoLISP: Attributes, Blocks, Modifying | Leave a comment

AutoCAD 2015 Purge DGN Junk

That’s right, I called it “Junk”.

Recently we have been experiencing excessive bloating of files because somewhere in our project someone has either referenced in a drawing that was opened with Microstation or they have copied in something from a drawing that was used by Microstation.

Below is an example of a drawing that was almost 14 megabytes in size and needed to email it to someone out “in the field” but because of its file size, it was too large to email.
PURGE DGN 1

 

When you start the PURGE command in AutoCAD 2015, you now have the option to purge “Orphaned data.” AutoCAD apparently handles Microstation linestyles and text styles differently so the info that defines these objects becomes “orphaned” and can bloat drawings severely.

Check the box as shown below

PURGE DGN 2

 

If you have any of this purge-able data, the progress of the purge will be shown in the lower right of the AutoCAD screen (shown below)

PURGE DGN 3

 

To purge the “Orphaned” DGN junk from your drawings using the command line version of PURGE command in a script or macro, use the O (letter O) after issuing -PURGE from the command line.

PURGE DGN 4

 

Note: after purging what could be a lot of data from a drawing, it is a good idea to AUDIT your drawing. In the command line, enter AUDIT [enter] Y [enter]

For more info about how to purge unused DGN info from your drawings, check out these links:

Autodesk’s hotfix for AutoCAD 2013 & 2014: http://knowledge.autodesk.com/support/autocad/downloads/caas/downloads/content/autocad-C2-AE-dgn-hotfix.html

Kean’s explanations:

http://through-the-interface.typepad.com/through_the_interface/2012/12/purging-unwanted-dgn-linestyle-data-from-an-autocad-drawing-using-net.html

http://through-the-interface.typepad.com/through_the_interface/2013/07/autocad-dgn-hotfix-now-available.html

Posted in AutoCAD 2015, Manage, New in 2015 | 1 Comment

Fix Install or Uninstall Errors

Here is a possible fix for fixing errors that might have occurred during an install of AutoCAD (or any other program) that is preventing you from doing a “repair” or “Re-install.”

Scenario: An issue that has happened at work a few times recently was that a user updated to a new version of AutoCAD but for some reason it doesn’t open. I would then check to see if the files seemed to be copied correctly and tried to manually launch the acad.exe but that didn’t work either. I then went to the computer’s “Control Panel” to do a “Repair” or “Reinstall” of the new version of AutoCAD. The version of AutoCAD seems to be listed in the list of programs but once it is selected, the “Control Panel” says that it can’t be repaired because there was an error during installation.

Once these frustrating steps were tried over and over again, the common fix was to have the user’s machine re-imaged so that a fresh install could be applied. That is, until we found this useful link from Microsoft: http://support.microsoft.com/mats/Program_Install_and_Uninstall

It is a free utility from Microsoft that finds errors of an install that will hopefully allow the program to be successfully uninstalled and then re-installed.

I hope that this utility can help

~Greg

Microsoft Repair 1

Posted in Manage, TIPS | 1 Comment

FLATSHOT In Action

We recently were given some 3D models by a subcontractor that needed to be incorporated into our drawings. There was one model in particular that was rather large in file size considering that it was only a small part of our overall design for the project. And to top it off, the 3D model from the subcontractor was to be placed about 11 times throughout the overall model. Even when the large file was brought into the drawing as an XREF, many of the AutoCAD designers experienced loading times of about 10 minutes.

The file size of the large model is almost 50 megabytes even after trying many methods to reduce its size. The method that we found that worked wonders was to use a FLATSHOT representation of the 3D model as a substitute for the 3D model.

Here’s how:

Below is a view of the piece of equipment that is 50 megabytes.

3D view of 50 megabyte file

3D view of 50 megabyte file

Below is a top view of the large file. This view is all that a majority of the designers needed to see in their drawings

Flatshot 2 Top View

The FLATSHOT command can be used at the command line or the tool can be found on the ribbon under the “3D Modeling” workspace under the “Home” tab > “Section” panel (dropdown) > “FLATSHOT

Note: that the view that is currently being shown on-screen will be used to produce the FLATSHOT version of the model. Think of this command as you orient your view of a 3D model and then take a picture with a camera. That picture is now the flattened 2d representation of the 3D model.
Keeping that in mind, if needed we could go to the side elevation views of the 3D model and produce FLATSHOT versions of those views so that they could be incorporated into someone’s drawing as well – thus reducing the time of opening the larger file.

Flatshot 3 Flatshot on ribbon

 

For this instance, I used the following settings to produce the FLATSHOT.

I suggest playing with the various settings to meet the needs of your particular project.

Flatshot  settings1

Once the FLATSHOT file is created it is a good idea to open the file and try to clean it up further. Some commands that might help are: OVERKILL, PURGE, JOIN, AUDIT

Below is a file size comparison of the large 3D model, the FLATSHOT version and the cleaned up FLATSHOT

Flatshot 4  File shize comparison

Now that we have a 2D version of the 3D model, the designers simply unload or detach the larger model from the XREF Manager in AutoCAD and load the FLATSHOT version.

Note: it is important to assign a person to take resposibility of keeping the 3D model and the FLATSHOT version in synch. If the 3D model was to be altered or moved in some way, the FLATSHOT would need to be updated so that everyone is using the most current data. In our instance at work, the large 3D model was not going to change through the project so it was an easy 1-time solution.

 

Flatshot 5 XREF manager unloaded

Posted in Manage, Modifying, TIPS, XREFs | 5 Comments

AutoCAD 2015 Resize Model Space Viewports

AutoCAD 2015 now makes resizing model space viewports intuitive and easy.

If you use multiple model space viewports, you’ll love this feature.

A special note needs to be made that the frame of the model space viewports has 2 areas. The area where the plus sign + resides is meant for adding a new viewport. The other area consists of the rest of the viewport edge and has the symbol with 2 lines.

Viewport frame picture 2

Resize a viewport by simply left-click and dragging the edge of the viewport within the “2 line” area.

The intersection of multiple viewports can be dragged to adjust the size all of the intersecting viewports.

Viewport Frame 1To add a new model space viewport, you can left-click and drag the plus sign + near the top or right side of the viewport edges.

You can also left-click and drag anywhere along the viewport edge and hold the Ctrl key to make a new viewport.

If you would like te delete a viewport, you can simply drag a viewport edge  until it collapses.

Viewport Frame 2

 

Viewport Frame picture 1

Posted in AutoCAD 2015, New in 2015 | 2 Comments

AutoLISP: Dynamic Text Align

With AutoCAD 2015’s new TEXTALIGN tool, comes the question of “what about those of us that don’t have AutoCAD 2015″?

Luckily, Lee Mac has a LISP version that accomplishes many of the same functions and even adds a few others.
http://www.lee-mac.com/dynamictextalignment.html

~enjoy

Lee Mac’s Dynamic Text Align

Posted in AutoLISP: Modify, AutoLISP: Text, Modifying, Text | 1 Comment

AutoCAD 2015: Text Align Dynamically

A new feature in AutoCAD 2015 is the Text Align tool found on the “Annotate” tab > “Text” Panel and the button that has 2 stacked letter A’s. The command to start this command is TEXTALIGN <enter> and the command alias is TA <enter>TextAlign1

 

This command works on both MTEXT and DTEXT (single line text) and makes the process of aligning text easy.

(side note: I refer to single line text as “DTEXT” because that is how AutoCAD refers to that type of text.

  • The alias to quickly add DTEXT is simply DT <enter>.
  • The alias to quickly add MTEXT is T <enter>…)

By default, this command uses a text object’s insertion point based on how it it is justified. Below is a selection set of both MTEXT and DTEXT showing the grips of their insertion points.

TextAlign3

You are then prompted to Select a Text object.
The text object that you select will define the first point of alignment by its insertion point

after you select the text, the alignment can be at any angle. The picture below shows the text being aligned without ORTHO turned OFF and the angle of the cursor is at some random angle…

TextAlign4

The picture below shows how the text will look when ORTHO is turned ON and the cursor is pulled up (or down will work as well).

TextAlign5 ortho

 

Below is the result of the aligned text.

TextAlign6 Result

TextAlign Select text

As a good AutoCAD user I hope that you noticed that during the command, there are options. All of the options are helpful but one of them stands out. This is the “Distribute” option.

Distribute Option: This option aligns the text and evenly spaces (distributes) them between 2 points.

The steps shown below are:

  • TA <enter> to start the TEXTALIGN command
  • Select the text objects to be aligned <enter>
  • P <enter> to start the “Points” sub-option
  • Pick the first point (upper line)
  • O <enter> to start the “Options” sub-menu
  • D <enter> to select “Distribute”
  • Pick Second point (lower line)

TextAlign Distribute

 

Make sure to check out this AutoCAD help link for more helpful info about the features of this command: http://help.autodesk.com/view/ACD/2015/ENU/?guid=GUID-CC1BE498-4908-434E-8FDA-0DE87E05EA15

Posted in AutoCAD 2015, Modifying, New in 2015, Text | Tagged | 3 Comments