Jump to content

Recommended Posts

Posted (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 by Noody
added 2004 version attachment
Posted

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!

Posted

Cheers i've added a 2004 version hopefully that helps

Posted

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.

Posted

You may be able to accomplish what you want with a dynamic block.

Posted
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 :oops:

Posted

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

hachures.jpg

hach2004A.dwg

Posted

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)

Posted (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 by eldon
corrected myself
Posted

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

Posted

I figured it out!

 

cheers everyone for your help!!

  • 4 years later...
Posted
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.

Posted
Please explain better to another archeologist. Thank you very much.

 

I am not quite sure how to explain it any better :unsure:

 

But take heart, the previous archaeologist figured it out in the end, and I am sure that you can. Best of luck.

Posted

I have the italian version of Autocad, Is this the problem?

Posted

I am not knowledgeable enough to answer that. :oops:

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