TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: dubb on January 05, 2005, 06:42:19 PM
-
this lisp routine was given to me by my old co-worker. however i would like to look at the code but apparently i cant because it seems to be encrypted. please check my lily pond for the file Break.lsp (http://www.theswamp.org/lilly_pond/dubb/BREAK.LSP?nossi=1)
-
Code is usually encrypted for a reason, so I am loathe to "break" someone's attempt at security. Sorry.
-
well, i had permission to have this lisp routine. its simply just a routine to draw a break symbol. however when i load the routine i receive this error.
error: bad character read (octal): 0
-
Permission to use a specific code is different than permission to break encryption. Contact the original owner of the code.
Express tools has a breakline function.
BTW, an octal error indicates to me some sort of font or shape error. Do you have all the proper compiled shape files in the proper paths?
-
OK...thanks for clarifying that for me. i know that i had probably reached the line between copyright and free. but I am too aware of encrypted lisp routines. i dont know what other file could be related to this routine. its basically a line that looks like a widget's tail., if you know what i mean. anyhow its not my common practice to break codes i'd rather create my own. im pretty sure if someone finds out then i have a good explanation. may this be a lesson to all.
-
This one may not work like the one you have.
But you can modify it.
;;;===========================================
;;; 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
|;
;
(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)
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
(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 should have known that Cab would have a breakline function. I'd be surprised if he didn't have one to draw paychecks. :wink:
-
CADaver, that'd be my job ... I must say that I am very good at it too.....
-
snort :lol:
-
Print me up a few next time your printing. :D
-
thanks alot fellaz...this routine looks like newer code than the one i have..i think the code is faily old it was made in 1996.
-
sweet 8) this routine is a beauty thanks
-
CAB's the man. :roll: :wink:
-
Thanks folks.
I was able to run the other lisp, command BR.
It is different in that a layer is created, the Z shape is different
and the end points of the break line are extended past the actual pick points.
There are times when the extensions beyond the pick points are useful.
-
the best thing about the other lisp command "BRK" is that no matter the size of what is to be broken, the break line changes its size per the distance of the break distance. however, my routin "BR" inteferes with the autocad "break" command and its also dependent on the dimscale. having it dependent on the dimscale can be useful but there are times when the break symbol is larger than the distance to to break. did i confuse ya?
-
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
-
Here is another version.
;;;===========================================
;;; 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)
-
Do you guys have a break routine for rectangular HVAC duct?
Thanks
-
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 :)
-
cab....
that is beautiful....
-
Awesome :o)
-
...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 :) :
; 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)
)
-
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?
-
*edited* by Hendie
-
Here is a linetype that I use.
Break.zip (http://www.theswamp.org/lilly_pond/timspangler/Break.zip?nossi=1[url)