Jump to content

Creating Isometric slope hatches in AutoCAD 2014? HELP!


tmelancon

Recommended Posts

Hello all, I work primarily in the piping industry and we do not use Autocad 3D Plant because we aren't in the design industry but rather more in the maintenance part of it. That being said we do not have the piping slope hatching functionality. See Photo for slope hatching example.

 

We use this for 45 degrees, rolled 45 degrees and rolled 90 degree elbows. If someone can chime in a maybe share something that would be useful to us to aid in the automation of creating this hatch quickly I would greatly appreciate it.

 

0EM30000000UvGo

Link to comment
Share on other sites

  • Replies 27
  • Created
  • Last Reply

Top Posters In This Topic

  • tmelancon

    15

  • Lee Mac

    9

  • ROBP

    1

  • rlx

    1

Top Posters In This Topic

Posted Images

Hello all, I work primarily in the piping industry and we do not use Autocad 3D Plant because we aren't in the design industry but rather more in the maintenance part of it. That being said we do not have the piping slope hatching functionality. See Photo for slope hatching example.

 

We use this for 45 degrees, rolled 45 degrees and rolled 90 degree elbows. If someone can chime in a maybe share something that would be useful to us to aid in the automation of creating this hatch quickly I would greatly appreciate it.

 

0EM30000000UvGo

 

have you tried region with batten hatch?

Link to comment
Share on other sites

I never use iso's myself but for my colleagues I did write a program , RlxIso. If I have some spare time I can ask them how this should work and maybe update my program (if they are interested at all). To me it looks just like a isometric triangle with a user hatch at 90 degrees. Right now I'm in the middle of a major shutdown at the plant I'm working so not sure if I have any time soon.

 

gr. Rlx

Link to comment
Share on other sites

Maybe explain a little bit more in what you are wanting that the basic bhatch function won't provide. Whether the iso is 2d or a 3d view the bhatch works just fine, so I am guessing you are wanting more?

Link to comment
Share on other sites

To clarify, right now my office is having to manually draw the right triangles (i.e. using simple line command or offset command) and then we apply hatching depending on whether the angle is a vertical angle or a horizontal angle.

 

My question pertains to a lisp that can automate the creation of the triangle and the hatching ( I should have been more specific in the title, but thats what AutoCAD Plant 3D calls it). We can manually draw, trim and hatch these all day no problems as this is rudimentary cad operations, however. The downfall is when you have dozens of angles throughout a piping circuit and have dozens to complete each day.

 

I need someone to help with a lisp routine to automate the triangle and the hatching in a click or two. Heres a screen shot from my program to show example. The first image was taken from AutoCAD Plant 3D and was just for reference.

 

QeJpXmo5vOAMAAAAABJRU5ErkJggg==

Link to comment
Share on other sites

This looked like an interesting program to write - please try the following (adjust the settings at the top to suit):

[color=GREEN];;----------------------=={ Isometric Triangle }==----------------------;;[/color]
[color=GREEN];;                                                                      ;;[/color]
[color=GREEN];;  Prompts the user to pick two points at a non-isometric angle and    ;;[/color]
[color=GREEN];;  proceeds to construct a hatched isometric right-angled triangle,    ;;[/color]
[color=GREEN];;  offset from the two given points by a distance specified in the     ;;[/color]
[color=GREEN];;  code.                                                               ;;[/color]
[color=GREEN];;----------------------------------------------------------------------;;[/color]
[color=GREEN];;  Author:  Lee Mac, Copyright © 2015  -  www.lee-mac.com              ;;[/color]
[color=GREEN];;----------------------------------------------------------------------;;[/color]
[color=GREEN];;  Version 1.0    -    2015-10-06                                      ;;[/color]
[color=GREEN];;                                                                      ;;[/color]
[color=GREEN];;  - First release.                                                    ;;[/color]
[color=GREEN];;----------------------------------------------------------------------;;[/color]
[color=GREEN];;  Version 1.1    -    2015-10-10                                      ;;[/color]
[color=GREEN];;                                                                      ;;[/color]
[color=GREEN];;  - Removed restriction on non-isometric angles (e.g. 60 deg).        ;;[/color]
[color=GREEN];;----------------------------------------------------------------------;;[/color]

([color=BLUE]defun[/color] c:isotri ( [color=BLUE]/[/color] an1 an2 div err hat hpa off pat pi6 ply pt1 pt2 scl spc vt1 vt2 vt3 )

   ([color=BLUE]setq[/color] off 1.0        [color=GREEN];; Triangle offset[/color]
         pat [color=MAROON]"ANSI31"[/color]   [color=GREEN];; Hatch pattern name[/color]
         hpa ([color=BLUE]/[/color] [color=BLUE]pi[/color] 4.0) [color=GREEN];; Hatch angle[/color]
         scl 0.1        [color=GREEN];; Hatch scale[/color]
   )
   ([color=BLUE]cond[/color]
       (   ([color=BLUE]not[/color]
               ([color=BLUE]and[/color]
                   ([color=BLUE]setq[/color] pt1 ([color=BLUE]getpoint[/color] [color=MAROON]"\nPick 1st point: "[/color]))
                   ([color=BLUE]setq[/color] pt2 ([color=BLUE]getpoint[/color] [color=MAROON]"\nPick 2nd point: "[/color] pt1))
               )
           )
       )
       (   ([color=BLUE]progn[/color]
               ([color=BLUE]defun[/color] div ( x m [color=BLUE]/[/color] r )
                   ([color=BLUE]setq[/color] r ([color=BLUE]rem[/color] x m))
                   ([color=BLUE]or[/color] ([color=BLUE]equal[/color] 0.0 r 1e-6) ([color=BLUE]equal[/color] m r 1e-6))
               )
               ([color=BLUE]setq[/color] an1 ([color=BLUE]angle[/color] pt1 pt2)
                     pi6 ([color=BLUE]/[/color] [color=BLUE]pi[/color] 6.0)
               )
               ([color=BLUE]and[/color] (div an1 pi6) ([color=BLUE]not[/color] (div an1 ([color=BLUE]+[/color] pi6 pi6))))
           )
           ([color=BLUE]princ[/color] [color=MAROON]"\nCannot generate triangle for isometric angle."[/color])
       )
       (   ([color=BLUE]or[/color] ([color=BLUE]<[/color]  an1  pi6)
               ([color=BLUE]<[/color] ([color=BLUE]*[/color] 05 pi6) an1 ([color=BLUE]*[/color] 7 pi6))
               ([color=BLUE]<[/color] ([color=BLUE]*[/color] 11 pi6) an1)
           )
           ([color=BLUE]princ[/color] [color=MAROON]"\nCannot generate triangle for iso angles less than 90 degrees."[/color])
       )
       (   ([color=BLUE]progn[/color]
               ([color=BLUE]setq[/color] an2
                   ([color=BLUE]cond[/color]
                       (   ([color=BLUE]<[/color] an1 ([color=BLUE]*[/color] 3 pi6)) pi6)
                       (   ([color=BLUE]<[/color] an1 ([color=BLUE]*[/color] 5 pi6)) ([color=BLUE]*[/color] 5 pi6))
                       (   ([color=BLUE]<[/color] an1 ([color=BLUE]*[/color] 9 pi6)) ([color=BLUE]*[/color] 7 pi6))
                       (   ([color=BLUE]*[/color] 11 pi6))
                   )
               )
               ([color=BLUE]setq[/color] vt1 ([color=BLUE]polar[/color] pt1 an2 ([color=BLUE]/[/color] off ([color=BLUE]sin[/color] ([color=BLUE]abs[/color] ([color=BLUE]-[/color] an1 an2)))))
                     vt2 ([color=BLUE]polar[/color] pt1 an2 ([color=BLUE]/[/color] ([color=BLUE]-[/color] ([color=BLUE]car[/color] pt2) ([color=BLUE]car[/color] pt1)) ([color=BLUE]cos[/color] an2)))
                     vt3 ([color=BLUE]polar[/color] vt1 an1 ([color=BLUE]/[/color] ([color=BLUE]-[/color] ([color=BLUE]car[/color] vt2) ([color=BLUE]car[/color] vt1)) ([color=BLUE]cos[/color] an1)))
               )
               ([color=BLUE]setq[/color] ply
                   ([color=BLUE]vlax-invoke[/color]
                       ([color=BLUE]setq[/color] spc
                           ([color=BLUE]vlax-get-property[/color]
                               ([color=BLUE]vla-get-activedocument[/color] ([color=BLUE]vlax-get-acad-object[/color]))
                               ([color=BLUE]if[/color] ([color=BLUE]=[/color] 1 ([color=BLUE]getvar[/color] 'cvport)) 'paperspace 'modelspace)
                           )
                       )
                       'addlightweightpolyline
                       ([color=BLUE]apply[/color] '[color=BLUE]append[/color]
                           ([color=BLUE]mapcar[/color]
                              '([color=BLUE]lambda[/color] ( x ) ([color=BLUE]reverse[/color] ([color=BLUE]cdr[/color] ([color=BLUE]reverse[/color] x))))
                               ([color=BLUE]list[/color] vt1 vt2 vt3)
                           )
                       )
                   )
               )
               ([color=BLUE]vla-put-closed[/color] ply [color=BLUE]:vlax-true[/color])
               ([color=BLUE]vl-catch-all-error-p[/color]
                   ([color=BLUE]setq[/color] hat
                       ([color=BLUE]vl-catch-all-apply[/color] '[color=BLUE]vlax-invoke[/color]
                           ([color=BLUE]list[/color] spc 'addhatch [color=BLUE]achatchpatterntypepredefined[/color] pat [color=BLUE]:vlax-true[/color] [color=BLUE]achatchobject[/color])
                       )
                   )
               )
           )
           ([color=BLUE]vla-delete[/color] ply)
           ([color=BLUE]princ[/color] [color=MAROON]"\nError creating hatch: "[/color])
           ([color=BLUE]princ[/color] ([color=BLUE]vl-catch-all-error-message[/color] hat))
       )
       (   ([color=BLUE]vl-catch-all-error-p[/color]
               ([color=BLUE]setq[/color] err
                   ([color=BLUE]vl-catch-all-apply[/color] '[color=BLUE]vlax-invoke[/color]
                       ([color=BLUE]list[/color] hat 'appendouterloop ([color=BLUE]list[/color] ply))
                   )
               )
           )
           ([color=BLUE]vla-delete[/color] hat)
           ([color=BLUE]vla-delete[/color] ply)
           ([color=BLUE]princ[/color] [color=MAROON]"\nError setting hatch boundary: "[/color])
           ([color=BLUE]princ[/color] ([color=BLUE]vl-catch-all-error-message[/color] err))
       )
       (   [color=BLUE]t[/color]
           ([color=BLUE]vla-evaluate[/color] hat)
           ([color=BLUE]vla-put-patternangle[/color] hat hpa)
           ([color=BLUE]vla-put-patternscale[/color] hat scl)
       )
   )
   ([color=BLUE]princ[/color])
)
([color=BLUE]vl-load-com[/color]) ([color=BLUE]princ[/color])

A Quick Demo:

 

isotri.gif

Edited by Lee Mac
Link to comment
Share on other sites

Humm I tried your code lee. I am selecting both end points of the line I wish to create the hatched triangle for but keep getting the message- "Cannot generate triangle for isometric angle."... In our industry we draw strictly in isometric and these are indeed isometric angles. However, when I draw lines straight up and straight right(90 and 180 degrees) then run the code and pick my two points, it pops in a isometric triangle like what is shown in the image that I will attach.attachment.php?attachmentid=55717&cid=1&stc=1attachment.php?attachmentid=55718&cid=1&stc=1

1st ex..jpg

2nd ex..jpg

Link to comment
Share on other sites

Now here is the depiction of what we would actually need.. Thanks again for everything by the way this is extremely generous of you. Excellent hard work!attachment.php?attachmentid=55724&cid=1&stc=1

3rd ex.jpg

Link to comment
Share on other sites

Another example. With that being said, the user would also have to be able to change angle after selecting points, to illustrate a vertical or horizontal angle.

 

.Again, if this isnt worth the time Lee I completely understand I was just using Cad Tutor as a resource in case some other piping designers out there (that aren't using Autocad Plant 3D) had something in mind.

4th ex.jpg

Link to comment
Share on other sites

Lee, what are your credentials you entered at the top, that looks pretty close to what I am wanting.. Outstanding!!

 

I am running the code as posted - you will need to change the offset & scale to suit the size of your drawings (an offset of 10 units will be much too large if your lines are only 1 unit in length).

Link to comment
Share on other sites

For some reason when I click the second point on the end point of my line is gives me the error "Cannot generate triangle for isometric angle." However, when I click just shy of that end point it generates the triangle? Any ideas as to why?

Link to comment
Share on other sites

For some reason when I click the second point on the end point of my line is gives me the error "Cannot generate triangle for isometric angle." However, when I click just shy of that end point it generates the triangle? Any ideas as to why?

 

Yes, the triangle cannot be generated for multiples of 30 degrees, as the baseline of the triangle will run along these isometric lines, however, I realise I should remove 60 degrees etc from this restriction.

Link to comment
Share on other sites

Sounds good I appreciate your efforts tremendously. We never know what angles are CAD technicians are going to draw these angles at. Now what they are supposed to draw them at and what the draw them at is a different story. LOL. See if you can make it to where there are no restrictions. Thanks LEE!!

Link to comment
Share on other sites

I wonder if you can make a separate code modified to look like the hatching in my post #11, which is what we call a horizontal hatch for 90s that are rolled but are essentially at exact same elevations. I will call the first one ISOV and the horizontal one ISOH.. Thanks for everything LEE!

Link to comment
Share on other sites

Sounds good I appreciate your efforts tremendously.

 

Thank you for your gratitude.

 

See if you can make it to where there are no restrictions.

 

Though as explained, lifting all restrictions on the angle is not possible as the baseline of the triangle will follow the isometric axis line (at 30 degrees, for example).

Link to comment
Share on other sites

In your GIF I see you choosing both end points. When I try and replicate that action, I get the error in result. But in your GIF you clearly are able to perform the routine with two end points of the line at that specific angle. Any thoughts?

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