Author Topic: REQ: from point draw line with preset length and angle  (Read 1940 times)

0 Members and 1 Guest are viewing this topic.

abdulellah

  • Mosquito
  • Posts: 5
REQ: from point draw line with preset length and angle
« on: December 12, 2019, 02:55:47 PM »
hello all .
please can you help me to write lisp to do this massion .
lisp sinario explained in images attached

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: REQ: from point draw line with preset length and angle
« Reply #1 on: December 12, 2019, 03:03:36 PM »
This appears to be homework. Where is the code you've written so far? What specifically are you struggling with?
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

abdulellah

  • Mosquito
  • Posts: 5
Re: REQ: from point draw line with preset length and angle
« Reply #2 on: December 12, 2019, 03:18:12 PM »
 :-Psorry brother , i am not autolisper , i want lisp to this task explained in image  , in frist image explain senario and lisp result with wihte line at red poly line ,
« Last Edit: December 12, 2019, 03:21:13 PM by abdulellah »

DEVITG

  • Bull Frog
  • Posts: 479
Re: REQ: from point draw line with preset length and angle
« Reply #3 on: December 13, 2019, 07:13:03 AM »
Please upload a sample.dwg
Location @ Córdoba Argentina Using ACAD 2019  at Window 10

BIGAL

  • Swamp Rat
  • Posts: 1406
  • 40 + years of using Autocad
Re: REQ: from point draw line with preset length and angle
« Reply #4 on: December 13, 2019, 10:32:27 PM »
This has been answered at cadtutor but poster did not like answer.
A man who never made a mistake never made anything

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: REQ: from point draw line with preset length and angle
« Reply #5 on: December 13, 2019, 11:19:02 PM »
I am eager - as I believe all swampers are - to help people that have a genuine interest in learning.
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

HasanCAD

  • Swamp Rat
  • Posts: 1420
Re: REQ: from point draw line with preset length and angle
« Reply #6 on: December 14, 2019, 02:56:59 AM »
This is a good start
Code - Auto/Visual Lisp: [Select]
  1. (defun c:LLA ()
  2.   (while
  3.     (setq p1 (getpoint "\nSelect Start point: "))
  4.     (if (null ang) (setq ang 1.) (setq ang (* 180.0 (/ ang pi))))
  5.     (initget 1)
  6.     (if (setq angt (getreal (strcat "\nWhat is Line Angle? <" (rtos ang) ">: "))) (setq ang angt))    
  7.     (setq ang (* pi (/ ang 180.0)))
  8.     (if (null lng) (setq lng 1.))
  9.     (initget 1)
  10.     (if (setq lngt (getreal (strcat "\nWhat is Line Length? <" (rtos lng) ">: "))) (setq lng lngt))
  11.     (setq p2 (polar p1 ang lng))
  12.     (vl-cmdf "_.LINE" p1 p2 "")
  13.     )
  14.   )
« Last Edit: December 14, 2019, 03:03:36 AM by HasanCAD »

abdulellah

  • Mosquito
  • Posts: 5
Re: REQ: from point draw line with preset length and angle
« Reply #7 on: December 14, 2019, 12:20:59 PM »
Thanks to everyone who generously helps jealousy even the word, of course I don’t forget begal help for me