I'm looking to get my hands on a lisp routine that will draw a uniform "zig zag" patter along a pline. Can anyone point me in the right direction, or pass along their own lisp? Thank you in advance for any help.
Jarrad
Have you loaded that line type? most autocad version has it.
Looks like this
*ZIGZAG,Zig zag /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
A,.0001,-.2,[ZIG,ltypeshp.shx,x=-.2,s=.2],-.4,[ZIG,ltypeshp.shx,r=180,x=.2,s=.2],-.2
(still needs ltypeshp.shx to run)
@Anonymous wrote:I'm looking to get my hands on a lisp routine that will draw a uniform "zig zag" patter along a pline. ....
Since you use the word "Flex" in your Subject, and since flexible ductwork is often represented with zig-zag lines, I assume that's what you're talking about. I don't think AutoCAD's ZIGZAG linetype looks very good for that [too loose with its 90-degree bends], so I made my own. This goes in the .lin file:
*FLEXDUCT,Tight zig-zag /\/\/\/\/\/\/\/\/\
A,.0001,-.25,[FLEXDUCT,YourShapeFile.shx,x=-.25,s=.25],-.5,[FLEXDUCT,YourShapeFile.shx,r=180,x=.25,s=.25],-.25
and this [change the 141 if you need to] goes in the YourShapeFile.shp/.shx file:
*141,7,FLEXDUCT
8,(1,8),8,(1,-8),0
It looks like the attached image. Use a linetype scale of the width [diameter] you want divided by the real-world-to-drawing ratio [usually in the DIMSCALE System Variable] -- e.g. for 6" diameter flex duct in a drawing at 1/4"=1'-0" scale, give things drawn with this a linetype scale of 6 divided by 48 = 0.125.
Kent, getting error when trying to load the FLEXDUCT linetype. error is
Bad definition of FLEXDUCT at line 128 (128 may or may not be important) of file ..... acad.lin
you mention possibly the 141?? may need to be changed or revised... to what?
I fixed/added ltypeshp.shx to the definition... thats ok.
attached is what I patched into acad.lin
*FLEXDUCT,Tight zig-zag /\/\/\/\/\/\/\/\/\
A,.0001,-.25,[FLEXDUCT,ltypeshp.shx,x=-.25,s=.25],-.5,[FLEXDUCT,ltypeshp.shx,r=180,x=.25,s=.25],-.25
however acad didn't like it...
thx in advance for look-see
Steve
See post. I thought the Flex2point.lsp on the last post was good.
http://forums.autodesk.com/t5/Visual-LISP-AutoLISP-and-General/Flexible-Duct/td-p/1962520/page/2
@stevesfr wrote:.... error is
Bad definition of FLEXDUCT at line 128 (128 may or may not be important) of file ..... acad.lin
you mention possibly the 141?? may need to be changed or revised... to what?
....
The 141 just needs to be different from the number in the same position for other shape definitions, which it may not be if you have a lot of added ones beyond those that come in AutoCAD's ltypeshp.shp file.
If it's the last shape definition in the file, I think you need to finish the last line with an Enter, so the ctrl-End location in the file is an empty line at the end, not the end of a line with content.
Good suggestion, but that is not the problem. Acad sez its in this line,
A,.0001,-.25,[FLEXDUCT,ltypeshp.shx,x=-.25,s=.25],-.5,[FLEXDUCT,ltypeshp.shx,r=180,x=.25,s=.25],-.25
anyone else get this to work besides Kent?
Steve, it worked for me but I pasted Kent's data into my own shape file for my custom linetypes and not into the AutoCAD standard. I adjusted the number (141) to the next number of my last shape definition and compiled the file. I then pasted the data into my lin file and it worked. You may need to post both your lin and shp files to see where the problem is.
OK here are my acad.lin and my ltypeshp.shp files. You may have to rename them because of frowned upon file types here. (yawn) rename acad.txt to acad.lin and rename ltypeshp.txt to ltypeshp.shp
TIA
Steve
Go to the end of line of Kent's data (.25) and hit the return key and save the file. There needs to be a line between Kent's data and the ;; HTH.
@stevesfr wrote:.... Acad sez its in this line,
A,.0001,-.25,[FLEXDUCT,ltypeshp.shx,x=-.25,s=.25],-.5,[FLEXDUCT,ltypeshp.shx,r=180,x=.25,s=.25],-.25
When I copy and paste that line into Notepad, there's an unknown-character rectangle between the comma after the first right bracket and the -.5 [between the two bold red characters as quoted above]. It's not there when I copy and paste from the source line in my first post, nor of course in my .lin file. Check that something hasn't crept in there in the process of your copying/pasting/editing.
[EDIT -- to further muddy the waters, I get the extra character when I copy/paste from your message that this one is in reply to, but not when I do it from this reply.]
I did a cut/paste into Notepad and I do not get that extra character you state. Hmmmmmm!!!!
Something to watch out for in the future.
By the way thanks for sharing your info.
I hoping to learn something tonight, but I guess we'll hope for tomorrow.
would someone care to share their acad.lin, maybe I'll see the forrest instead of the trees, and put the two side by side.
Steve
Your portion of your file
;*FLOW,---->---->---->---->
;A,.5,-.5,["g",WINGDINGS,S=.5,R=0.0,X=-0.4,Y=-0.25],-.25
*FLEXDUCT,Tight zig-zag /\/\/\/\/\/\/\/\/\
A,.0001,-.25,[FLEXDUCT,ltypeshp.shx,x=-.25,s=.25],-.5,[FLEXDUCT,ltypeshp.shx,r=180,x=.25,s=.25],-.25
;; Add any linetypes that you define to this section of [Here is where your problem is, no line separation]
;; the file to ensure that they migrate properly when
;; upgrading to a future AutoCAD version. If duplicate
This is where the fix needs to be.
;*FLOW,---->---->---->---->
;A,.5,-.5,["g",WINGDINGS,S=.5,R=0.0,X=-0.4,Y=-0.25],-.25
*FLEXDUCT,Tight zig-zag /\/\/\/\/\/\/\/\/\
A,.0001,-.25,[FLEXDUCT,ltypeshp.shx,x=-.25,s=.25],-.5,[FLEXDUCT,ltypeshp.shx,r=180,x=.25,s=.25],-.25
[Need a line separation here, see the rest of your file, see the difference between the AutoCAD, ISO's and Complex]
;;
;; Add any linetypes that you define to this section of
;; the file to ensure that they migrate properly when
;; upgrading to a future AutoCAD version. If duplicate
Corrected file attached
Cheer up, No big deal........
Try these. Just rename by removing the txt and insert a period in front of lin, shp and shx. Which you could have figured out on your own, Hope this fixes things. Later.
@stevesfr wrote:That did not help. I must have something else royally screwed up.
Just to confirm -- the .shp file needs to be Compiled into a .shx file before the .lin file can use what's in it. You would certainly have a problem without that, and it's not quite clear to me in earlier messages whether that's been done.
[I'd also be interested in whether thread-originator jarrad27 has tried it and gotten it to work, just as a comparison test, or perhaps went for the Flex2point routine from the link azrdgldr posted.]