BIGAL Posted April 26 Posted April 26 Can you post me a sample of the bevels use wblock. I tested on random lines and it worked, all 4 quadrants. That is all that is needed some lines. Quote
Cadkiller Posted April 26 Author Posted April 26 Here is a drawing with some lines and the bevel symbols that are just made from lines and dimensions. Which I created with a wblock as requested. I hope this is as you requested, Please correct me if it's not the way you wanted. block.dwg Quote
BIGAL Posted April 27 Posted April 27 (edited) Ok found out a bit more if you have shallow angles then whilst it still works. from a drafting point of view is not desirable, as an example I get 12" and 8' 2" so line work draws over original line, will fix. I have updated the code try this. see code in later post Edited May 19 by BIGAL Quote
Cadkiller Posted April 27 Author Posted April 27 Hey Big Al, Very nice! 1- That the 12" is always horizontal. Can it be vertical to display the horizontal less than 12"? Where the 5'-5 3/16" would be 12" and the 12" would be 2 3/16". 2- Could the text height be set to match the current scale? Or if not, could it the set to 1 1/2" scale versus what it is now? 3- Lastly could the triangle size be constant or does it need to vary based one the angle? Thanks again you are the Awesome! Quote
BIGAL Posted April 28 Posted April 28 (edited) Q 1 I guess could be done reversing the algorithm based on the 12. Will have a think, say when angle is less than 30 or some number. Q 2 Your sample uses annotative text and I had problems getting that to work. hence the Standard text, you need to confirm which text style, to be used, the sample dwg had lots of text styles but they all looked the same. Some one else may help you and me by providing the use annotative text code. Q 3 the issue is that angles around 45 work great, for shallow angles the vertical can increase in size dramatically. As per the code which has some fuzzy factors to make it look good. I found this to be the case. You would have to draw some other shape for the answers if you want a shorter version. Edited April 28 by BIGAL Quote
Cadkiller Posted April 28 Author Posted April 28 I think by reversing the base 12” to be vertical it should provide a similar triangular size result like the others that have the horizontal base 12”. Quote
BIGAL Posted April 28 Posted April 28 Will see what I can do reversing the 12, was thinking of rewriting the cond and only have one defun to draw the answer passing all the shifts angles and text alignment. (doanswer pi270 '(0.25 0 0) "ML" pi '0.25 0 0) '0.5 0.5 0.0) '(0.0 0.25 0.0) "BL") Quote
BIGAL Posted May 2 Posted May 2 (edited) Give this a try see code in latest post. Edited May 19 by BIGAL Quote
Cadkiller Posted May 2 Author Posted May 2 Hey Big Al, It's still not applying the 12" as vertical, but the size of the triangle is much smaller. Quote
Cadkiller Posted May 2 Author Posted May 2 Al The top answer was from the previous code you created. Sorry I should have removed it. The lower right one is from the latest code. Quote
Cadkiller Posted May 5 Author Posted May 5 Hey Big Al, I tried AI to see if it could help resolve the reverse pitch to have the 12" base as vertical but no luck. Here is an old AutoLisp program that does, but it only provides the rise, run and angle info without the triangle and line as I would like to have it. Maybe you can see how it works and be able to apply it to the code you created. (defun beverr (s) (if (/= s "Function cancelled") (princ (strcat "\nError: " s))) (setq p nil) (setq *error* olderr) (princ) ) (defun DTR (a1) (* pi (/ a1 180.0)) ) (defun rtd (a) (* 180.0 (/ a pi)) ) (defun pbv (/ RBEV TAN 1TAN BVANG BVPT2 BVPT1) (setq olderr *error* *error* beverr ) (setq BVPTX (entget (car (entsel "\nSelect line: "))) BVPT1 (cdr (assoc 10 BVPTX)) BVPT2 (cdr (assoc 11 BVPTX)) BVPTY (cdr (assoc 0 BVPTX)) BVANG (angle BVPT1 BVPT2) 1TAN (rtd BVANG) ) (if (> 1TAN 180) (setq 1TAN (abs (- 1TAN 180)))) (if (> 1TAN 90) (setq 1TAN (abs (- 1TAN 90)))) (if (> 1TAN 45) (setq 1TAN (abs (- 45.0 (- 1TAN 45))))) (if (= 1TAN 45) (setq 1TAN 0.0)) (setq TAN (/ (SIN (/ (+ 360 1TAN) (/ 360 (* 2 PI)))) (COS (/ (+ 360 1TAN) (/ 360 (* 2 pi)))))) (if (= 1TAN 0) (setq TAN 0) tan) (setq TAN (abs TAN)) (setq RBEV (rtos (* TAN 12.0))) (if (/= BVPTY "LINE") (setq TAN "XXX")) (if (/= BVPTY "LINE") (setq RBEV "XXX")) (if (/= BVPTY "LINE") (setq 1TAN "XXX")) (setq XXBVANG (DTR 1TAN)) (princ "\nTan=") (princ (rtos TAN 2 8)) (princ " ") (princ "Bev=") (princ RBEV) (princ " ") (princ "Deg=") (princ (rtos 1TAN 2 5)) (princ " ") (princ "Deg-90=") (princ (rtos (- 90.0 1TAN) 2 5)) (princ " ") (princ "D,M,S=") (princ (angtos XXBVANG 1 6)) (terpri) (princ) (if (/= BVPTY "LINE") (prompt "\nThis is not a LINE !!!")) (setq SPX (getpoint "\nPick spot for bevel: ")) (command "text" SPX (* 0.1875 (getvar "dimscale")) "0.0" (rtos (* TAN 12.0))) (setq SPW (getpoint "\nPick spot for 12: ")) (command "text" SPW (* 0.1875 (getvar "dimscale")) "0.0" "12") (setq SPY (getpoint "\nPick spot for degree: ")) (command "text" SPY (* 0.125 (getvar "dimscale")) (- 360.0 1TAN) (strcat (rtos 1TAN 2 2) "%%D")) (setq SPZ (getpoint "\nPick spot for degree minus 90: ")) (command "text" SPZ (* 0.125 (getvar "dimscale")) (- 360.0 1TAN) (strcat (rtos (- 90.0 1TAN) 2 2) "%%D")) (princ) ) (defun C:BEVV () (pbv) ) Quote
SLW210 Posted May 5 Posted May 5 Where did you get the LISP? I am hesitant to modify a LISP without knowing the author or original source. Quote
Cadkiller Posted May 5 Author Posted May 5 I don't know the author! It was shared with me from another detailer. Quote
BIGAL Posted May 15 Posted May 15 Working on it the issue is you need to reverse the 12" to the other leg when an angle exceeds 45 in any quadrant. So 0-90, the horizontal will be 12" when angle is less than 45, when it exceeds 45 it changes to the vertical. So I have 4 quadrant defuns need to change this to 8. Will try to do soon. Quote
Cadkiller Posted May 16 Author Posted May 16 Thanks, Big Al Look forward to seeing it once you get a chance to complete it. Quote
BIGAL Posted May 19 Posted May 19 i am working on it you can see the swap of the 12". Maybe tomorrow. Quote
Cadkiller Posted May 19 Author Posted May 19 Big Al, You are the best! Thanks so much for this code! I owe you one. It works great! Quote
Cadkiller Posted May 19 Author Posted May 19 Opps I spoke too soon! I see when the 12" base is vertical the angle is showing the opposite answer. Is it easy to give the reverse angle of the pitch? Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.