AutoCAD

Using layer filters in AutoCAD


photo of a filter

If you typically deal with a lot of layers in your drawings, and you are not using layer filters, then you may be subjecting yourself to unnecessary frustration. Depending on your discipline, a layer standard may contain 100 or more layers. Take your base drawing and add a couple of xrefs, and you could have hundreds of layers to sift through.

So why doesn't everyone use layer filters? Maybe they don't want to take time to create them? Maybe it's unknown territory? Maybe they don't think they need them?

Well, first off you only need to create them once in your template drawing(s) and second, there is nothing magical about creating them. The only real catch is you need some type of layer standard so that a filter in one drawing will work in the next. But most importantly, if you want to filter layers by name, your layer naming standard should be structured in such a way that makes this possible.

Why drawing1.dwg will not close

Generally when you open AutoCAD, your default template is loaded and a drawing named "Drawing1.dwg" is presented to you. If you open a drawing using the OPEN command or using the Sheet Set Manager, the other drawing will open and "drawing1.dwg" will go away.

Showing and Hiding AutoCAD Toolbars

It's not uncommon for someone, even these days in the era of the Ribbon, to want to turn on a toolbar. Many people know that you can right click in the toolbar area, and each loaded menugroup will be listed, then you can choose the appropriate toolbar to display.

But what if you don't have any toolbars showing at all? Then there is not a suitable location in which to right click.

Here is what you do, run the -TOOLBAR command. Note the leading hyphen, which calls the command line version of this command. The first prompt asks for the toolbar name. Enter a toolbar name such as "MODIFY". Then it will ask you how you want to display the toolbar. Press "F" for float. It will then ask you for coordinates at which to place the toolbar. You can accept the defaults (0,0) and the toolbar will appear in the upper left corner of your primary monitor. If you want to specify a certain location, be aware that the values increase as you move left and down. So if you specify a location of 300,500, the toolbar will be placed 300 pixels to the left and 500 pixels below the upper left corner of your primary monitor. The last prompt it asks you is how many rows for the toolbar.

Of course you could script this using a menu macro or lisp routine. If you watch the prompts on the -TOOLBAR command, you'll see that you can hide toolbars also, so it's possible to setup some shortcuts to show and hide various toolbars - which should be quicker than switching workspaces.

Getting a list of polyline vertices using LISP

Here is one way to generate a list of polyline vertices using lisp. This function requires one argument, a polyline entity. The polyline can be the old style POLYLINE entity (2D or 3D), or it can be an LWPOLYLINE entity.

(defun getcoords (ent)
  (vlax-safearray->list
    (vlax-variant-value
      (vlax-get-property
	(vlax-ename->vla-object ent)
	"Coordinates"
      )
    )
  )
)

Entmake HATCH entity - Part 2

Regarding yesterday's post....what I failed to cover with any detail was the fact that the example code posted in the CADTutor forum post was strictly for a closed area defined by four lines. Of course that isn't the only area you may need to hatch. Today, I needed to adapt this code to hatch an area defined by an ellipse.

Entmake HATCH entity

After working on some autolisp code where I needed to create several HATCH entities, I figured that using (entmake) to do the job would be much faster than pushing the command line version of the HATCH command.

I didn't have my own example of this, and after checking out the DXF reference, it looked a bit more complicated than other entities, so I set out in search of some sample code that worked.... which led me to a post by "CarlB" over in the CADTutor forums that he had posted a few years ago. This worked great until I added in the scale factor and changed the pattern from SOLID to ANSI31. After a few iterations of trial and error, I managed to make it do what I wanted.

When using a real pattern (as opposed to SOLID), you have to specify a few more parameters. Head over to this thread in the CADTutor forums for the example code.

As it turns out, using (entmake) is about 10 times faster than using the (command) function in this case.

EDIT: I failed to mention that the example posted at the link above is for hatching a simple boundary defined by four lines. If you have arcs or other entities involved, the code will be a bit different.

Massive PDF Files

I see a lot of posts in the discussion groups where someone creates a PDF from a drawing and the PDF file size ends up being several times larger than the drawing itself.

OLE objects or images in the drawing. Both can cause the resulting PDF to be large. Remember that images are referenced into drawings and they are not included in the file size of the DWG file.

External Reference Tips

Here are a couple of quick tips on External References.

  • Rather than opening the External References palette, then right clicking to attach a reference, you can go use the ._XATTACH command to go directly to the "Select File" dialog.
  • You can still access the old "Xref Manager" and "Image Manager" dialogs by running the ._CLASSICXREF and ._CLASSICIMAGE commands, respectfully.
  • If you want to attach multiple DWG references at one time, you will have to use the older ._CLASSICXREF command mentioned above.
  • Starting in AutoCAD 2010, the XDWGFADECTL system variable controls the dimming of referenced DWG files.

Autodesk Advantage Packs for 2010

Yes, I'm way late on this, but in case you have been in a cave for the last week or so, Autodesk released their latest Advantage Packs for AutoCAD 2010, and several verticals last week. These Advantage Packs are available for subscription members only.


I'm going to cover the tools included in the Advantage Pack for AutoCAD 2010 below. The "Subscription" tab for the ribbon for this Advantage Pack is shown above. Keep reading for more....

Using the AutoCAD License Transfer Utility

Starting with AutoCAD 2010, the old Portable License Utility (PLU) has been replaced by the License Transfer Utility (LTU). The old PLU essentially created a "license file" that you could move from one computer to another using a network, flash drive or any other method. If you bought a new computer for example, you could install AutoCAD on the new computer, and use the PLU to transfer the activation from the old machine to the new one.

The only problem with this is that the PLU failure rate was about 50%, and because you had to define the target machine when you exported, you could not re-import back onto the same machine.

So along comes the LTU. So what is the difference? The LTU copies your activation up to the Autodesk servers where it can sit until you are ready to import it. So far in my testing, it has not failed once. Of course you will need an internet connection on both machines, and you will need an Autodesk UserID and password. If you don't have one, you can create one.

Syndicate content

 


All content is copyright © CAD Panacea 2008-2010 unless otherwise noted.
All content of CAD Panacea is solely my own personal thoughts and opinions and do not represent my employer or any others.
All comments posted to this blog are the sole responsibility of the person making the comment.

 

Google, as a third party vendor, uses cookies to serve ads on this site. Google's use of their cookies enables it to serve ads to users based on their visit to your sites and other sites on the Internet. You may opt out of the use of these cookies by visiting the Google ad and content network privacy policy.

free hit counters

Powered by Drupal, an open source content management system