Cad Panacea

Syndicate content
Ok, so this isn't a cure all for CAD, but all the other cheesy CAD blog names are taken....
Updated: 2 min 20 sec ago

Scott McEachron and Paving the Way - on the move

Tue, 11/18/2008 - 04:30
In case you have not heard, our buddy Scott McEachron is on the move. Scott, formerly with a reseller in north Texas, is now the proprietor of 1.2.1 Professional Consulting Services, offering Civil 3D implementation services, training and support for AutoCAD, Civil 3D and other Autodesk products, and more.

Scott's blog, Paving the Way, is still active, same name with a different address. Check it out, and best wishes Scott.

AutoCAD 2009 - Bonus Pack 2 - PDF enhancements

Sun, 11/16/2008 - 04:53
If you have not already heard by now, Autodesk has released "Bonus Pack 2" for AutoCAD 2009. This update includes two PDF enhancements. The first gives you the ability to attach PDF files as underlays. The second includes enhancements to PDF output.

The download is only available for AutoCAD 2009, AutoCAD Revit Architecture Suite 2009, and AutoCAD Revit Structure Suite 2009. Of course it is also only available to subscription customers.

To get this "Bonus Pack", log in to the subscription center and a link should be listed on the front page.

PDF Attach

The new command for attaching a PDF is named PDFATTACH. You can also use the right-click menu in the External References palette. If you attach a vector PDF, you can use object snaps to snap to geometry in the PDF file. This is controlled by the PDFOSNAP system variable. If the PDF contains layer information, use the PDFLAYERS command for on/off control.

You can use the PDFCLIP command to perform clipping operations on the PDF. The frame outline on an attached PDF is controlled by the PDFFRAME system variable. You can adjust the visible properties of the PDF including fade and contrast by using the PDFADJUST command.

PDF Output

A new PC3 file named DWG to PDF Bonus Pack.PC3 is created that includes the enhancements. These enhancements include increased resolution. The readme file recommends a setting of at least 600dpi. TrueType fonts are now embedded instead of converted to graphics. This should reduce file sizes of the PDF files.

Merge control settings are also available in this new driver. This is the "Lines Merge" vs. "Lines Overwrite" setting. You can include layer information in the output PDF now, and automatically display the finished PDF in your PDF viewer when the plot command is finished.

Summary

These are two welcome additions. A quick run through of each feature produced positive results.

It's a shame that this "Bonus Pack" is only for subscription customers. The enhancements to the PDF plot driver should have been included in the initial release in AutoCAD 2007 since these are basic requirements. The PDF attachment feature has been at or near the top of the AUGI wish list for a long time now. Unfortunately, non-subscription users will have to keep wishing for now.

Availability of DWG Trueconvert

Fri, 11/14/2008 - 04:16
The capabilities of DWG TrueConvert were added to DWG TrueView starting with DTV2008. However, I have seen a few people still wanting to download the the old standalone DWG TrueConvert

In a previous post from April 2008, I had a link to DWG TrueConvert 2007. That URL actually pointed to DWG Trueconvert 2004. I don't know if Autodesk changed the target of that URL or what. Here are the current links as of today:

HTML and Images

Tue, 11/11/2008 - 19:22
No, this is not CAD related, but I know a lot of CAD users dabble in other things like website creation and maintenance, specifically HTML code.

With regard for the subject, I ran into my #1 pet peeve again today, SCALED DOWN IMAGES. Note: I am not on the fastest broadband connection in the world, but I'm not on the slowest either.

I am not going to mention this particular web site, but on the main page they have a banner image that is displayed at 1038px x 146px, and it's 159kb. The actual image is 1920px x 240px. I copied it, scaled it to 1038px x 146px and the image size is now 38K, or about 4X smaller.

Same site, same front page, there is a 374px x 245px, black and white image, and it's 51kb. It's also scaled down, to 167px x 125px, and it also happens to be a B/W image (not greyscale) but it's color depth is set to 24-bit. If you reduce the color depth to 1-bit, and save it as a .PNG file, the file size is now 1,498 bytes, or about 34X smaller.

One main feature of this particular website is to inform its readers about upcoming events. Do they use a graphical calendar? No. Do they have a paragraph in the middle with a date highlighted in red? No. What do they use? How about marquee text? Didn't that go out in about 1995? It's so annoying and worst of all in this case, after the web page loads, you have to wait about 45 seconds to read the entire paragraph of information, as it scrolls by.. Good grief...

So I follow a link on this website and it takes me to another page that contains 54 images. The first one on the top is 798px x 598px, but I notice it's loading REAL slow... I check the properties of this image and of course, its real size is 3264px x 2448px and it's file size is a whopping 3.02MB (A scaled down version saved is 145kb). It took 2 minutes and 12 seconds to download and display this page. Nobody is going to wait that long to see your 54 photos.

In summary...

  • Do not use HTML to scale your images down
  • If a photo is B/W, save it as such.
  • Do not use MARQUEE text
  • Do use PNG or JPG depending on the application
  • Do test your webpage from various connections after you are done. Just because it loads fast on your Intranet doesn't mean it's good enough for the average Joe out there on a DSL connection.


One more thing... When I go to bookmark this page, it's title is "HOME PAGE". Won't help you much when you are searching bookmarks later that month...

Knowledge Base question...

Mon, 11/03/2008 - 17:04
Here is a new KB article that appeared today.



I just don't understand how you are going to select the Move option using your arrow keys if you can't see the menu. The solution of course is to press "M" on the keyboard after pressing ALT+Spacebar.

Saving your drawing

Tue, 10/21/2008 - 03:22
One of the most misunderstood commands in AutoCAD is the SAVE command. Note that SAVE, QSAVE, and SAVEAS all do different things.


  • SAVEAS saves the current drawing to a new file name. Example: If you are working in "A.DWG" and you run the SAVEAS command and specify "B.DWG", then "B.DWG" is created and is now the current drawing in the editor.

  • QSAVE simply saves the current drawing. If the current drawing is unnamed (not yet saved) or it is read-only, then QSAVE behaves like the SAVEAS command and allows you to specify a file name and location.

  • SAVE writes the contents of the editor to disk. It is like SAVEAS in that you get to specify the file name and location, but the currently loaded drawing remains unsaved and unchanged, even though DBMOD is reset to zero in the current drawing. Using the above example, if you are working in "A.DWG" and you run the SAVE command, and specify "B.DWG", then "B.DWG" is created from the contents of the editor, but "A.DWG" remains loaded, unchanged, and unsaved.

    The exception to this rule is that when the SAVE command is executed in an unnamed drawing, it behaves like the SAVEAS command and names the current drawing.


To confuse things even more, the pull-down menu entry titled SAVE, actually executes the QSAVE command. The SAVE command is only available at the command prompt.

Who is Harry Field?

Wed, 10/15/2008 - 08:32
Some of you may remember the recording of an Autodesk "support call" featuring New York resident Harry Field - if not, have a listen.

Anyway, Harry turned up again at last years AU, (at the 3:39 mark) where he reveals he is from Brooklyn, and that AU2008 was his "50th" AU. Apparently the DWF thing worked out OK for him.

DWG Trueview hidden commands

Thu, 10/09/2008 - 03:48
The Cadforum has published some tips regarding 'hidden commands' in DWG Trueview 2009. Using this, I created this list of all of the available commands. Some of the interesting ones that add a bit of capability to Trueview are...



  • You can use RibbonClose and Menubar to remove the ribbon and restore the normal pull-down menus.
  • You can use the Menu command to load any menu you want, even though it won't help all that much since commands not on this list will not work.
  • The Xref/Image/ExternalReference command (they all do the same thing) opens the palette which is missing the right-click commands, but if you use the -XREF and -IMAGE commands, you can actually attach a drawing or image.
  • The Dsettings command is available.
  • The ClassicLayer command is available.

Here is the complete list.



3DCONFIG
-3DCONFIG
3DORBIT
3DPAN
3DPANTRANSPARENT
ABOUT
AI_EMPTYPRINC
ALLPLAY
AREA
BGPLOTRECEIVE
BROWSER
CAPTURETHUMBNAILS
CLASSICLAYER
CLOSE
CLOSEALL
COMMANDLINE
COMMANDLINEHIDE
DDPLOTSTAMP
DIST
DSETTINGS
+DSETTINGS
DWFCLIP
DWGCONVERT
DWGPROPS
EPLOTEXT
EXTERNALREFERENCES
EXTERNALREFERENCESCLOSE
GRID
HELP
HYPERLINKOPEN
ID
IMAGE
-IMAGE
LAYER
LAYERCLOSE
LAYFRZ
LAYOFF
LIST
MASSPROP
MENU
MENUBAR
MSPACE
NAVSMOTION
-NAVSMOTION
NAVSMOTIONCLOSE
NAVSWHEEL
NAVVCUBE
OPEN
OPTIONS
+OPTIONS
PAGESETUP
PAN
-PAN
PERSPECTIVE
PLOT
PLOTSTAMP
-PLOTSTAMP
PLOTTERMANAGER
PREVIEW
PROXYNOTICE
PSPACE
PUBLISH
-PUBLISH
+PUBLISH
PUBLISHTOWEB
QUIT
QVDRAWING
QVDRAWINGCLOSE
REDRAW
REDRAWALL
REGEN
REGENALL
RIBBON
RIBBONCLOSE
SEQUENCEPLAY
SETVAR
SHADEMODE
SNAP
STEPSIZE
STYLESMANAGER
SYSWINDOWS
TEXTSCR
THUMBSIZE
TOOLBAR
-TOOLBAR
VIEW
-VIEW
VIEWERPREFERENCES
-VIEWERPREFERENCES
VIEWGO
VIEWPLAY
VIEWPLOTDETAILS
VSCURRENT
XREF
-XREF
ZOOM

Hurricane IKE

Thu, 10/09/2008 - 03:27

Hurricane Ike hit the area one month ago this Friday/Saturday. We are about 70 miles inland and most of the area here is back to "normal", as far as work and school go, but the closer you get towards the coast, the longer it will be until things are back to "normal". Many people I know even around here didn't have power restored until 2+ weeks after the storm. There are still some schools closed. Galveston and eastward are pretty much still a wreck.


Photos do not fully convey the damage, but here are a few that try...



A common site up in this area even a month later is the mountains of what used to be living trees, still piled along neighborhood streets.





Interstate 45 just north of the Galveston causeway, the day after the storm.





Highway 146 a few miles inland.





Some people think all of Texas is like this...





...but we do have a few towns here also... Downtown Houston after the storm.

Exploring the autolisp SSGET function - part 2

Wed, 08/20/2008 - 17:59

Ok, getting back to the last (ssget) call in part 1...

(ssget "_W"
(list 5.0 5.0)(list 8.0 8.0)
'((0 . "CIRCLE")(-4 . "<")(40 . 1.0))
)

The "_W" is the window selection method. Then we are passing it two points (5,5 and 8,8). Then we are telling it to only accept circle entities. The last two pieces tell it to only accept circles whose radius (DXF code 40) is less than 1.0.

So in summary, this bit of code will search the entire database and return only circles whose radius is less than 1.0 who also lie inside a polygon defined by the corners of 5,5 and 8,8.

The -4 group code is a special code that lets you perform relational testing. There are codes for equal, not equal, less than, less than or equal, greater than, greater than or equal, and two bitwise operators.

This type of filtering works great for locating entities on a certain layer, or that have a certain color or linetype. (ssget "_X"
'((0 . "LINE")(8 . "TEMP"))
)

The code above will select all LINE entities on the TEMP layer.

(ssget "_X"
'((8 . "TEMP")(62 . 3))
)

The code above will select all entity types on the TEMP layer whose color is green (3). Be careful when filtering for color, linetype and lineweight. These filters only apply if the particular property is explicitly set. In the example above, if the color of all entities on the TEMP layer is set to BYLAYER, the selection set will be empty, even if the color of layer TEMP is green (3). 


You can use wildcard matching in selection set filtering also.

(ssget "_X"
'((0 . "DIMENSION")(3 . "DIM##"))
)

The code above will select all dimensions whose dimstyle is DIM## (where the # represents a single numeral). For example, a dimension whose dimstyle is DIM55 or DIM39 will be selected. Dimensions with a dimstyle of DIM4T, DIM777, DIMKK, or DIM are not selected. Other wildcard syntax can be found under the (wcmatch) function in the Autolisp Reference Guide.

You may have figured it out by now, but "AND" is implied when when combining multiple filters such as above. In other words, in the above example, it's going to find entities that have the type dimension AND whose dimension style is DIM##. There may be cases were you want to specify "AND", especially if you are using an "OR" also. (ssget "X"
'(
(-4 . "<OR")
(-4 . "<AND")
(0 . "CIRCLE")
(40 . 1.0)
(-4 . "AND<")
(-4 . "<AND")
(0 . "LINE")
(8 . "ABC")
(-4 . "AND<")
(-4 . "OR<")
)
)

The code above is straight out of the Autolisp Developer's Guide. It creates a selection set out of CIRCLE entities that have a radius of exactly 1.0 and LINE entities on the ABC layer. If you did not use the "OR" condition, then the (ssget) function would be trying to find entities that are a CIRCLE and a LINE, which is obviously impossible. Let's look at one more example.

(ssget '((0 . "POLYLINE,LWPOLYLINE")(-4 . "&")(70 . 1)))

Last, but not least... The code above uses a "bitwise AND" to filter on a bit coded DXF code. In this case, DXF code 70 on a POLYLINE and/or LWPOLYLINE. The goal here is to create a selection set of closed polylines. If DXF code 70 has the "1" bit set, this indicates a closed polyline. However, we cannot simply filter for DXF code 70 = 1, because this is a bit coded field. If LTGEN is turned on and it's a closed polyline, then DXF code 70 will equal 129, not 1. This is why you must use the "&" (Bitwise AND) special filter.

There is much more information in the Autolisp Developer's Guide on advanced selection set handling. Good luck and post some of your examples in the comments section if you want.

Exploring the autolisp SSGET function - part 1

Wed, 08/20/2008 - 04:10

If you have written routines with Autolisp, then you have probably used the (ssget) function to select entities on the screen, either automatically or by prompting the user.

(ssget) is a powerful function that can do more than you probably realize. Let's look at a simple example.

(ssget '((0 . "TEXT")))

This prompts the user for a general selection set, but only TEXT entities are added to the resulting selection set.

(ssget '((0 . "*TEXT")))

Notice the wild card that was added. This is the same as above, except now any entity type that ends in TEXT is added to the selection set. At first, this looks like a good way to select TEXT and MTEXT, and it is. However, you have to be careful because this will also select RTEXT entities, and if your code is not equipped to deal with RTEXT, it may fail.

(ssget '((0 . "MTEXT,TEXT")))

This is a better way to select MTEXT and TEXT entities. But what if you don't want to bother the user to select entities, you just want to select ALL the MTEXT and TEXT entities in the drawing?

(ssget "_X" '((0 . "MTEXT,TEXT")))

Notice the "_X" that was added. This tells the (ssget) function to evaluate every entity in the drawing and then the filtering mechanism will filter out everything except MTEXT and TEXT. Entities on frozen layers are included when using the "_X" selection method.


Let's look at some other selection methods.

(ssget "_W" (list 5.0 5.0)(list 8.0 8.0))

Above is an example that will select objects inside a window from 5,5 to 8,8.

(ssget "_CP" (list (list 5.0 5.0)(list 8.0 8.0)(list 8.0 3.0)))

The line above will select all entities inside or touching a triangle defined by the points 5,5; 8,8; and 8,3. The CP is for crossing polygon.


The power of (ssget) comes from the incredibly fast filtering that it performs. Can you imagine having to evaluate an entire database of entities and manually filter out all the circles whose radius is less than 1.0 that fall inside a particular polygon? (ssget) can do this very fast. Example below.

(ssget "_W"
(list 5.0 5.0)(list 8.0 8.0)
'((0 . "CIRCLE")(-4 . "<")(40 . 1.0))
)

More details on this code and other examples in part 2.

S::STARTUP Function

Mon, 08/18/2008 - 17:10
In the previous post about Startup Lisp Functions, the special (S::STARTUP) function was mentioned. Startup lisp code is loaded before the drawing is initialized, but you cannot call the (COMMAND) function until after the drawing is initialized. The solution is to place your (COMMAND) calls inside the (S::STARTUP) function. For example, if you want to reset the scale list and purge out regapps each time a drawing is opened, you could use something like this: (defun-q mystartup ()
(command "._purge" "_R" "*" "_N")
(command "._-scalelistedit" "_R" "_Y" "_E")
)
(setq S::STARTUP (append S::STARTUP mystartup))

Notice that we did not directly define (S::STARTUP). Because this function can be defined in other places, it is best to append to it rather than overwrite it. Use (defun-q) to create a function defined as a list, so it can be appended. To finish the example from the previous post... ;;; acaddoc.lsp
(load "mylisp")
(load "another_lisp")
(load "\\\\server\\share\\a_lisp_and_specify_the_path")
(setvar "blipmode" 0)
(setvar "highlight" 1)
(defun-q mystartup ()
(command "._purge" "_R" "*" "_N")
(command "-scalelistedit" "_R" "_Y" "_E")
)
(setq S::STARTUP (append S::STARTUP mystartup))
;;; end acaddoc.lsp

Startup Lisp Functions

Mon, 08/11/2008 - 09:59

If you have lisp routines that you want to make available in each drawing session, forget the "Startup Suite" and load them using the "acaddoc.lsp" file. "acaddoc.lsp" is not included with AutoCAD, you create it yourself. But it is nothing more than a plain lisp file, except that the first one found at drawing startup (just put it in your support file search path), is loaded automatically each time a drawing is opened.

Why use this approach instead of the "Startup Suite"? Ease of migration for one thing. When you upgrade from your current version of AutoCAD to the next version, simple add the path of your "acaddoc.lsp" file to the support file search path and your done. More details about this can be found here in a earlier article.

The second reason is that if you have more than one AutoCAD install to manage, using a networked copy of "acaddoc.lsp" means that you can control each machine using a single file as opposed to using the "Startup Suite" where your startup routines would have to be updated one machine at a time.

Remember that the file "acad.lsp" can contain startup code also, but "acad.lsp" is only loaded once per session of AutoCAD (assuming that the system variable ACADLSPASDOC is set to it's default value of zero). Each drawing has it's own lisp environment so it's necessary to load your startup lisp routines using "acaddoc.lsp" so that they will be loaded for each drawing.

Since "acaddoc.lsp" is like any other lisp file, it can contain functions and/or lisp code itself. Be careful when including lisp code because the (command) function should not be called until after AutoCAD initializes. You can do this safely by using the (s::startup) function. More on that next time.

Here is a sample "acaddoc.lsp" file.

;;; acaddoc.lsp
(load "mylisp")
(load "another_lisp")
(load "\\\\server\\share\\a_lisp_and_specify_the_path")
(setvar "blipmode" 0)
(setvar "highlight" 1)
;;; end acaddoc.lsp