Jump to content

ANSI B16.47 Flanges Lisp


The Buzzard

Recommended Posts

Hello Everyone,

 

Here is another entmake program that creates ANSI B16.47 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: 26" thru 60".

 

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)

 

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

AF2.lsp - AutoLISP Application Source, Size 63 KB"

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

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

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

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

AF2_A_900#.dim - DIM File, Size 2 KB"

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

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

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

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

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

AF2_B_900#.dim - DIM File, Size 2 KB"

 

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

See attached AF2.zip below.

 

Command syntax is: AF2

 

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

 

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

 

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      | Fix bad function call problem in AF2_CFV                            | 06|05|10
[color=red][b]; V2      | Removed AF2_PL Program Loop function and replace with while loop    | 09|17|10[/b][/color]
; XXXX    | XXXXX                                                               | XX|XX|XX
; XXXX    | XXXXX                                                               | XX|XX|XX
;
;/////////////////////////////////////////////////////////////////////////////////////////

 

 

 

I made a section in the code for you to edit layers and linetypes. Just edit the RED highlighted sections as shown below.

;=========================================================================================
;
; Note: Here 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
;
; Note: The information below for the linetype is from acad.lin and acadiso.lin
;
 (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
;
;=========================================================================================  

Document1.JPG

Document2.JPG

AF2_V2.zip

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

Attention All,

 

I had to fix a bad function call in the program. The latest fix is now uploaded to the first post. I would also ask that you please test the program and report back any other problems you may find.

 

Sorry about that.

Please enjoy the program

The Buzzard

Link to comment
Share on other sites

  • 4 months later...
  • 7 months later...

I can not use, position in file c:, then "load application" and write AF1 and AF2 in the command line, and I do not see anything, I get the following error

Command: af1

** DCL ** File not Found

 

What am I doing wrong?

 

I have autocad 2008

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...