Author Topic: lisp script for draw object (panels)  (Read 2067 times)

0 Members and 1 Guest are viewing this topic.

suraj.jangam22

  • Guest
lisp script for draw object (panels)
« on: October 22, 2019, 02:54:28 AM »
I have attached herewith drafting flow for the drawing, i want script for the same process. please guide me please. i am new here & i have not much knowledge about LISP program.
ALSO PLEASE SEE BELOW I HAVE ATTACHED SCRIPT WHICH I HAVE WRITE FOR START.   

Code - Auto/Visual Lisp: [Select]
  1. (defun c:panel ( / len wid pt1 pt2 pt3 pt4)
  2. (setq pt1 (getpoint "\nPick lower left Corner"))
  3. (setq Len (Getreal "\nEnter length"))
  4. (setq wid (Getreal "\nWidth"))
  5. (setq pt2 (polar Pt1 0.0 len))
  6. (setq pt3 (polar pt2 (/ pi 2.0) wid))
  7. (setq pt4 (polar pt3 pi len))
  8. (command "pline" pt1 pt2 pt3 pt4 "c")
  9. )
  10. (C:panel)


EDIT (John): added code tags.
« Last Edit: October 23, 2019, 09:19:13 AM by John Kaul (Se7en) »

suraj.jangam22

  • Guest
Re: lisp script for draw object (panels)
« Reply #1 on: October 22, 2019, 07:47:51 AM »
see what i have started ............

Code - Auto/Visual Lisp: [Select]
  1. (defun c:panel ( / len wid pt1 pt2 pt3 pt4)
  2. (setq pt1 (getpoint "\nPick lower left Corner"))
  3. (setq Len (Getreal "\nEnter length"))
  4. (setq wid (Getreal "\nWidth"))
  5. (setq pt2 (polar Pt1 0.0 len))
  6. (setq pt3 (polar pt2 (/ pi 2.0) wid))
  7. (setq pt4 (polar pt3 pi len))
  8. (command "pline" pt1 pt2 pt3 pt4 "c")
  9. (if lay (setvar 'CLAYER lay))
  10.     (princ))
  11. ; layers
  12.       (command "_.LAYER" "_T" "White" "_M" "White" "_Color" 7 "White" "") ; layers
  13.  
  14. )
  15. (C:panel)


EDIT (John): Added code tag.
« Last Edit: October 23, 2019, 09:18:29 AM by John Kaul (Se7en) »

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: lisp script for draw object (panels)
« Reply #2 on: October 22, 2019, 11:46:20 AM »
When you use command you must manage the SNAPs
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: lisp script for draw object (panels)
« Reply #3 on: October 25, 2019, 09:16:51 AM »
Attached is a very old routine that uses Command. You can learn from that.
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

BIGAL

  • Swamp Rat
  • Posts: 1409
  • 40 + years of using Autocad
A man who never made a mistake never made anything