Tiger Posted October 6, 2010 Share Posted October 6, 2010 ... a lisp where I could simply type HH and select the object, (drawn around the duct area) create a hatch and then delete the object. ... 1-0 to Lee Quote Link to comment Share on other sites More sharing options...
The Buzzard Posted October 6, 2010 Share Posted October 6, 2010 Lee, My interpretation of that is to draw around the existing duct with a bounary, Hatch it and erase the created boundary. This program is to be used as an insulation representation on duct work. Why would he want the duct to be erased in the process. Sometimes you have to read between the lines and maybe get clarification. But again I could be wrong and I think it best to let oldsoftboss address that issue. No problem, I thought the process was incorrect thats all. Quote Link to comment Share on other sites More sharing options...
The Buzzard Posted October 6, 2010 Share Posted October 6, 2010 Ah got you, I was actually tracing the complete rectangle, not just one edge. Now I understand, I will edit to say "enter duct width", rather than "Enter Hatch Width". Would still like the ability to simply pick a rectangle or closed polyline and fill it. As a side note, I couldn't get Lee's Lisp to run. Returned unknown command. ?? Cheers, Dave Lee, This confirms my belief. Also he may be using two different versions of CAD. Quote Link to comment Share on other sites More sharing options...
oldsoftboss Posted October 6, 2010 Author Share Posted October 6, 2010 In answer to the questions above. We have a program at our office that allows automation when drawing ductwork. It allows us to draw straights, elbows, bends, transitions etc. Our sheetmetal manufacturer likes internally lined ductwork to be hatched (for clarity in reading the drawings-different hatching represents different thickness of insulation). This program does not hatch the ductwork. The program has the ability to break the ductwork into pre-determined lengths, so if we require 14 metres of duct, it will break it up into 10 1.4 metre lengths. My idea on hatching was to simply draw a rectangle (or polyline) around the entire duct, hatch it and then delete the rectangle (which is what I do manually at present). On reflection, it would have been better to replicate the hatch dialog box, but without having to select Hatch type, Scale, Rotation and ensuring the correct layer every time. Simply type HH, select the object(s) and hatch, so if the duct has a length denoted (see attached image), select the duct (closed polyline), select the length and then hit enter. The duct would not then need to be deleted. I thought once I had one type of hatch up and going, I would edit the code and create different shortcuts for different types of hatches. I have a fair amount of VBA programing experience, so I thought this would be a doddle, but the AutoLisp code is a whole new language and I am struggling big time. Thank to all for your input to date. As you have shown, AutoCAD is only limited by your imagination (and ability!!) Any feed back is greatly appreciated. PS: Lees code, I run ACAD 2010 both at work and home, so go figure?? The only thing I can think of is a dodgy cut and paste job, but never quite got to sit in front of the PC today. Will keep you informed. Quote Link to comment Share on other sites More sharing options...
The Buzzard Posted October 6, 2010 Share Posted October 6, 2010 In answer to the questions above. We have a program at our office that allows automation when drawing ductwork. It allows us to draw straights, elbows, bends, transitions etc. Our sheetmetal manufacturer likes internally lined ductwork to be hatched (for clarity in reading the drawings-different hatching represents different thickness of insulation). This program does not hatch the ductwork. The program has the ability to break the ductwork into pre-determined lengths, so if we require 14 metres of duct, it will break it up into 10 1.4 metre lengths. My idea on hatching was to simply draw a rectangle (or polyline) around the entire duct, hatch it and then delete the rectangle (which is what I do manually at present). On reflection, it would have been better to replicate the hatch dialog box, but without having to select Hatch type, Scale, Rotation and ensuring the correct layer every time. Simply type HH, select the object(s) and hatch, so if the duct has a length denoted (see attached image), select the duct (closed polyline), select the length and then hit enter. The duct would not then need to be deleted. I thought once I had one type of hatch up and going, I would edit the code and create different shortcuts for different types of hatches. I have a fair amount of VBA programing experience, so I thought this would be a doddle, but the AutoLisp code is a whole new language and I am struggling big time. Thank to all for your input to date. As you have shown, AutoCAD is only limited by your imagination (and ability!!) Any feed back is greatly appreciated. PS: Lees code, I run ACAD 2010 both at work and home, so go figure?? The only thing I can think of is a dodgy cut and paste job, but never quite got to sit in front of the PC today. Will keep you informed. Thats just what I thought. Sorry, But I could not resist. Buzzard 1 - 0 Lee Quote Link to comment Share on other sites More sharing options...
The Buzzard Posted October 6, 2010 Share Posted October 6, 2010 oldsoftboss, To also clarify, Are the duct objects closed LWPOLYLINES. If so, There should be no need to draw a hatch around the ducts. To play it on the safe side on the other hand it is probably ok to do it just incase a closed LWPOLYLINE is exploded or error trap it to inform you the selection may not be a closed polyline. Where you have elbows now is an entirely different story so maybe it is best just to select the object to be hatched with the error trap so that all duct entities get hatched with the same program. Quote Link to comment Share on other sites More sharing options...
Tiger Posted October 6, 2010 Share Posted October 6, 2010 Thats just what I thought.Sorry, But I could not resist. Buzzard 1 - 0 Lee I apologise for interfering then. Quote Link to comment Share on other sites More sharing options...
The Buzzard Posted October 6, 2010 Share Posted October 6, 2010 No problem Tiger, Its all in jest. Just trying to have a good time while we pull our hair out resolving these kind of problems. Quote Link to comment Share on other sites More sharing options...
The Buzzard Posted October 6, 2010 Share Posted October 6, 2010 In all fairness to Lee, He still has the better code, Just got to work out the above issues. So, I will take take the back seat now and shut-up. Buzzard 1 - 10 Lee Quote Link to comment Share on other sites More sharing options...
oldsoftboss Posted October 6, 2010 Author Share Posted October 6, 2010 Thanks for the feedback. Buzzard, the ducts do appear to be closed LWPOLYLINES, so you are correct, in 90% of cases, no need to delete the duct (or outline) Find attached a selection of objects the program will draw. You will notice the mitred tee is not closed, but I can deal with this. If I could select the duct, select the text, and hatch on the correct layer, I think that would be ace. Also on the drawing are a couple of ducts hatched as they would appear once completed. Drawing1.dwg Quote Link to comment Share on other sites More sharing options...
The Buzzard Posted October 6, 2010 Share Posted October 6, 2010 Not speaking for Lee, But I do believe he could add these solutions to his program. Again his program would be the way to go for your situation. You will have to wait for him to get back to you on it and the decision is in his hands. I do not see the point in me trying to write something more elaborate for you while his program could accomodate you much better. I will stick around though to see the results all the same. I am not such a VL buff and part of it may have to do with these version issues among other things. I have seen too many times these problems and feel less confident with VL. All the same, If you are using the most current version and I believe he uses the same version as well you will have something solid to work with. Quote Link to comment Share on other sites More sharing options...
oldsoftboss Posted October 6, 2010 Author Share Posted October 6, 2010 Thanks Buzzard, Yes I would love the code to select objects - hatch - done. Lee's code is excitedly close, just allow to select multiple objects, and remove the delete bit. I have been looking at the code - as I said, a totally foreign language, to find the delete bit, but it is all double dutch to me :-( Quote Link to comment Share on other sites More sharing options...
oldsoftboss Posted October 6, 2010 Author Share Posted October 6, 2010 aha found it... (entdel ent) Quote Link to comment Share on other sites More sharing options...
The Buzzard Posted October 6, 2010 Share Posted October 6, 2010 aha found it... (entdel ent) Nice catch! So you are not so numb to lisp afterall. Quote Link to comment Share on other sites More sharing options...
The Buzzard Posted October 6, 2010 Share Posted October 6, 2010 oldsoftboss, Just to enlighten you a bit on the code editing practices here. If you should decide to post Lee's code here or anywhere in the future, It is wise and good practice to indicate the change that you made with the date and your initials or name in the area of the revision so that the revision is no reflection to the author of the code. I thought I would bring this to your attention now as not to stir-up the pot later. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted October 6, 2010 Share Posted October 6, 2010 Hi Guys, I'm not sure how to create a hatch that involves the text using VL, so, unless others can direct me, we may have to go the command call route on this one. Lee PS> OldSoftBoss, your style of ducting looks strikingly similar to a program I wrote a while back http://www.cadtutor.net/forum/showthread.php?48663-Autolisp-to-draw-elbow-45&p=331311&viewfull=1#post331311 Quote Link to comment Share on other sites More sharing options...
oldsoftboss Posted October 6, 2010 Author Share Posted October 6, 2010 Had a look at the link, very similar, the one we use is available here.... http://users.ncable.net.au/~grekat/dct.html Quote Link to comment Share on other sites More sharing options...
oldsoftboss Posted October 8, 2010 Author Share Posted October 8, 2010 Sorry about the code editing, still new to the place. Still wondering how I (we) could edit the code to select multiple objects. Dave Quote Link to comment Share on other sites More sharing options...
The Buzzard Posted October 8, 2010 Share Posted October 8, 2010 (edited) Hey Dave, I put a little time into this, But I will need your feedback. I thought Lee had this one and maybe he still does. Not sure. Try this and let me know how its going. I am sure you will be able to modify it easy, If not, I will do my best to fix it for you. I believe the filters are going to need some more work. I do not use them so often, So understand I am still learning too. HH.lsp Edited October 8, 2010 by The Buzzard Quote Link to comment Share on other sites More sharing options...
oldsoftboss Posted October 8, 2010 Author Share Posted October 8, 2010 Works a treat, thankyou thankyou. 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.