Jump to content

Retrieve objects after explode


grandhougday

Recommended Posts

I need a lisp to explode a Cylindrical Solid shape. in fact explode 2 times. first it become to surface and after another explosion it become to two circles. then i want to do something with that circles.

How i can do this?

in VBA by Explode Function by default return objects:

explodedObjects = BlockObj.Explode

but how is it in lisp?

Link to comment
Share on other sites

(vlax-invoke [color=green][/color] 'explode)

Will return a list of exploded objects (where is the object to be exploded); note that this method will retain the original object.

Link to comment
Share on other sites

or

 

(defun c:demo (/ qf)
 (setq qf (getvar 'Qaflags
   )
 )
 (setvar 'qaflags 1)
 (if (setq ss (ssget "_:L" '((0 . "3DSOLID"))))
   (progn
     (command "_explode" ss "")
     (command "_explode" "_Previous" "")
     (sssetfirst nil (ssget "P" '((0 . "[color=blue][b]CIRCLE"[/b][/color][color=black]))))[/color]
     (setvar 'qaflags qf)
   )
 )
)

Link to comment
Share on other sites

  • 1 year later...

Hello.

 

I'm trying pBe's code on ruled surface:

(defun c:demo (/ qf)
 (setq qf (getvar 'Qaflags
   )
 )
 (setvar 'qaflags 1)
 (if (setq ss (ssget '((100 . "AcDbPolygonMesh"))))
   (progn
     (command "_explode" ss "")
     (command "_explode" "_Previous" "")
     (sssetfirst nil (ssget "P" '((0 . "3DFACE"))))
     (setvar 'qaflags qf)
   )
 )
)

but it returns

Command: demo

Select objects: 1 found

Select objects:

_explode

Select objects: 1 found

Select objects:

Command: _explode

Select objects: _Previous 12 found

12 were not able to be exploded.

Select objects:

None found.

Command: 1

Any ideas how I can retrieve 3dface's out of a ruled surface without possibly affecting the original surface?

 

Thank you.

Link to comment
Share on other sites

(defun c:demo (/ qf)
 (setq qf (getvar 'Qaflags
   )
 )
 (setvar 'qaflags 1)
 (if (setq ss (ssget '((100 . [b]"Mesh"[/b]))))
   (progn
    [b] (command "_copy" ss "" "0,0" "@" "")[/b]
     (command "_explode" ss "")
     (sssetfirst nil (ssget "P" '((0 . "3DFACE"))))
     (setvar 'qaflags qf)
   )
 )
)

Link to comment
Share on other sites

Thank you very much!

 

The problem was

      (command "_explode" "_Previous" "") 

 

Removed that line and it worked.

Copy object on top of itself also worked, thank you.

 

P.S.

rulesurf creates mesh with

(100 . "AcDbPolygonMesh")

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