The Buzzard Posted October 8, 2010 Share Posted October 8, 2010 Works a treat, thankyou thankyou. 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 Quote Link to comment Share on other sites More sharing options...
The Buzzard Posted October 8, 2010 Share Posted October 8, 2010 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 Quote Link to comment Share on other sites More sharing options...
oldsoftboss Posted October 9, 2010 Author Share Posted October 9, 2010 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. Quote Link to comment Share on other sites More sharing options...
The Buzzard Posted October 9, 2010 Share Posted October 9, 2010 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)) ; Quote Link to comment Share on other sites More sharing options...
oldsoftboss Posted October 9, 2010 Author Share Posted October 9, 2010 "find this area of your code " Dont you mean YOUR code. Your code is far easier to follow. It will take me a while get my head around the syntax's Dave Quote Link to comment Share on other sites More sharing options...
The Buzzard Posted October 9, 2010 Share Posted October 9, 2010 Dont you mean YOUR code. 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.