Jump to content

ANSI B16.5 Flanges Lisp


The Buzzard

Recommended Posts

Hello Everyone,

 

Here is another entmake program that creates ANSI B16.5 Flanges fast. A portion of this program was from Afralisp and modified with better error trapping and external data entries. Thanks to Lee on that as well as the list boxes. This program also has built-in instructions. The program will allow you to switch insertion point locations to install the flanges either to a pipe or flanges face to face without additional maneuvering. The program has a provision to insert the flange in SI units. Layer names, colors, line type and line weight can be edited to suit your standard. Flange range: 1/2" thru 24".

 

This program requires the following files below to work properly.

Make sure to have these files together in the same directory.

Also make sure the the directory is in the AutoCAD Support File Search Path.

This program has a built-in ALERT to let you know if a DIM file is missing. (See Image Below)

 

AF1.dcl - AutoCAD Dialog Definition, Size 3 KB"

AF1.lsp - AutoLISP Application Source, Size 57 KB"

AF1_150#.dim - DIM File, Size 4 KB "

AF1_300#.dim - DIM File, Size 4 KB"

AF1_400#.dim - DIM File, Size 4 KB"

AF1_600#.dim - DIM File, Size 4 KB"

AF1_900#.dim - DIM File, Size 3 KB"

AF1_1500#.dim - DIM File, Size 4 KB"

AF1_2500#.dim - DIM File, Size 3 KB"

 

Give it a try and let me know how it goes.

See attached AF1_V1.zip below.

 

Command syntax is: AF1

 

You can find information here with regard to loading the program: http://www.cadtutor.net/forum/showthread.php?t=1390

 

For ANSI B16.47 Flanges, Go to this thread:http://www.cadtutor.net/forum/showthread.php?t=48567

 

For ASME Pressure Vessel Heads, Go to this thread:http://www.cadtutor.net/forum/showthread.php?t=47451

 

Attention - Revision V2 Sept 17, 2010

;
;/////////////////////////////////////////////////////////////////////////////////////////
;
; Do Not Remove This Header!
;
; Revisions.
; Note: Be sure to add the most recent revision date and version in the About Dialog Page. 
;-----------------------------------------------------------------------------------------
; Version | Change                                                              | Date
;-----------------------------------------------------------------------------------------
; V1      | Add section in AF1_SFS for user layer modification                  | 05|27|10
[color=red][b]; V2      | Removed AF1_PL Program Loop function and replace with while loop    | 09|17|10[/b][/color]
; XXXX    | XXXXX                                                               | XX|XX|XX
; XXXX    | XXXXX                                                               | XX|XX|XX
;
;/////////////////////////////////////////////////////////////////////////////////////////
;  

Document1.JPG

Document2.JPG

Document3.JPG

AF1_V2.zip

Edited by The Buzzard
Revision V2
Link to comment
Share on other sites

  • Replies 32
  • Created
  • Last Reply

Top Posters In This Topic

  • The Buzzard

    10

  • ReMark

    5

  • kramerO

    4

  • Jim Clayton

    4

Top Posters In This Topic

Posted Images

Jeez Buzzard. It's like I got up this morning only to realize it was Christmas and someone (you) left me a big present under the Christmas tree. Thanks Santa!

Link to comment
Share on other sites

Good deal,

 

I am sure you and many others can find a need for this lisp. Its just one of the programs I had to just make to say I did it. I wanted to make another for ANSI B16.47 Flanges, But since the sizes are huge, The specs for pipe sizing from 26" to 60" are hard to find. I am still searching. I have other programs in line to get started on anyway.

 

Enjoy it and let me know how well it works for you.

The Buzzard

Link to comment
Share on other sites

Attention All,

 

Code has been modified to allow user to change all Layer related modifications in one location to make it easier.

See Post 1 for updated code.

 

The section below can be found in function F06 - Set Flange Selection AF1_SFS

Just change the information highlighted in red as shown below.

 

Note: Information for the linetype is from acad.lin (Imperial) and acadiso.lin (SI)

 

The TPL variable value is SLEN1+SLEN2+SLEN3+SLEN4 = TPL

 

Compare the values in the linetype definitions to the values in the code, This gives you some idea how to set your linetype.

 

From acad.lin

*CENTER2,Center (.5x) ___ _ ___ _ ___ _ ___ _ ___ _ ___
A,.75,-.125,.125,-.125 

 

From acadiso.lin

*CENTER2,Center (.5x) ___ _ ___ _ ___ _ ___ _ ___ _ ___
A, 19.05, -3.175, 3.175, -3.175  

 

This is what it looks like.

;=========================================================================================
;
; Note: You can modify Layer Names, Color, Linetype and Lineweight Below.
;
 (setq FLNAM "[color=red]M-PROC-NOZZ[/color]")                                     ;Flange Layer Name
 (setq FLCLR [color=red]1[/color])                                                 ;Flange Layer Color
 (setq FLTYP "[color=red]Continuous[/color]")                                      ;Flange Linetype
 (setq FLWGT [color=red]35[/color])                                                ;Flange Lineweight
 (setq CLNAM "[color=red]M-PROC-NOZZ-CLIN[/color]")                                ;Center Line Layer Name
 (setq CLCLR [color=red]5[/color])                                                 ;Center Line Layer Color
 (setq CLTYP "[color=red]CENTER2[/color]")                                         ;Center Line Linetype
 (setq CLWGT [color=red]18[/color])                                                ;Center Line Lineweight
 (setq CDESC "[color=red]Center (.5x) ___ _ ___ _ ___ _ ___ _ ___ _ ___[/color] ") ;Center Line Description
 (cond
   ((= DUNT "IMP")                                              ;If Imperial Units
    (setq TPL    [color=red]1.125[/color]                                          ;Total Pattern Length (Imperial)
          SLEN1  [color=red]0.75[/color]                                           ;Segment Length 1 (Imperial)
          SLEN2 [color=red]-0.125[/color]                                          ;Segment Length 2 (Imperial)
          SLEN3  [color=red]0.125[/color]                                          ;Segment Length 3 (Imperial)
          SLEN4 [color=red]-0.125[/color]))                                        ;Segment Length 4 (Imperial)
   ((= DUNT "SI")                                               ;If SI Units
    (setq TPL   [color=red]28.575[/color]                                          ;Total Pattern Length (SI)
          SLEN1 [color=red]19.05[/color]                                           ;Segment Length 1 (SI)
          SLEN2 [color=red]-3.175[/color]                                          ;Segment Length 2 (SI)
          SLEN3  [color=red]3.175[/color]                                          ;Segment Length 3 (SI)
          SLEN4 [color=red]-3.175[/color])))                                       ;Segment Length 4 (SI)
;
; End of Layer Modify
;
;=========================================================================================  

Link to comment
Share on other sites

You've been a busy guy there Buzzard. Thanks for the update.

ReMark,

 

I am just making sure that you know the update you are referring to is on another thread similar to this. The B16.5 flanges are still the same and have no update. I added a new program on its own thread for B16.47 flanges. These have a larger range from 26" to 60" IPS.

 

Anyway, How is the ANSI B16.5 flange program working for you?

Have you noticed any problems yet?

 

Please let me know if everything is Ok with both these programs. Any quirks you find I will fix.

 

Later,

The Buzzard

Link to comment
Share on other sites

  • 3 months later...
Buzzard, - i've been wanting something like this for years.. Thanks boss hog!

 

Your very welcome, Enjoy the program.

Also note that I have another thread for larger range ANSI B16.47 flanges also. The thread can be found in my signature.

Link to comment
Share on other sites

  • 2 weeks later...
I can't download this feature, plese help me...

 

shuken:

 

Click on this link: http://www.cadtutor.net/forum/showthread.php?48567-ANSI-B16.47-Flanges-Lisp then scroll down until you see the AF2.zip file and download it.

 

I just tested these mere seconds ago and had no trouble downloading the file. Perhaps you did something wrong. Try again.

Link to comment
Share on other sites

I can't download this feature, plese help me...

 

I am not sure about this, But since you have only one post you may need to accumulate more posts before you can download.

At least I think thats the problem. I could not spot it in the FAQ about this.

Link to comment
Share on other sites

  • 2 weeks later...

shuken,

I just downloaded the program and everything worked fine.

I use Mozilla Firefox browser and the dialog pops up asking what to do with the file.

Link to comment
Share on other sites

to the buzzard

 

re:http://www.cadtutor.net/forum/showthread.php?52800-Free-flange-lisp&p=358717#post358717

i agree with your comments on the data for the flange program.

the author noted in T%Welded-Flange-Data.LSP:

"Dimensional & Weight data for Welded Pipe Flanges, 125# through 2500#.

obtained from the Tube Turn catalog 311, Nov. 1972."

1972?

for my own use, i intend to check all the data.

 

digger

Link to comment
Share on other sites

The Buzzard,

Nice Program.

I finally had a chance to run it today.

Question, is the side image for WN supposed to be different than the SO, SW & TH?

Link to comment
Share on other sites

The images are just shown as a typical face or side image. As you know the actual flanges have different hole qty, sizes, etc etc. So a typical image just representing face and side are used and then I will either show or not show the raised face depending on the selection. If you go to the end of the lisp you will notice a function with many numbers for vector image. The more detailed you get the more numbers you end up with and thus a very large program. In the arrangement of these images you can show a portion thats common in all the flanges then add or subtract from the image what may be different.

 

I use an external lisp routine to create these lists that you see and program them in a way to show as much detail as needed without going overboard.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...