Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

10"x72" 1/3 offset running bond pattern

15 REPLIES 15
SOLVED
Reply
Message 1 of 16
sbrasher
1524 Views, 15 Replies

10"x72" 1/3 offset running bond pattern

I've been trying to write a .pat file to acheive a 10"x72" tile pattern with a 1/3 stepped offset for hours. I feel like an idiot, because I just can't figure it out. Can someone help me?

15 REPLIES 15
Message 2 of 16
Kent1Cooper
in reply to: sbrasher

*YourPatternName, 10x72 1/3-offset running bond
0, 0,0, 0,10
90, 0,0, 10,24, 10,-20

 

Remember that it either needs to be added into AutoCAD's pattern file or [preferable] have a file of its own, with the file name exactly matching the pattern name [not including the .pat filetype ending], and the file must end with a blank line, not the last line of the definition code.

 

If you post what you had gotten to, we could maybe point out what's off, which may help you understand better how they work for future use.

Kent Cooper, AIA
Message 3 of 16
sbrasher
in reply to: sbrasher

Thank you so much!!

 

The number that I had wrong was the last number of the second line: -20.

 

Can you please tell me what that number represents in the hatch?

Message 4 of 16
Kent1Cooper
in reply to: sbrasher

You can read about them >here<.  The last two [in this case -- can be more] numbers are the dash-and-gap pattern for the "infinite" vertical lines [fewer numbers in the first line of the definition, because that's for the continuous lines -- no dash-gap pattern].  The positive number is the "pen-down" distance, the negative number is the "pen-up" distance before it puts the pen down again.

Kent Cooper, AIA
Message 5 of 16
sbrasher
in reply to: sbrasher

I read the article... I'm still not clear about the number 20. How does that relate to the tile dimension of 10x72?

Message 6 of 16
hugha
in reply to: sbrasher

The draw/skip distances specified beyond each line's fifth element are inline with the line angle.

20 is the height of two bricks.
10,-20 instructs AutoCAD to draw one perpend then jump two courses before restarting the next inline.

hth,
Hugh Adamson
www.hatchkit.com.au
Message 7 of 16
Kent1Cooper
in reply to: sbrasher

Graphically, and color-coded:

Kent1Cooper_0-1667129348260.png

*YourPatternName, 10x72 1/3-offset running bond
0, 0,0, 0,10
90, 0,0, 10,24, 10,-20

Kent Cooper, AIA
Message 8 of 16
sbrasher
in reply to: Kent1Cooper

That is super helpful, thank you. So the 72" distance between vertical lines is determined by the vertical distance that is skipped before the original vertical line is repeated? (I hope that makes sense 😜)

Message 9 of 16
Sea-Haven
in reply to: sbrasher

I was inspired by Kent with the other make hatch pattern so had a go at this one. Change the output directory and the default values to suit I am metric.

 

 

 

; make herringbone pattern offset running bond
; By Alan H Oct 2022

(defun c:HerringboneB ( / ans len ht rat patname hatname fname )

(if (not AH:getvalsm)(load "Multi Getvals.lsp"))
(setq ans (AH:getvalsm (list "Enter values " "Length " 5 4 "100" "Height " 5 4 "50" "Ratio 1 /  " 5 4 "2")))
(setq len (atof (car ans))
ht (atof (cadr ans))
rat (atof (caddr ans))
)

(setq patname (strcat "Herringbone-" (cadr ans) "-" (car ans) "-" (caddr ans)))
(setq hatname (strcat patname "," (cadr ans) "x" (car ans) " 1/" (caddr ans) "-offset running bond"))


(setq fo (open (setq fname (strcat "d:\\acadtemp\\" patname ".pat" )) "W")) ; change hard coded directory
(write-line (strcat "*" hatname) fo)
(write-line (strcat "0, 0,0, 0," (cadr ans)) fo)
(write-line (strcat "90, 0,0 " (cadr ans) "," (rtos (/ len  rat) 2 0) ", " (cadr ans) "," (rtos (* -2 ht) 2 0)) fo)
(close fo)
(princ)

)

 

SeaHaven_0-1667175867371.png

 

 

*Herringbone-10-72-3,10x72 1/3-offset running bond
0, 0,0, 0,10
90, 0,0 10,24, 10,-20

 

 

Message 10 of 16
Kent1Cooper
in reply to: Sea-Haven

Three comments:

 

It's not a herringbone pattern.

 

The pen-up portion of the second line-set code would be:

(rtos (* -2 ht) 2 0)

only when the offset ratio is 1/3, but the dialog box is allowing for different denominators.  Shouldn't that be multiplying 'ht' by the negative of one less than the denominator number, not always by -2 ?

 

Doesn't it need to write a blank line "" at the end for the file to work properly?

Kent Cooper, AIA
Message 11 of 16
Kent1Cooper
in reply to: sbrasher


@sbrasher wrote:

.... So the 72" distance between vertical lines is determined by the vertical distance that is skipped before the original vertical line is repeated? (I hope that makes sense 😜)


I would describe it as determined by the fact that 72 is 3 times the "delta-y" value of 24 [the 24 is your 1/3 stagger], combined with not so much the distance that is skipped per se, but the fact that the pen-down portion is drawn into every third row [the pen-down + pen-up total is 3 times the row height].

Kent Cooper, AIA
Message 12 of 16
Sea-Haven
in reply to: Kent1Cooper

Will fix and change name,  when are Autodesk going to allow you to edit a prior post.

 

As the height is fixed 72x10 the ratio comes into effect, only changing the ratio of length to next tile so the -20 is correct. 2 is mid, 3 is 1/3, 4 is 1/4 and so on.

SeaHaven_0-1667186120130.png

Change to a more correct name

(defun c:Tilepat ( / ans len ht rat patname hatname fname )

(setq patname (strcat "Tile-" (cadr ans) "-" (car ans) "-" (caddr ans)))

 

 

 

Message 13 of 16
Kent1Cooper
in reply to: Sea-Haven


@Sea-Haven wrote:

.... when are Autodesk going to allow you to edit a prior post.

As the height is fixed 72x10 the ratio comes into effect, only changing the ratio of length to next tile so the -20 is correct. 2 is mid, 3 is 1/3, 4 is 1/4 and so on.

....


[You can edit your post.  They've removed the former 30-minute limit on that.  Pick the three-dots thing at upper right, and choose Edit Reply at the top.]

 

Your tiles clearly do not fit that "fixed 72x10" part:

Kent1Cooper_0-1667320669629.png

Kent Cooper, AIA
Message 14 of 16
Kent1Cooper
in reply to: Kent1Cooper


@Kent1Cooper wrote:

....  Shouldn't that be multiplying 'ht' by the negative of one less than the denominator number, not always by -2 ?

Doesn't it need to write a blank line "" at the end for the file to work properly?


On the first one, it needs to be that way if the element (tile, brick, board, etc.) size is to remain the same.  On the second, it doesn't -- the (write-line) function includes "Enter" at the end of the line it writes, so the empty blank line at the end of the file is there just from the last line of code it adds.

 

Attached is RunningBondStaggerPAT.lsp to generate pattern definitions like this, where the User specifies the dimensions of the elements and the fraction of length to stagger them by.  You can determine the direction of the stagger by the sign of the stagger-fraction denominator.  So far, it only works where the stagger fraction is 1 over an integer.  It can even accept a denominator of 1, which produces stack bond, i.e. a "stagger" of a whole element length.  It may be possible to allow for other fractions of stagger, such as 2/5, 3/10, etc., but I haven't yet thought much about how to work out the pen-down-pen-up cycling for that.

 

BEFORE YOU LOAD IT, heed the EDIT instruction about the filepath location for the .pat file.

 

EDIT:  I decided there wasn't any reason the "Length" [horizontal dimension of elements when used at 0 rotation] needs to be greater than the "Width" [vertical] -- it can make patterns like this:

Kent1Cooper_0-1667912301623.png

So I changed the prompts a little, and replaced the file.

Kent Cooper, AIA
Message 15 of 16
Kent1Cooper
in reply to: Kent1Cooper


@Kent1Cooper wrote:

.... So far, it only works where the stagger fraction is 1 over an integer.  ....  It may be possible to allow for other fractions of stagger, such as 2/5, 3/10, etc., ....

....


I worked that out.  Here's RunningBondHPG.lsp with its RBHPG command [the HPG stands for Hatch Pattern Generator] that allows for such fractions, and "cleans up" some other things [for instance, if your choices result in stack bond, it uses "Stack" instead of "Running" as part of the pattern and file names, or if they result in a "stagger" of half the elements' horizontal dimension, that's just standard for running bond so it doesn't spell out the stagger fraction in the names].  See the comments at the top of the file for more detail.

 

This from before still applies:

BEFORE YOU LOAD IT, heed the EDIT instruction about the filepath location for the .pat file.

Kent Cooper, AIA
Message 16 of 16
herbine
in reply to: Kent1Cooper

Kent,

I want to thank you for your input and this .lsp routine. It works great!

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Technology Administrators


Autodesk Design & Make Report