Jump to content

Recommended Posts

Posted

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.

Posted

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

Posted (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 by BIGAL
Posted

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!

 

image.thumb.png.39325cdadbe0bb526d5a6e0a4e807fb4.png

Posted (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 by BIGAL
Posted

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”.

Posted

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")

Posted (edited)

Give this a try

see code in latest post.

 

Edited by BIGAL
Posted

Hey Big Al,

 

It's still not applying the 12" as vertical, but the size of the triangle is much smaller.

 

image.thumb.png.98ad321e92cbd30efbebee2eecc27d13.png

Posted

Top answer is odd will look at that. will have another go 

Posted

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.

Posted

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)
)

 

Posted

Where did you get the LISP?

 

I am hesitant to modify a LISP without knowing the author or original source.

Posted

I don't know the author!

It was shared with me from another detailer.

  • 2 weeks later...
Posted

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.

Posted

Thanks, Big Al

Look forward to seeing it once you get a chance to complete it.

Posted

i am working on it you can see the swap of the 12". Maybe tomorrow.

 

image.png.81806f6eb40d361acd4c3c9e74963ea9.png

Posted (edited)

 

see last post

 

Edited by BIGAL
Posted

Big Al,

 

You are the best!

Thanks so much for this code!

I owe you one.

It works great!

 

image.thumb.png.f2f2cf3cc0c2e4f92d526d7c1a91644a.png

Posted

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?

 

image.thumb.png.811ed6978960b66c91c8042db2e60257.png

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...