Jump to content

lisp routine for


bartdewilde

Recommended Posts

Hi can somebody tell me what's wrong with this program

it doesn't work :?

 

 

this is a routine to draw a connection piece of two round air ducts with different dimensions. For example to connect a duct with diameter 20 cm to a duct with diameter 40 cm.

The reduction must have a specific angle to prevent turbulent air flows (typical 15°) and has a collar of 5 cm on both ends to connect with te ducts.

 

(defun c:verloop (/ p1 p2 p3 p4 dia1 dia2 r1 r2 c1 c2 c3 c4 verschil rad15 tan15 dy l)
 
 (setq p1 (getpoint "\nStart point :  "))
 (setq dia1 (getdist "\n first diameter :  "))
 (setq r1 (/ dia1 2))
 (setq dia2 (getdist "\n second diameter :  " ))
 (setq r2 (/ dia2 2))
 (command "circle" p1 r1 )
 (setq c1 (entlast))
 
 (setq p2 (list (car p1) (cadr p1) (+ (caddr p1) 5)))
 (command "circle" p2 r1 )
 (setq c2 (entlast))
 
 (setq verschil (abs (- dia1 dia2)))            
 (setq rad15 (/ (* 15 pi) 180))                 
 (setq tan15 (/ (sin rad15) (cos rad15) ) )
 (setq dy(/ verschil 2))                        
 (setq l(/ dy tan15))   
                       
 (setq p3 (list (car p2) (cadr p2) (+ (caddr p2) l))) 
 (command "circle" p3 r2)
 (setq c3 (entlast))
 (setq p4 (list (car p3) (cadr p3) (+ (caddr p3) 5)))
 (command "circle" p4 r2)
 (setq c4 (entlast))
 (command "loft" c1 c2 c3 c4 "" "" r "")

)

Link to comment
Share on other sites

This works good on my end

Just change the last line on this one:

(command "loft" c1 c2 c3 c4 "" "" r)

 

And also don't forget to set OSMODE to 0

before you will be draw something with command, then

restore it back

 

~'J'~

Link to comment
Share on other sites

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