Author Topic: encrypted lisp routine  (Read 6825 times)

0 Members and 1 Guest are viewing this topic.

pmvliet

  • Guest
encrypted lisp routine
« Reply #15 on: January 06, 2005, 04:57:29 PM »
Cab,

Any thoughts on making extensions on your break routine so that it did go beyond? Other then that, and not that is a bad thing but a great tool that is easy to use.

Pieter

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
encrypted lisp routine
« Reply #16 on: January 06, 2005, 06:58:48 PM »
Here is another version.
Code: [Select]
;;;===========================================
;;;      Single Line Break Symbol Creator    
;;;===========================================
;;;
;|     Created by C. Alan Butler  2003
     Yet another Break symbol creator
     Uses PloyLine created on the current layer
     Ortho Mode is up to you to pre set or not
     Symbol is proportional to the length
     and doesn't break anything
       [ Modified 01/06/2004 ]
     extends the break line out from the two picks
|;
 ;
(defun c:brk (/ p1 p2 p3 p4 p5 p6 dist ang usercmd)
 ;
 ; error function & Routine Exit
  (defun *error* (msg)
    (if
      (not
        (member
          msg
          '("console break" "Function cancelled" "quit / exit abort" "")
        )
      )
       (princ (strcat "\nError: " msg))
    ) ; if
    (setvar "CMDECHO" usercmd)
    (setvar "osmode" useros)
    (princ)
  ) ;
 ;end error function
  (setq oldcmd (getvar "CMDECHO"))
  (setvar "CMDECHO" 0)
  (setq useros (getvar "osmode"))

  (setq usercmd (getvar "CMDECHO"))
  (setvar "CMDECHO" 0)
  (setvar "plinewid" 0)
  (if (and (setq p1 (getpoint "Starting point of line : "))
           (setq p6 (getpoint p1 "\nSelect second point: "))
      )
    (progn
      (setq dist (distance p1 p6)
            ang  (angle p1 p6)
            p1 (polar p1 (- ang pi) (* 0.3 dist))
            p6 (polar p6 ang  (* 0.3 dist))
            dist (distance p1 p6)
       )
     (setq
            p2   (polar p1 ang (* 0.4167 dist))
            p5   (polar p1 ang (* 0.5833 dist))
            p3   (polar p2 (+ 1.25664 ang) (* 0.1667 dist))
            p4   (polar p5 (+ 4.39824 ang) (* 0.1667 dist))
      ) ;_ end of setq
      ;;  create extension points
      (setvar "osmode" 0)
      (command "pline" p1 p2 p3 p4 p5 p6 "") ; Draw the Z-Line
    )
  )
  (*error* "")
  (princ)
)
(prompt
  "\nBreak Symbol Creator loaded.  Type BRK to run it."
)
(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.

Anonymous

  • Guest
encrypted lisp routine
« Reply #17 on: January 06, 2005, 07:07:26 PM »
Do you guys have a break routine for rectangular HVAC duct?


Thanks

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
encrypted lisp routine
« Reply #18 on: January 06, 2005, 07:45:03 PM »
Can you post a picture or drawing of what you are after.
Sorry I don't understand what you are asking for.
PS you will have to join before you can post pictures & drawings, it's painless :)
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.

dubb

  • Swamp Rat
  • Posts: 1105
encrypted lisp routine
« Reply #19 on: January 06, 2005, 08:19:51 PM »
cab....
that is beautiful....

pmvliet

  • Guest
encrypted lisp routine
« Reply #20 on: January 13, 2005, 12:15:45 PM »
Awesome :o)

Crank

  • Water Moccasin
  • Posts: 1503
encrypted lisp routine
« Reply #21 on: January 13, 2005, 01:51:36 PM »
Quote from: dubb
...but there are times when the break symbol is larger than the distance to to break. did i confuse ya?


Let's throw one of my first functions in :) :
Code: [Select]

; BRL.lsp
; Copyright ©1994 J.J.Damstra
; Modified for TheSwamp.org 13-01-2005

(defun c:brl (/ a a1 a2 af1 af2 hoek entp entq entv ep le p1 p2 p3 p4 p5 p6 sp)
(setq sp (getpoint "\nPoint 1:") ep (trans (getpoint sp "\nPoint 2:") 1 0) sp (trans sp 1 0))
(setq le (distance sp ep) hoek (angle sp ep))
(setq a1 (+ 1 (fix (/ le (* 25 (getvar "DIMSCALE"))))) a (/ le a1) a2 (/ a 2.0))
(setq af1 (* 1 (getvar "DIMSCALE")) af2 (* 1.5 (getvar "DIMSCALE")))

(setq entp (list (cons 0 "polyline")))
(setq entv (cons 0 "vertex"))
(setq entq (list (cons 0 "seqend")))
(entmake entp)
(setq p1 (cons 10 sp))
(entmake (list entv p1))
(repeat a1
(setq p2 (cons 10 (polar (cdr p1) hoek a2))
p3 (cons 10 (polar (cdr p2) (+ hoek pi) af1))
p4 (cons 10 (polar (cdr p2) (+ hoek (* pi 0.6)) af2))
p5 (cons 10 (polar (cdr p2) (- hoek (* pi 0.4)) af2))
p6 (cons 10 (polar (cdr p2) hoek af1))
)
(entmake (list entv p3))
(entmake (list entv p4))
(entmake (list entv p5))
(entmake (list entv p6))
(setq p1 p2 a2 a)
)
(setq ep (cons 10 ep))
(entmake (list entv ep))
(entmake entq)

(princ)
)
Vault Professional 2023     +     AEC Collection

dubb

  • Swamp Rat
  • Posts: 1105
encrypted lisp routine
« Reply #22 on: January 17, 2005, 12:30:00 PM »
gr8 lisp routine....however, do i have to switch my dimscale to 1 for it to draw  the right sized breakline on a 3/4"=1'-0" drawing?

WARBIE

  • Guest
encrypted lisp routine
« Reply #23 on: February 15, 2005, 03:44:09 AM »
*edited* by Hendie

TimSpangler

  • Water Moccasin
  • Posts: 2010
  • CAD Naked!!
encrypted lisp routine
« Reply #24 on: February 15, 2005, 07:45:00 AM »
Here is a linetype that I use.

Break.zip
ACA 2015 - Windows 7 Pro
All Comments and Content by TimSpangler, Copyright © 2016