Author Topic: roof making lisp  (Read 2502 times)

0 Members and 1 Guest are viewing this topic.

dussla

  • Bull Frog
  • Posts: 297
roof making lisp
« on: March 12, 2008, 01:44:27 AM »
hello  , friend
i will ask again , sorry many asks and helps  ~

if you see my attatched image , you can see my wanted routine
if i select   a , b ,  c  and put  distance(d)  value    , then  routine  will draw  next image
pls can you understand ~?
thank you always ~
« Last Edit: March 13, 2008, 12:07:59 AM by dussla »

DEVITG

  • Bull Frog
  • Posts: 481
Re: roof making lisp
« Reply #1 on: March 12, 2008, 10:07:49 PM »
How about if you upload a true  ACAD DWG???
Location @ Córdoba Argentina Using ACAD 2019  at Window 10

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: roof making lisp
« Reply #2 on: March 12, 2008, 10:18:56 PM »
Let us see what you've done so far ...
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

dussla

  • Bull Frog
  • Posts: 297
Re: roof making lisp
« Reply #3 on: March 13, 2008, 12:08:15 AM »
PLS , I ADDED  DWG FILE

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: roof making lisp
« Reply #4 on: March 13, 2008, 03:09:35 PM »
I'll get you started but you will need to complete any modifications to the lisp.
Code: [Select]
(defun c:RoofCap (/ p1 p2 p3 dis ofs an1 an2 an3 p1a p1b p2a p2c)
  (prompt "\nPick 3 points for roof. End, Peak, End.")
  (if (and
        (setq p1 (getpoint "\nPick 1st of 3 points."))
        (setq p2 (getpoint "\nPick 2nd of 3 points."))
        (setq p3 (getpoint "\nPick 3rd of 3 points."))
        (setq dis (getdist "\nEnter Length of Cap."))
      )
    (progn
      (setq ofs 20. ; offset from roof line
            p1a (polar p2 (angle p2 p1) dis)
            p2a (polar p2 (angle p2 p3) dis)
            an1 (+ (angle p2 p1) (/ pi 2.))
            an2 (+ (angle p2 p1) (* pi 1.5))
      )
      (if (> (distance p3 (polar p1a an2 ofs)) (distance p3 (polar p1a an1 ofs)))
        (setq an1 an2)
      )
      (setq an2 (+ (angle p2 p3) (/ pi 2.))
            an3 (+ (angle p2 p3) (* pi 1.5))
      )
      (if (> (distance p1 (polar p1a an3 ofs)) (distance p1 (polar p1a an2 ofs)))
        (setq an2 an3)
      )
      (setq p1b (polar p1a an1 ofs)
            p2c (polar p2a an2 ofs)
            int (inters p1b (polar p1b (angle p1 p2) 10)
                        p2c (polar p2c (angle p3 p2) 10) nil)
      )
      (command "_pline" "_non" p1a "_non" p2 "_non" p2a "_non"
               p2c "_non" int "_non" p1b "_CLose")
    )
  )

  (princ)
)
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.

dussla

  • Bull Frog
  • Posts: 297
Re: roof making lisp
« Reply #5 on: March 13, 2008, 08:30:12 PM »
really , really  thank you cab  always
routine is very good ~


alanjt

  • Needs a day job
  • Posts: 5352
  • Standby for witty remark...
Re: roof making lisp
« Reply #6 on: March 14, 2008, 10:18:35 AM »
yoink!
Civil 3D 2019 ~ Windohz 7 64bit
Dropbox