Jump to content

HELP! Want to draw a series of 45 degrees lines between 2 points


Recommended Posts

Posted

Can someone help me with a lisp file. I'm wanting to draw a series of 45 degrees lines between 2 points to represent a weld see attached.

 

Also if possible to specify the length of the 45 degree line and spacing of these.

 

I've not got much experience with lisp files so please help if you can

DETAIL.jpg

  • Replies 23
  • Created
  • Last Reply

Top Posters In This Topic

  • Ahankhah

    7

  • mrbradley1

    6

  • mdbdesign

    3

  • SOliver

    3

Top Posters In This Topic

Posted Images

Posted

Couldn't you just combine the line @length

Posted

What about bounding box and hatch inside and delete bounding box? Explode hatch after?

Posted

I think it is better to use hatch object to get the mark.

note: there is no error traping in the following code:

(defun C:DrawWeld ()
 (setq len (getdist "\nSpecify length: "))
 (setq ang 45.0)
 (setq obj-pt (entsel "\nSelect object: "))
 (setq obj (car obj-pt))
 (setq dist (getdist "\nSpecify distance between lines: "))
 (command "_.COPY"
   obj
   ""
   "_Displacement"
   "_NONe"
   (strcat (rtos len) "<" (rtos ang))
 )
 (setq tempobj (entlast))
 (command "_.HATCH" "_User" ang dist "_No" obj tempobj "")
 (entdel tempobj)
)
(C:DrawWeld)

Posted (edited)

mdbdesign, when I was writing the code, your reply was added to the thread. As you see, I think like you about the solution...

Edited by Ahankhah
Posted

I like it. Already in toolbar.

233444smiley_cheers2.gif

Posted

thanks for the reply guys, thought about the array and hatch but I use this quite alot and was trying to find an easy way round it.....Ahankhah the bit of code you've wrote, does this work?

Posted
Just now I tested it in AutoCAD 2012

 

How do you like work on A2012?

Posted

You could always try look into the hatch offset and calculate the scale accordingly, however; I feel compelled to refer you back to my orginal comment, perhaps creating a block with the created lines for neatness. Hopefully not too cheeky a comment:lol:

Posted

I know that you have had a lisp written for you, but perhaps the command Measure or Divide with a block, would have given you the desired outcome :o

Posted

Sorry about that Ahankhah it does work :D. I'm using 2005 at work and 2011 at home. for some reason it works on 2011 but not on 2005 any idea why????

Posted
Sorry about that Ahankhah it does work :D. I'm using 2005 at work and 2011 at home. for some reason it works on 2011 but not on 2005 any idea why????
"Displacement" wasn't supported in a version that old. Change it to '(0. 0. 0.).
Posted

Thanks, i'll have to try this tomorrow at work

Posted
How do you like work on A2012?

I love all versions of AutoCAD:huh: except Version 13 for DOS:sweat::cry:.

Posted
How about a Linear Array...

 

[ATTACH]26749[/ATTACH]

 

Hat's off to you Lee; great use of the grread function

Posted
Sorry about that Ahankhah it does work :D. I'm using 2005 at work and 2011 at home. for some reason it works on 2011 but not on 2005 any idea why????
"Displacement" wasn't supported in a version that old. Change it to '(0. 0. 0.).

As I can remember,it was supported in earlier versions as de facto. Just replace "Displacement" with "" in the code.

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