Jump to content

How to select a "loft" surface via lisp to thicken


Hachi

Recommended Posts

Hey guys!

 

I'm trying to write a lisp that creates a 3D reducer. Once I create the 3D surface via command "_Loft" it remains to create a 3d solid body with the "thicken" command. I can't select the 3D loft surface. Can anyone help with this?
Thanks in advance for the answers! Here is my code:

(defun c:ccs (/ DK DN L P1 P2 P3 P4 RK RN S NS)

  (setq Dn (getreal "Adja meg a nagyobb vezeték külső átmérőjét:")) ; Give me the biger pipe diameter
  (setq Dk (getreal "Adja meg a kisebb vezeték átmérőt:")); give me the reduced diameter
  (setq L (getreal "Adja meg az átmenet hosszát:")); give me the length in which have to be reduced
  (setq s (getreal "Adja meg a falvastagságot:")); give me the thickness of the pipe

  (setq Rn (/ Dn 2))
  (setq Rk (/ Dk 2))
  (setq ns (min s (- 1)))

  (setq p1 '(0 0 0))
  (setq p2 (list 0 0 L))

  (setq p3 (polar p1 0 Rn))
  (setq p4 (polar p2 0 Rk))

  (setq p5 (polar p3 (/ pi 2) Dn))
  (setq p6 (polar p1 pi Dn))

  (command "_Circle" p1 Rn "")

  (command "_Zoom" "_All" "")

  (command "_Circle" p2 Rk "")

  (command "_Zoom" "_All" "")

  (command "_loft" p3 p4 "" "")

  (command "_select" p5 p6 "")

  ;(command "_THICKEN" ns "")

  (princ)

  )
  
   

 

Edited by Hachi
Link to comment
Share on other sites

Hello guys!

 

I find a solution for this particular problem! For me it works, maybe can help for others to:

(defun c:ccs (/ DK DN L P1 P2 P3 P4 RK RN S NS SS1)

  (setq Dn (getreal "Adja meg a nagyobb vezeték külső átmérőjét:"))
  (setq Dk (getreal "Adja meg a kisebb vezeték átmérőt:"))
  (setq L (getreal "Adja meg az átmenet hosszát:"))
  (setq s (getreal "Adja meg a falvastagságot:"))

  (setq Rn (/ Dn 2))
  (setq Rk (/ Dk 2))
  (setq ns (min s (- 1)))

  (setq p1 '(0 0 0))
  (setq p2 (list 0 0 L))

  (setq p3 (polar p1 0 Rn))
  (setq p4 (polar p2 0 Rk))

  (setq p5 (polar p3 (/ pi 2) Dn))
  (setq p6 (polar p1 pi Dn))

  (command "_Circle" p1 Rn "")

  (command "_Zoom" "_All" "")

  (command "_Circle" p2 Rk "")

  (command "_Zoom" "_All" "")

  (command "_loft" "MÓ" "F" p3 p4 "" "")

  (setq ss1 (ssget "_L"))

  (command "_THICKEN" ss1 "" ns "")

  (princ)

  )
  
   

 

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