Jump to content

Auto Hatch


oldsoftboss

Recommended Posts

:shock: Works a treat, thankyou thankyou.:D

 

I don't about that Dave. Just put it thru its paces. As I mentioned, I was unsure about the filtering which means it may not be very well error trapped when it comes to the selections. I think you will be able to adjust the layer & color to suit you. If there still is any issues, Do not hesitate to ask.

 

Enjoy the code,

The Buzzard

Link to comment
Share on other sites

  • Replies 45
  • Created
  • Last Reply

Top Posters In This Topic

  • The Buzzard

    23

  • oldsoftboss

    14

  • Lee Mac

    6

  • Tiger

    2

Top Posters In This Topic

Posted Images

Before I forget, You can add the addtional hatch types in the area as indicated below. It was set for ANSI31 & ANSI37.

(initget "[color=red]ANSI31 ANSI37[/color]")

 

If you do not modify this, It will not accept any other hatch types.

 

Also take note to the default settings:

 

 (or H:NME (setq H:NME "[color=red]ANSI37[/color]")) ;Default Hatch Name
 (or H:SCL (setq H:SCL  [color=red]32[/color]))      ;Default Hatch Scale
 (or H:ANG (setq H:ANG  [color=red]0[/color]))       ;Default Hatch Angle
 (setq LNAM "[color=red]DUCT-HA[/color]"             ;Layer Name
       LCLR  [color=red]1[/color]                    ;Layer Color
       LTYP "[color=red]Continuous[/color]")         ;Layer Linetype

Link to comment
Share on other sites

Thanks Buzzard,

 

Picked up the default layer types, but missed the layer color. Default color for my needs is 45. Apart from that, it's great.

 

On error trapping, if I select a line rather than a closed polyline, the return simply says "0 objects selected" and continues without a problem.

Link to comment
Share on other sites

Thanks Buzzard,

 

Picked up the default layer types, but missed the layer color. Default color for my needs is 45. Apart from that, it's great.

 

On error trapping, if I select a line rather than a closed polyline, the return simply says "0 objects selected" and continues without a problem.

 

Well, That does not sound too bad.

For the layer color, See below and find this area of your code and change 1 to 45. That should fix that.

It would be at the beginning of the Set Defaults Function.

;
; Set Defaults.
;
(defun HH_SD ()
 (or H:NME (setq H:NME "ANSI37")) ;Default Hatch Name
 (or H:SCL (setq H:SCL  32))      ;Default Hatch Scale
 (or H:ANG (setq H:ANG  0))       ;Default Hatch Angle
 (setq LNAM "DUCT-HA"             ;Layer Name
       LCLR  [color=red]45[/color]                    ;Layer Color
       LTYP "Continuous")         ;Layer Linetype
 (initget "ANSI31 ANSI37")
 (setq H:NME (cond ((getkword (strcat "\nSpecify hatch name. <"H:NME">: ")))        (T H:NME)))
 (initget (+ 2 4))
 (setq H:SCL (cond ((getint   (strcat "\nSpecify hatch scale. <"(itoa H:SCL)">: ")))(T H:SCL)))
 (initget (+ 2 4))
 (setq H:ANG (cond ((getint   (strcat "\nSpecify hatch angle. <"(itoa H:ANG)">: ")))(T H:ANG)))
 (HH_MF)
 (princ))
;

Link to comment
Share on other sites

"find this area of your code "

 

Dont you mean YOUR code. :P

 

Your code is far easier to follow. It will take me a while get my head around the syntax's

 

Dave

Link to comment
Share on other sites

Dont you mean YOUR code. :P

 

Your code is far easier to follow. It will take me a while get my head around the syntax's

 

Dave

 

When you can somewhat follow someones code is always a good thing. You can refer to the AutoCAD Developer Help section for explainations of the lisp functions also.

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