Selecting the last two objects in Extrusion command

Selecting the last two objects in Extrusion command

jb.boschung
Enthusiast Enthusiast
479 Views
6 Replies
Message 1 of 7

Selecting the last two objects in Extrusion command

jb.boschung
Enthusiast
Enthusiast

Hello,

First, excuse-me for my english

As part of the creation of pressure network components (Elbow), which I generate by creating two circles (inner (Dint) and outer (Dext) diameter) and which I extrude according to the part axis (path), I would like to recover these two objects, in order to subtract the 3d solid generated inside the exterior 3D solid, this to hollow out the pipe.

I generate these two parts together by an extrusion command, and as a result, I cannot use 'entlast'.

Any idea how to do it?

Thanks in advance

 

jbboschung_0-1713892640215.png

 

 

 

 

...
				;; Modification du SCU
				(command "SCU" "X" 90 "")
				;; Affichage des cercles des composants
				(command "_.circle" Pt1 "D" d_ext "")
        (setq Dext (entlast)) ; on mémorise l'objet représentant le cercle exterieur
				(command "_.circle" Pt1 "D" d_int "")
        (setq Dint (entlast)) ; on mémorise l'objet représentant le cercle interieur
				;; On remet le SCU initial
				(command "SCU" "X" -90 "")
			  (command "_.zoom" "ET" "")

        ;
				;; Creation du chemin d'extrusion
				; - On cree une liste de point (path) pour le chemin d'extrusion,
				; - on ajoute le premier point, idem au centre des cercles,
        ; - on calcule le deuxième en ajoutant le Z,
        ; - on calcule le troisième en tenant compte de l'angle,
        ; - on stocke le tout dans une liste.
				(setq pt1 (list X1 Y1)
              pt2 (list X1 (+ Y1 Z))
              pt3 (list (+ X1 (* Z (sin (d2r angl)))) (+ (+ Y1 (* Z (cos (d2r angl)))) Z))
              lst_pts (list pt1 pt2 pt3)
        ) ;_ end of setq
				
				; On cree le chemin avec une polyligne
				(command "_.pline")
        ;(setq last_object (entget (entlast)))
				(foreach item lst_pts (command item))
				(command "")
        (setq Path (entlast)) ; on mémorise l'objet représentant l'axe, chemin d'extrusion

        ; Extrusion du composant Cercle extérieur et intérieur
        (command "Extrusion" Dext Dint "" "C" Path "")
        (setq Dext (entlast ???))
        (setq Dint (entlast ???))

        (command "soustraction" Dext "" Dint "")
...

 

 

 

0 Likes
Accepted solutions (2)
480 Views
6 Replies
Replies (6)
Message 2 of 7

Kent1Cooper
Consultant
Consultant

I would simply Extrude them one at a time, and save the result after each Extrusion:

(command "Extrusion" Dext "" "C" Path "")
(setq Dext (entlast))
(command "Extrusion" Dint "" "C" Path "")
(setq Dint (entlast))
Kent Cooper, AIA
0 Likes
Message 3 of 7

jb.boschung
Enthusiast
Enthusiast
Accepted solution

Hi, I found (a) solution.

Simply create two identical paths, one for the outer diameter and one for the inner diameter, then extrude each object separately, saving it with an 'entlast'

...

	; On cree le chemin 1 (Dext) avec une polyligne
				(command "_.pline")
        ;(setq last_object (entget (entlast)))
				(foreach item lst_pts (command item))
				(command "")
        (setq Path_ext (entlast)) ; on mémorise l'objet représentant l'axe, chemin d'extrusion
				; On cree le chemin 2 (Dixt) avec une polyligne
				(command "_.pline")
        ;(setq last_object (entget (entlast)))
				(foreach item lst_pts (command item))
				(command "")
        (setq Path_int (entlast)) ; on mémorise l'objet représentant l'axe, chemin d'extrusion

        ; Extrusion du composant Cercle extérieur et intérieur
        (command "Extrusion" Dext "" "C" Path_ext "")
        (setq Dext (entlast))
        (command "Extrusion" Dint "" "C" Path_int "")   
        (setq Dint (entlast))

        (command "soustraction" Dext "" Dint "")

...
0 Likes
Message 4 of 7

Kent1Cooper
Consultant
Consultant

[There should be no need for separate paths for the two Extrusions.  See my first Reply.]

Kent Cooper, AIA
0 Likes
Message 5 of 7

jb.boschung
Enthusiast
Enthusiast

Thanks for your feedback.
But when I do my first extrusion, the path disappears and the second cannot be done. If I double the path (polyline), each extrusion has its own path and it works.
Below is the final result, there is no more path, they both disappeared during extrusion.
I hope I'm clear enough.

jbboschung_0-1713902170536.png

 

0 Likes
Message 6 of 7

Kent1Cooper
Consultant
Consultant
Accepted solution

Curious....  The Path does not disappear for me (version-dependent, perhaps?) even if I have DELOBJ set to 1.  If you have DELOBJ set to 1, the Circles would eisappear, but is that the cause of your Path also disappearing?  Does the Path disappear if DELOBJ = 0?

Kent Cooper, AIA
0 Likes
Message 7 of 7

jb.boschung
Enthusiast
Enthusiast

Hello, well seen my DELOBJ variable was by default set to 3 (Deletes all defining geometry, including paths...).
I set it to 1 and it's all good. Thanks !

0 Likes