Jump to content

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


Recommended Posts

Posted (edited)

I've changed the "Displacement" to ""

 

(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
""
""
"_NONe"
(strcat (rtos len) "<" (rtos ang))
)
(setq tempobj (entlast))
(command "_.HATCH" "_User" ang dist "_No" obj tempobj "")
(entdel tempobj)
)
(C: DrawWeld)

 

but it errors out after 'distance between lines' with the following:-

 

Select objects: Specify base point or displacement, or [Multiple]:

Point or option keyword required.

; error: Function cancelled

Specify base point or displacement, or [Multiple]:

 

any ideas?

Edited by SLW210
  • 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

mrbradley1,

this code works in all versions of AutoCAD after Release 12:

(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
   ""
   "_NONe"
   (strcat (rtos len) "<" (rtos ang))
   ""
 )
 (setq tempobj (entlast))
 (command "_.HATCH" "_User" ang dist "_No" obj tempobj "")
 (entdel tempobj)
 (princ)
)
(C:DrawWeld)

Please let me know you get the goal.

Posted
That's it thanks.:D, everyone

You are welcome mrbradley1.

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