Showing posts sorted by relevance for query hatch pattern. Sort by date Show all posts
Showing posts sorted by relevance for query hatch pattern. Sort by date Show all posts

AutoCAD: AutoLISP to Generate Multiple Hatch Boundaries

Do you need to re-generate the boundaries of multiple hatch patterns? An AutoLISP routine will do it.
Català - Castellano - Deutsch
I had to work on some files converted from ArchiCAD to AutoCAD and needed to use the AEC Space entities to get the areas. Unfortunately, plain AutoCAD doesn't read the are of this objects, and by exploding them, it generated Hatch Patters that would not show their area on the properties palette.

The solution for a single AEC_SPACE, was simple, explode it, regenerate the boundary of the Hatch Pattern, and select the resulting Polyline to see the area (or to extract the area to an excel file as explained on a previous post). The problem came becuase there were a lot of this AEC_SPACE objects,and AutoCAD does not allow to regenerate boundaries of multiple Hatch Patterns at the same time.

The solution was found via DigitalCAD, in the form of a LISP routine called HATCHB.LSP. This routine when used, allows you to select as many Hatch Patterns as you want and obtain their boundaries in the form of polylines. The polylines will be generated on the current layer, and properties.

Some thoughts: This real life situation is a clear case that shows how format incompatibilities makes us waste a lot of time. In this case the lead architect works in ArchiCAD, but we as Contruction Managers have only AutoCAD, so everytime we get files from them there is a lot of information in those files that is wasted, because we can not read it properly, so we have to waste hours on retracing polylines to be able to double check the information we have received...


Show me more...

AutoCAD: PREVIEWFILTER system variable

Control which objects are highlighted in the selection preview
Català - Castellano - Deutsch
The selection preview is very useful to know before clicking which object you are going to select. The only problem it has is that if your objects are very complex, generating the preview might take some time, slowing down your workflow.
A clear example of objects that create issues if previewed are hatch patterns. Some time ago, I already wrote a post on How to Disable selection preview for Hatch Patterns. This post just wants to be a more comprehensive overview of how to control which objects are highlighted.
There is a system variable that allows us to control which objects are "selectionpreviewed". Te SV is PREVIEWFILTER, and as in other SV, the sum of the following values will result in some objects beeing excluded from the preview feature.

- 0 all objects are previewed
- 1 Objects on locked layers excluded
- 2 Objects in XREFs are excluded
- 4 Tables are excluded
- 8 Multiline objects are excluded
- 16 Hatch patterns excluded
- 32 Objects in groups are excluded

To exclude several object types, you need to enter the sum of the different values for this objects. For instance, if you want to exclude Hatch Patterns and Groups from selection previews, you will need to enter 48 as the value for the PREVIEWFILTER System Variable.
Alternatively, the controls for which objects are previewed can be accessed through Format --> Options --> Selection -->Visual Effects Options --> Advanced Options








Show me more...

AutoCAD: List of 2D Objects

A complete and Organized list of the AutoCAD 2D Objects and links to those explained in CAD Addict.
Català - Castellano - Deutsch
There are many different types of Objects in AutoCAD. On an effort to keep updating the directory of CAD-Addict.com here comes a complete list of the 2D Objects and the links to those articles that explain their use. I will try to keep adding lists of objects weekly and at the end I will create a post that works as a main directory for this series of posts.
2D Objects

There are 2D objects that are created through other commands, but regardless when created they are in one of these categories. An example of this would be Polygons, Rectangles or Donuts which are actually Polylines.

Show me more...

AutoCAD Weekly Block #08: Cobblestone Pattern

Download this block and learn about the SUPERHATCH command
Català - Castellano - Deutsch
This week's Block is the first that is not a dynamic one. The reason for that is that I remembered I had not talked in here about the SUPERHATCH command. As you will see, the SUPERHATCH command allows you to hatch an area with any custom made hatch.
Why is it in the weekly block section? Well the way SUPERHATCH works involves Blocks much more than it involves hatches (it actually does not involve hatch patterns at all.
The block for download is a cobblestone pattern that my company uses in some of the projects (not everyone gets to work on Zaha's futuristic shapes...lol). You can Download it here. See the snapshot of the block below.


We use this block to hatch certain areas, and the way to do it quick and efficiently is using the SUPERHATCH Express Tool. When you call the SUPERHATCH command, you will see the following menu.


Here you will select Block as an option and use the downloaded "CAD-Addict.com cobblestone" Block. After doing this, simply follow the prompts, basically, you simply need to pick the initial position, rotation and scale, and then pick an internal point of the area you want to Superhatch.
The result will be a set of blocks clipped to fit the boundary selected. See below.


Remember that when selecting "internal point" if the drawing is heavy the computer might crash, so I would recommend you to switch off any unnecessary layers before attempting this operation.

This command has more options that have not been explored in this post, but I think you can get an idea of how powerful this is.

Show me more...

AutoCAD: How to Create a Custom Hatch Pattern with Text in it

This how I did it. It was a bit long but it helped me understand what to deal with when creating you own patterns.
Català - Castellano - Deutsch
On my last post, I analysed how the Hatch Pattern files work. How they define the patterns through straight lines and what is the syntax they use. I was not entirely satisfied with all I learned and wrote here so I decided to go from the theory to the practice and try to create my own hatch pattern file.
I decided to not attempt just a random pattern, but one that required certain precision. So I set the goal to create a pattern that would repeat the text CAD-Addict.com. Possible? yes it is.
The process started by creating the text. If you remembered what I wrote on the previous post, a pattern is created by straight lines with linetypes that we can decide that repeat themselves the way we decide to. So how would we do it to show a text on our hatch pattern just with some straight lines? We had to find a way to align the lines of the text on a way that they would repeat themselves in different directions. Let's see an image to understand this.

The text with the C circled in Red is the original one, the ones circled in Yellow are the ones I used to be sure the lines allign. See that this text has only lines at 0 degrees, 90 degrees, 45 degrees and 135 degrees. Alligning the o degree lines it is easy. The important part is to manage to allign the 45/135 degrees and do it in a way that the 90 degree ines also allign. In this case the fact that the tilted lines are 45/135 degrees makes it easy, if the there where other angles it would have been much more difficult. (The original text, created with the standard AutoCAD text style, had the lines on the upper part of the A at a different angle, but I modified that to make the pattern file more easy to create. See in the image below, how with the original text there was no easy way to find common lines for the A.

The process I followed once I had the text aligned is simple. First I started to set up the 0 degree lines (Remember to check the previous post for more details on the syntax of the Hatch PAttern files).Picking the lower left corner of the C as 0,0 point it was all a question of measuring distances. Something you need to know is that linetypes in hatch patterns can only use 6 elements from DASH SPACE or DOT. We define DASH with positive value, space with negative and point with a zero. See the hatch pattern definition of the horizontal lines and you will get a better glimpse of what I mean.

The text highlighted in yellow doesn't belong to the pattern definition, I added it for reference while building the pattern file. As you can see, although all the lower horizontal lines of the letters are aligned, I couldn´t define them in a single line definition because I would have exceeded the maximum of 6 elements for the line type definition.
Lets go back to how the pattern file works. The first number defines the angle of the line, the second and third (the second column) defines the start point coordinates of that line, the 4th and 5th number (3rd column) describe the delta-x and delta-y of the line. This point requires certain attention. Lets take for instance the horizontal lines. The delta-x and delta-y I had to use was -1.0607,1.0607. Lets see graphically what that means.

The last column might have no values at all (if the line is continuous), or up to 6 to define its linetype. For the lower horizontal lines for the letters C, D and d, the pattern file I created describes 0.1,-0.4475,0.1475,-0.7949,0.0508,-2.702 as linetype. THis means 0.1 of dash,0.4475 of space,0.1475of dash,0.7949 of space,0.0508 of dash,2.702 of space. Why is the last space so much bigger than the other ones? Because it describes the distance between the last dash and the first one on the next text. See the image below and compare the dimension values to the first 4 ones above.

The 6th value, on the 4th column, the one that is disproportionately bigger compared to the others, belongs to this dimension.

I after all this information you don't still feel like you could create your won pattern, I can only tell you that the best way is to try to create one. Suddenly all the abstract concepts you are reading will start making sense.
Just a couple of points I discovered while creating the pattern file. Be sure there is at least one blank line at the end of all the definitions, or AutoCAD won't accept the pattern. Also, once you have created the YOURPATTERN.pat file (or while creating it to test it) save it under the following where all the Custom Patterns are in AutoCAD. generally that folder is under C:\Documents and Settings\USERNAME\Application Data\Autodesk\AUTOCADVERSION\enu\Support\pats.
If you want to see or test the pattern definition I created., you can download it here. And below you can see a snapshot of the pattern generated by the file.

I know the pattern is not very useful for everyday life, but creating it was very useful to understand how to create a custom hatch pattern.

Show me more...

AutoCAD: Understanding the .pat Hatch Pattern Files

How do you define a new custom Hatch Pattern? Better understand how the .pat files work.
Català - Castellano - Deutsch
Searching for how to generate custom hatch pattern definitions in AutoCAD i came across this post by Ellen Filkenstein. Although the post gives you an idea on how these pattern definitions work, it took me a while to understand everything. So I went to the acad.pat file and I picked a complicated pattern to see if I could figure out how it works. I chose the AR-CONC pattern. This is a snapshot of it.


The first thing I realized disappointed me. I thought the pattern files could define any geometry, and somehow they do, but it turns out that any geometry created has to be based on straight lines. Let me show you why. Although the AR-CONC pattern seems pretty random, it is not. If you pay attention to it you will see that the triangles repeat themself on straight lines.


So, does the pattern definition describe a triangle and how often should be repeated? Not at all. A more detailed look to the pattern showed me that there is not such a thing as triangles in the pattern, but lines that intersect each other creating triangles (I know, that is the same almost, but not in terms on how you define the patter, see the image below).


So how are this lines defined to end up showing like triangles? Here is the tricky part. See the image below that belongs to the acad.pat definition for the AR-CONC pattern.


There are 4 elements that are important here:
  1. Defines de Angle that the line should take.
  2. Defines the X and Y coordinates of the start point of that line.
  3. Sets de Delta-x and Delta-Y displacements.
  4. Defines the linetype.
Ok, I know, this is textbook theory, I had no idea what this meant after I read about it. So I hatch some region in AutoCAD with this pattern and I searched for a line that was at an angle of 50 degrees. Surprise!! I found one. And suddenly everything made sense. It would take me long to describe it all so I made a quick diagram. See it below. The colors correspond with the numbers of the previous image for easy reference.


See how the angle (red) corresponds with the one described in the pattern file. The start point is 0,0. And here comes the juicy part. In Blue, the linetype. The pattern describes 0.75,-8.25. This means 0.75 units of dash, 8.25 units of space (the negative sign means space, 0 would mean a dot). And finally the file defines 4.12975034,-5.89789472 as Delta-x, delta-y displacement. See it in the picture with the green dimensions.
I guess now we can start defining our own patterns...or maybe not. Sincerely having the SUPERHATCH command available through the express tools, the process of generating your own pattern files seems a bit outdated. Of course the entities created with SUPERHATCH are blocks and not Hatch patterns, so they will give you much less freedom to edit them, so it is your choice to decide which method to use. I will talk soon in a new post about the SUPERHATCH command with more detail.

Show me more...

AutoCAD Architecure: Forget about Associative Hatch Patterns

For a long time I struggled to remember to check the box "Associative" when creating Hatch Patterns. Now I know I don't need to do this anymore.

For a long time I struggled to remember to check the box "Associative" when creating hatch patterns. Without that Box checked it was really hard to modify any existing hatch pattern. But even creating an associative pattern didn't make it very flexible to work with them. A lot of times the boundary bothers us so we end up erasing it and doing that we loose the associativity of the pattern.
AutoCAD Architecture has some features that make hatch associativity something from the past. When we have a Hatch Pattern, we can select it and right click on it. We will get the contextual menu shown on the left side of this post.
The beauty of it is that if we click on generate boundary, an AEC polygon will be generated. We can then modify that polygon to fit our new hatch needs and after that we simply select the Hatch - Right Click - Set Boundary - And we will select the modified polygon. We will we prompt to decide if we want to erase the polygon or not, which I personally recommend say yes, since it is so easy to recreate them.
But this is not all, AutoCAD Architecture has another set of tools that will improve our work flow, the AEC Modify Tools. These tools will allow us to easily modify our hatch by Merging it with other entities, Subtracting parts of it or dividing it in two. I will write a post soon with more details about the AEC Modify Tools.
For those Using classic AutoCAD classic these features are not available. You can Recreate the Boundary of a Hatch by double clicking it and selecting "Recreate Boundary". I don´t think there is anything similar to the AEC Modify tools in the classic version of AutoCAD.
If you are in the AEC industry I seriously encourage you to jump ASAP to AutoCAD Architecture whenever you need to update your CAD software. It boosts the work flow of your employees many times. To learn all the features specific to AutoCAD Architecture you might want to buy this book.

Show me more...

AutoCAD: List of Express Tools

A complete list of the Express Tools that make your drafting expierence much easier.
Castellano - Català
Las week I found this list of the Express Tools in the Autodesk discussion Groups. With no means of just copying it, I though I could reproduce it here and use it as a directory to link to those Posts that I have written already about them. With more time, I will eventually update the list wit more and more links to Posts talking to one or more Express Tools. So here is the list.

ALIASEDIT Allows you to create, modify, and delete AutoCAD command aliases on-the-fly.
ALIGNSPACE Adjusts a viewport's zoom factor and panning position based on the alignment points specified in model space and paper space.
ARCTEXT Places text along an arc
ATTIN Imports block attribute values from an external, tab-delimited ASCII file.
ATTOUT Exports block attribute values to an external file in tab-delimited ASCII format.
BCOUNT Calculates number of blocks
BEXTEND Extends objects to nested objects within blocks or xrefs
BLOCK? Lists block objects
BLOCKREPLACE Allows you to globally replace all inserts of one block with another block.
BLOCKTOXREF Replaces all instances of a standard block with an xref. Unbinds xrefs that are bound.
BREAKLINE Creates a polyline and inserts the breakline symbol.
BSCALE Scales a block insert from its insertion point.BTRIM Trims to entities nested in blocks or xrefs
BURST Explodes block and converts attributes to text
CDORDER Arranges the drawing order of objects by colour number
CHSPACE Seamlessly moves objects from one space to the other while maintaining the appearance of the original objects.
CHURLS Provides a method to change a previously placed URL (Uniform Resource Locator) address.
CLIPIT Xclip command with arc, circle, and polyline capability
CLOSEALL Close all open drawings, asking whether to save changes if the drawing has been modified since the last Save.
COPYM Copies multiple objects with Repeat, Array, Divide and Measure options.
COPYTOLAYER Copies selected objects to a different layer, leaving original objects intact.
DIMEX Saves dimension styles to a file
DIMIM Imports dimension styles saved to a file with
DIMEX command
DIMREASSOC Restores a measurement value to overridden or modified dimension text.
DUMPSHX Converts existing SHX (compiled) files to the equivalent SHP (decompiled) files
DWGLOG Creates and maintains an individual log file for each drawing file as it is accessed.
EXOFFSET This enhanced version of the OFFSET command offers several advantages over the standard command, including layer control, undo, and a multiple option.
EXPLAN An extended version of the PLAN command.
EXPRESSMENU Loads the AutoCAD Express Tools menu and displays the Express menu on the menu bar.
EXPRESSTOOLS Loads the AutoCAD Express Tools libraries, places the Express directory on the search path, and loads and places the Express menu on the menu bar.
EXTRIM Trim using closed polyline for cookie cutter effect
FASTSEL Creates a selection set of objects that touch the selected object.
FLATTEN Converts 3D geometry to 2D geometry
FULLSCREEN Toggles FULLSCREEN mode
GATTE Globally changes attribute values
GETSEL Collects specific entity types and makes them the current selection
IMAGEEDIT Launches the image-editing program (for example, Paintbrush) for the selected image.
JULIAN Contains a collection of AutoLISP routines for calendar date conversions
LAYCUR Changes the layer of selected objects to the current layer
LAYDEL Permanently deletes layer from drawing, even if it contains objects
LAYFRZ Freezes layers of selected objects
LAYISO Isolates layers of selected objects
LAYLCK Locks layer of selected object
LAYMCH Changes the layer of selected objects to the layer of a selected destination object
LAYMRG Merges two layers, and removes the first layer from the drawing
LAYOFF Turns of layers of selected objects
LAYON Turns on all layers in drawing
LAYOUTMERGE Combines specified layouts into the current layout
LAYTHW Thaws all layers in drawing
LAYULK Unlocks layers of selected object
LAYUNISO Turns on all layers that were turned off by the last LAYISO command.
LAYVPI Isolates an object's layer to the current viewport
LAYVPMODE Controls whether the layer utilities LAYISO, LAYFRZ and LAYOFF use VPFreeze or the standard layer Freeze or Off when used in a floating paper space viewport.
LAYWALK Dynamically displays objects on selected layers
LMAN Layer Manager saves and restores layer settings
LSP Displays a list of AutoLISP commands available at the command prompt
LSPSURF Displays the contents of an AutoLISP file by individual functions.
MKLTYPE Creates linetypes based on selected entities
MKSHAPE Creates shapes based on selected entities
MOCORO Moves, copies, rotates and scales entities
MOVEBAK Changes the destination directory for BAK files
MPEDIT PEDIT for multiple polylines
MSTRETCH Stretches using multiple selection windows
NCOPY Copies entities nested inside blocks and xrefs
OVERKILL Removes unneeded objects by deleting duplicates and combining line and arc segments that overlap.
PACK Starts Pack & Go program
PLT2DWG Imports HPGL files into the current drawing session. All colours are retained.
PROPULATE Update, list or clear Drawing Properties data
PSBSCALE Sets or updates the scale of block objects relative to paper space.
PSTSCALE Paper space text scaling utility
QLATTACH Attaches leader to annotation object
QLATTACHSET Globally attaches leaders to annotation objects
QLDETACHSET Detaches leader from annotation object
QQUIT Close all open drawings and exit.
REDIR Redefines hard-coded directory paths in xrefs, images, shapes, styles, and rtext
REDIRMODE Sets options for the REDIR command by specifying which object types the command should act on.
REVERT Closes and re-opens the current drawing.
RTEDIT Allows editing existing Remote Text (Rtext) objects
RTEXT Inserts or edits remote text entity
RTUCS Rotate the UCS dynamically with your pointing device.
SAVEALL Save all open drawings
SHOWURLS Shows location of embedded URLs S
HP2BLK Creates a new block definition based on the appearance of a shape object.
SSTOOLS A collection of AutoLISP routines that creates exclusionary selection sets SSX returns a selection set either exactly like a selected object or, if the filter list is adjusted, very similar to it.
SUPERHATCH Uses images, blocks, xrefs, and wipeouts as hatch patterns
SYSVDLG Allows you to view, edit and save system variable settings.
TCASE Changes the case of selected text, mtext, attributes and dimension text.
TCIRCLE Places a circle, a slot, or a rectangle around each selected text or mtext object.
TCOUNT Adds sequential numbering to text objects. The numbering can appear as a prefix, suffix or replacement text.
TEXTFIT Fits text between specified points
TEXTMASK Masks entities from behind text
TEXTUNMASK Remove mask from text
TFRAMES Toggles the state of frames for Wipeout and image objects. If frames are turned on, this command turns them off, and vice versa.
TJUST Changes a text object's justification without changing its position. Works with text, mtext, and attribute definition objects.
TORIENT Aligns text, mtext and block attribute objects to new orientation
TSCALE Scales text, mtext, attributes and attribute definitions.
TXT2MTXT Converts text entities created with text or Dtext to Mtext
TXTEXP Explodes text or Mtext objects into polylines
VPSCALE Displays a clear translation of the scale of the current or selected viewport.
VPSYNC Synchronizes one or more viewports with a master viewport. All synchronized viewports will take on the zoom factor of the master viewport.
XDATA Attaches extended entity data to any object
XDLIST Lists extended entity data attached to object
XLIST Displays properties of entities nested in external references or blocks

Show me more...

AutoCAD: Missing Dialog Boxes

If you can't find a dialog box that is supposed to appear here you'll find the solution.
Català - Castellano
Recently my company upgraded from Autodesk Architectural Desktop 2006 to AutoCAD Architecture 2008. We found the problem that in any computer we ran AutoCAD architecture, the dialog Boxes were missing when running commands such as HATCH or calling the Layer Manager.
The problem seems to come from some sort of hardware issue. We couldn't figure out the way to solve it till we found out that the dialog boxes were not missing, but far away on the left side (outside the screen resolution area).
The solution we found might not fight the source of the problem, but it definitively worked as a solution for us.
After running a command that should call a dialog box like Hatch, we press together Alt+Space+Enter. Then press the right arrow and keep pressing it until, surprise, the dialog box appeared from the left side of the screen.
This is a basic Windows procedure, If you click Alt+Space in any explorer window you will see a dialog open with the options Restore, Move, Size, Minimize, Maximize and Close. The same happens with the Dialog Boxes in AutoCAD, but the only options in most of them are Move and Close. Since Move is the default one, by pressing Alt+Space+Enter we will have selected to move the dialog box without the need to see it. Then we will use the arrows to move it till it appears on scree.

Show me more...

AutoCAD: Disabling selection preview for Hatches

Do you get stuck in the selection preview of complex objects?A nice feature like the selection preview can become really annoying if we are working with dense hatch patterns.
What selection preview does is that it highlights the object we are going to select if we click the left mouse button. This works very nice and smooth with simple objects like lines, polylines, arcs, etc. It happens though that when we have a dense hatch, specially if it is a hatch made of dots it might take several seconds to show the selection preview due to the amount of objects in the hatch pattern.
Although we can turn off the selection preview turning the SELECTIONPREVIEW system variable to 0, what we actually want to do is to keep it on for some elements and off for some others like hatch patterns.
We have two options to do that.
  1. Set the system variable PREVIEWFILTER to 16, this will only exclude hatch patterns from the selection previews.
  2. Go to Format --> Options --> Selection Tab -->Visual Effects Options --> Advanced Options --> Uncheck the Box in front of Hatch Patterns.
See it in a couple of images for more detailed reference.









Show me more...