Jump to content

Recommended Posts

Posted

I am drawing blocks of threaded and socket weld pipe fittings in all normally used views and because the O.D. of the ends of the fittings varies with material and pressure class, for rotated views I create ellipses using the center ellipse command, then enter "R" for rotation then enter the rotation angle.

Does anyone have a lisp that will allow me to pick the diameter (or center and long axis) with 2 points and have the routine to initiate the rotation at 45 and finish the ellipse.

 

thanks,

kramerO

Posted
....., for rotated views ...

thanks,

kramerO

 

what do you mean by that?

Posted

pBe,

The image shows 3"-300# Malleable Iron 90 Degree Elbow and 3"-300# Malleable Iron Straight Tee in both the rolled up and rolled down positions.

 

karmerOROLLED FITTINGS.jpg

Posted

This?

 

(defun c:e45 ( / p1 p2 )

 (if
   (and
     (setq p1 (getpoint "\nAxis Endpoint: "))
     (setq p2 (getpoint "\nOther Endpoint: " p1))
   )
   (command "_.ellipse" "_non" p1 "_non" p2 "_R" 45.0)
 )
 (princ)
)

Posted

kramer0

 

Have you thought about 3D modeling? That would make life a lot easier with that type of work. -David

Posted

Or, as an improvement on the previous code:

 

(defun c:e45 ( / *error* p1 p2 cmd )

 (defun *error* ( msg )
   (if cmd (setvar 'CMDECHO cmd))
   (or (wcmatch (strcase msg) "*BREAK,*CANCEL*,*EXIT*")
       (princ (strcat "\n** Error: " msg " **")))
   (princ)
 )

 (setq cmd (getvar 'CMDECHO))
 (setvar 'CMDECHO 0)

 (if
   (progn
     (initget "Center")
     (setq p1 (getpoint "\nSpecify Axis Endpoint [Center]: "))
   )
   (cond
     (
       (eq "Center" p1)

       (if
         (and
           (setq p1 (getpoint "\nSpecify Center of Ellipse: "))
           (setq p2 (getpoint "\nSpecify Endpoint of Axis: " p1))
         )
         (command "_.ellipse" "_C" "_non" p1 "_non" p2 "_R" 45.0)
       )
     )
     ( (setq p2 (getpoint "\nSpecify Other Endpoint of Axis: " p1))

       (command "_.ellipse" "_non" p1 "_non" p2 "_R" 45.0)
     )
   )
 )

 (setvar 'CMDECHO cmd)
 (princ)
)

Posted

Why not use a dynamic block with visibility states and just set scale for size?

Posted
Why not use a dynamic block with visibility states and just set scale for size?

 

Surely pipe fitting dimensions aren't linearly scaled though?

Posted
Surely pipe fitting dimensions aren't linearly scaled though?

I have a few pipe fitting blocks I use for details that I scale to match the pipe diameter.

Posted
I have a few pipe fitting blocks I use for details that I scale to match the pipe diameter.

 

Surely that doesn't fit with spec though? I don't believe pipe fitting dimensions are scaled linearly as the diameter increases - surely one would need a block for each size?

Posted
Surely that doesn't fit with spec though? I don't believe pipe fitting dimensions are scaled linearly as the diameter increases - surely one would need a block for each size?

Not sure. These are pretty generic. Remember, I'm only Civil, so if I've spoken out of place, I apologize.

Posted

Maybe not linear but definitely programable.

 

I'd still recommend a 3D route if you are doing a lot of this kind of stuff.

ar-amp.jpg

3d-amp.dwg

P-SAMP.GIF

P-SAMP.DWG

Posted
kramer0

 

Have you thought about 3D modeling? That would make life a lot easier with that type of work. -David

David,

That stuff is way over my head. I can barely draw lines and circles in 2D.

That for the suggestion though.

 

kramerO

Posted

Lee Mac,

Thanks, man. I'll try the lisp as soon as I go offline.

Are you from another planet? Does Kryptonite bother you?

 

thanks again,

kramerO

Posted
Why not use a dynamic block with visibility states and just set scale for size?

alanjt,

My ACAD version is pre dynamic blocks, and like Lee Mac says, I don't think they would work for threaded and socketweld pipe fittings. I tried doing some scaling and it doesn't give required results. The malleable iron fittings are per ASME B16.3 if you want to see all the crazy dimensions.

The reason I am drawing these fittings is to share with the world. I have searched high and low and can find some welded fittings but not Mallleable Iron, Cast Iron and Forged Steel threaded and socketweld. Where I worked they had a third party piping software for both MicroCrap and AutoCAD. Neither produces these fitting dimensioned correctly.

I will be doing ALL pipe fittings that I can find dimensions for.

Thanks to all you guys for just being available for answers/suggestions.

 

kramerO

Posted
Or, as an improvement on the previous code:

 

(defun c:e45 ( / *error* p1 p2 cmd )

 (defun *error* ( msg )
   (if cmd (setvar 'CMDECHO cmd))
   (or (wcmatch (strcase msg) "*BREAK,*CANCEL*,*EXIT*")
       (princ (strcat "\n** Error: " msg " **")))
   (princ)
 )

 (setq cmd (getvar 'CMDECHO))
 (setvar 'CMDECHO 0)

 (if
   (progn
     (initget "Center")
     (setq p1 (getpoint "\nSpecify Axis Endpoint [Center]: "))
   )
   (cond
     (
       (eq "Center" p1)

       (if
         (and
           (setq p1 (getpoint "\nSpecify Center of Ellipse: "))
           (setq p2 (getpoint "\nSpecify Endpoint of Axis: " p1))
         )
         (command "_.ellipse" "_C" "_non" p1 "_non" p2 "_R" 45.0)
       )
     )
     ( (setq p2 (getpoint "\nSpecify Other Endpoint of Axis: " p1))

       (command "_.ellipse" "_non" p1 "_non" p2 "_R" 45.0)
     )
   )
 )

 (setvar 'CMDECHO cmd)
 (princ)
)

Lee Mac,

I've been offline playing with this new toy (tool).

Works perfectly. I really appreciate you taking your valuable time to write this for me.

thanks,

kramerO

Posted
Lee Mac,

I've been offline playing with this new toy (tool).

Works perfectly. I really appreciate you taking your valuable time to write this for me.

thanks,

kramerO

 

You're very welcome KramerO - happy I could be of help :)

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