TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: ribarm on October 24, 2015, 05:45:32 PM

Title: SOLIDEDIT TASK
Post by: ribarm on October 24, 2015, 05:45:32 PM
I have 3dsolid shell object and I want to perform certain modeling operation on it to accomplish desired result shown in attached DWG... If it's possible lisp routine would be nice (just I don't know how to implement correct selection operations using SOLIDEDIT command "Face" option)... Any help or thought you have to tell me or maybe some different approach what I've considered but thought it's more complicated (using SECTION command and finding inside boundaries for making extruded 3d solid operand for subtraction operation)... So what do you think, please look into attachment...

Kr, M.R.
Title: Re: SOLIDEDIT TASK
Post by: ribarm on October 24, 2015, 10:22:51 PM
I figured out... It was very easy...

Code - Auto/Visual Lisp: [Select]
  1. (defun c:perforateshell ( / *error* f v pt pl )
  2.  
  3.   (defun *error* ( m )
  4.     (if f (command "_.UCS" "_P"))
  5.     (if v (command "_.ZOOM" "_P"))
  6.     (if m (prompt m))
  7.     (princ)
  8.   )
  9.  
  10.   (if (eq (getvar 'worlducs) 0)
  11.     (progn
  12.       (command "_.UCS" "_W")
  13.       (setq f t)
  14.     )
  15.   )
  16.   (if (not (equal (getvar 'viewdir) '(0.0 0.0 1.0) 1e-6))
  17.     (progn
  18.       (command "_.PLAN" "")
  19.       (setq v t)
  20.     )
  21.   )
  22.   (setq pt t)
  23.   (while pt
  24.     (setq pt (getpoint "\nPick or specify point inside shell to perforate its top/bottom sides (ENTER-FINISH) : "))
  25.     (if pt (setq pl (cons pt pl)))
  26.   )
  27.   (command "_.SOLIDEDIT" "_F" "_E")
  28.   (foreach pt pl
  29.     (command pt)
  30.   )
  31.   (foreach pt pl
  32.     (command pt)
  33.   )
  34.   (foreach pt pl
  35.     (command pt)
  36.   )
  37.   (command "_R")
  38.   (foreach pt pl
  39.     (command pt)
  40.   )
  41.   (command "")
  42.   (command (- (getvar 'viewsize)))
  43.   (while (< 0 (getvar 'cmdactive)) (command ""))
  44.   (*error* nil)
  45. )
  46.  

Thanks anyway for reading...
M.R.
Title: Re: SOLIDEDIT TASK
Post by: roy_043 on October 25, 2015, 05:19:11 AM
Alternative approach:
Remove bottom and top 'lids' with: 2*Slice; or: 2*Box+Subtract; or: Box+Intersect.
To compensate for loss in height: copy the Solid in the Z direction and Union original and copy.
Title: Re: SOLIDEDIT TASK
Post by: lamarn on October 25, 2015, 05:51:13 PM
This is usefull. The object stays a 3D solid!
Title: Re: SOLIDEDIT TASK
Post by: AIberto on October 25, 2015, 09:26:06 PM
marko . Thank you for sharing.  You changed the " Personalized Picture" ?