Noody Posted April 28, 2011 Share Posted April 28, 2011 (edited) Hi I'm an archaeologist and fairly new to CAD. I want to be able to easily insert a tadpole (what we call a hachure) between two selected points so it automatically scales and orientates betwen the two points, so you end up with something like the attached when you've done it a few times. Is there any easy way to do this? I've seen a couple of thread on LISPs which seem to suggest you can but as I'm a newbie and know nothing about programming it don't really understand. Any help is much appreciated. CAD hach.dwg CAD hach2004.dwg Edited April 28, 2011 by Noody added 2004 version attachment Quote Link to comment Share on other sites More sharing options...
designerstuart Posted April 28, 2011 Share Posted April 28, 2011 i'm sorry i can't open this (it's a newer version) but a screenshot or saved-down version would help. from what i know a LISP is what you need, for easy insertion, scale and orientation. otherwise this needs to be done as three separate commands. if i'm right (others will answer soon too) some else will help you with the lisp code i expect - and maybe a mod should move this thread to the lisp section? welcome to CADTutor! Quote Link to comment Share on other sites More sharing options...
Noody Posted April 28, 2011 Author Share Posted April 28, 2011 Cheers i've added a 2004 version hopefully that helps Quote Link to comment Share on other sites More sharing options...
Tyke Posted April 28, 2011 Share Posted April 28, 2011 Welcome to CADTutor Noody, I did it in a LISP routine for placing embankment symbols. In principle its possible but as Stuart said a screen shot would be helpful and as much detail as possible for what you want to achieve. Quote Link to comment Share on other sites More sharing options...
SLW210 Posted April 28, 2011 Share Posted April 28, 2011 You may be able to accomplish what you want with a dynamic block. Quote Link to comment Share on other sites More sharing options...
designerstuart Posted April 28, 2011 Share Posted April 28, 2011 You may be able to accomplish what you want with a dynamic block. true but that sounds pretty difficult to me - rotation easy but scale as well? okay maybe not that hard for you guys but it's beyond me. oh, but so is writing the lisp Quote Link to comment Share on other sites More sharing options...
eldon Posted April 28, 2011 Share Posted April 28, 2011 I guess that being an archaeologist, you would like to keep some control over placing these hachures, and not go for an automatic routine which may not place them as you want. In your drawing (Dwg True View now cannot convert educational drawings, so the lower version is very welcome) there are six hachure blocks, t0, t5, t6, t7, t8 and t9. They have been drawn at what AutoCad considers to be 90 degrees, so for ease of use in any lisp, they are easier to use if drawn at zero degrees. I have made six new blocks called t10, t15 etc. The attached lisp is one that I have used for years, and does precisely what you want. I did not write it, and don't even know who did. The routine defaults to block t10, but you can type in any block name that you want, then just pick the top and bottom points of your hachure. ( defun c:slope(/ nam nam1 m pt1 pt2 siz ang) (setvar "cmdecho" 0) ( setq nam "t10") ( setq nam1 nam) ( princ (strcat "\nBlock name <" nam ">: ")) ( setq nam1 ( getstring )) ; default answer ( if ( = nam1 "") ( setq nam1 nam) ) ( graphscr) (setq m (if (= 0 (getvar "angdir")) 1 -1)) ; get points 1 & 2 from user & loop till <return> is pressed ( while ( setq pt1 ( getpoint "\nFirst point")) ( setq pt2 ( getpoint pt1 "\nSecond point")) ;set block insertion scale factor and angle ( setq siz ( distance pt1 pt2)) ( setq ang ( angle pt1 pt2)) ;convert to degrees ( setq ang ( * 180.0 ( / ang pi))) ;insert the block ( command "insert" nam1 pt1 siz siz (* m ang)) ) (setvar "cmdecho" 1)(princ)) hach2004A.dwg Quote Link to comment Share on other sites More sharing options...
designerstuart Posted April 28, 2011 Share Posted April 28, 2011 that's great eldon - so does the block definition just need to be present in the drawing for this to work? and i assume the lisp code needs to be edited in order to change your block - it would need some clever tweaking if you needed to: select block to insert specify start point specify end point (and loop) Quote Link to comment Share on other sites More sharing options...
eldon Posted April 28, 2011 Share Posted April 28, 2011 (edited) No, the block definition needs to be in the support path, but when the routine starts, it asks for a block, but if you do not type in a different one, it defaults to t10. If you want it to default to a different one, you just edit the t10 where it appears in the code. It was written in the days when pallettes were what artists used to mix their paint on, and you could not select a block. But you could write several versions that defaulted to your favourite blocks. I have three versions, one for a standard hachure, one for a short slope and one for a long slope. Edited April 28, 2011 by eldon corrected myself Quote Link to comment Share on other sites More sharing options...
Noody Posted April 28, 2011 Author Share Posted April 28, 2011 Cheers everyone for getting back to me so quickly!! I'm not very familar with AutoCAD and raw code so how do I get into the program? And then what do I do to select it as an option? I see there is a LISP editor in tools-do I copy and paste the code? Cheers one again everyone Quote Link to comment Share on other sites More sharing options...
Noody Posted April 28, 2011 Author Share Posted April 28, 2011 I figured it out! cheers everyone for your help!! Quote Link to comment Share on other sites More sharing options...
irsda75 Posted October 11, 2015 Share Posted October 11, 2015 No, the block definition needs to be in the support path, but when the routine starts, it asks for a block, but if you do not type in a different one, it defaults to t10. If you want it to default to a different one, you just edit the t10 where it appears in the code. It was written in the days when pallettes were what artists used to mix their paint on, and you could not select a block. Please explain better to another archeologist. Thank you very much. Quote Link to comment Share on other sites More sharing options...
eldon Posted October 12, 2015 Share Posted October 12, 2015 Please explain better to another archeologist. Thank you very much. I am not quite sure how to explain it any better But take heart, the previous archaeologist figured it out in the end, and I am sure that you can. Best of luck. Quote Link to comment Share on other sites More sharing options...
irsda75 Posted October 12, 2015 Share Posted October 12, 2015 I have the italian version of Autocad, Is this the problem? Quote Link to comment Share on other sites More sharing options...
eldon Posted October 12, 2015 Share Posted October 12, 2015 I am not knowledgeable enough to answer that. 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.