Jump to content

"explode" (distance) parts - solids


sloman

Recommended Posts

Hi, with word EXPLODE i don't meen the explode command. To brake appart part (block or solid).

 

But i would like to "explode" all parts (blocks or solids) appart and move eatch of them some disstance appart from enother for presentation purposes and then join them together if i would like again with a command to return to original place.

 

Any way to do that automaticly with a command in Autocad 2008?

Link to comment
Share on other sites

Try Iinventor?

Or Alibre :)

 

Problem is, that i have current project made in Autocad 2008. And its going to pruduction soon.

 

But i will have to learn some real 3d modelers beacose autocad yust have many restrictions.

Link to comment
Share on other sites

Maybe you can search for some add ons.

I bet someone has written a lisp or vba routine that moves all blocks and solids away from a given point with a given factor.

Link to comment
Share on other sites

I bet someone has written a lisp or vba routine that moves all blocks and solids away from a given point with a given factor.

It is a bit more difficult: if you wish the program to detect itself the directions to move the solids/blocks you must have something like constrains. But AutoCAd doesn't work with constrains -so the "manual way" is the only one I can see for the moment.

Link to comment
Share on other sites

I was thinking it should be possible to obtain a similar effect using dynamic blocks properties and the polar strech action, but I'm a real newbie in the use of dynamic blocks and so I'm not sure what I have in mind is feasible. Maybe members more into dynamic blocks can give their opinion on this

Link to comment
Share on other sites

I was thinking it should be possible to obtain a similar effect using dynamic blocks properties and the polar strech action, but I'm a real newbie in the use of dynamic blocks and so I'm not sure what I have in mind is feasible. Maybe members more into dynamic blocks can give their opinion on this

 

Good idea riga. This could probably be done with Visibility parameters and/or Lookups. There is a recent post in the General section with a location for some video tutorials on Dynamic Blocks.

 

Dynamic Block Help

Link to comment
Share on other sites

Good idea riga. This could probably be done with Visibility parameters and/or Lookups. There is a recent post in the General section with a location for some video tutorials on Dynamic Blocks.

 

Dynamic Block Help

 

I tought it was possible to do ot with polar strech action, but for a presentation the idea of visibility/lookups parameters could work better and it's easyer to do (depending on the numbers of objects that needs to be "exploded").

At this point I think it will be usefull to have a couple of images that represent which is the effect sloman needs to obtain, so that we can suggest at least a good enough work around

Link to comment
Share on other sites

I do this here sometimes and since all we have is basic AutoCAD I do it with layers. I put almost everything on its own layer, or group them where is makes the best sense and then in a layout I end up with many viewports with all the layers frozen except just one. This has obvious limitations but it gets the job done.

Link to comment
Share on other sites

Drop this in an open drawing and see what you think. Just a quick little Dynamic Block I stuck together and I am a rookie when it comes to Dynamic Blocks.

Link to comment
Share on other sites

How about this..Take your unexploded drawing and copy it to one side in a open area...explode the copy and then you will have both the exploded and the unexploded..The exploded drawing will have to have its parts moved away doing it the hard way,piece by piece..

Link to comment
Share on other sites

This may work for you, but if youe have many parts you should make a copy on a frozen layer and then ExplodeView :)

 

 
Sub XplodeView()
Dim e As AcadEntity
Dim s As AcadSolid
Dim Bmin As Variant 'Min point of bounding box
Dim Bmax As Variant 'Max point..
Dim CP(0 To 2) As Double 'Kind of CenterPoint, mid between Bmin and Bmax
Dim Origo(0 To 2) As Double 'Origon: 0,0,0
Origo(0) = 0: Origo(1) = 0: Origo(2) = 0
For Each e In ActiveDocument.ModelSpace
e.GetBoundingBox Bmin, Bmax
CP(0) = (Bmin(0) + Bmax(0)) / 2
CP(1) = (Bmin(1) + Bmax(1)) / 2
CP(2) = (Bmin(2) + Bmax(2)) / 2
If Not ActiveDocument.Layers(e.Layer).Freeze = True Then e.Move Origo, CP
Next
End Sub

Sub ImplodeView()
Dim e As AcadEntity
Dim s As AcadSolid
Dim Bmin As Variant 'Min point of bounding box
Dim Bmax As Variant 'Max point..
Dim CP(0 To 2) As Double 'Kind of CenterPoint, mid between Bmin and Bmax
Dim Origo(0 To 2) As Double 'Origon: 0,0,0
Origo(0) = 0: Origo(1) = 0: Origo(2) = 0
For Each e In ActiveDocument.ModelSpace
e.GetBoundingBox Bmin, Bmax
CP(0) = (Bmin(0) + Bmax(0)) / 4 'Now this is midway between CP and Origion..
CP(1) = (Bmin(1) + Bmax(1)) / 4
CP(2) = (Bmin(2) + Bmax(2)) / 4
If Not ActiveDocument.Layers(e.Layer).Freeze = True Then e.Move CP, Origo
Next
End Sub

Uten navn.jpg

Link to comment
Share on other sites

I tested with both solids and surfaces.

There is no error control in my code it's just a fast example, it may not work in all drawings, but it worked in a few I tested.

 

Press ALT+F11 to open the VBA editor in AutoCAD (or use menu Tools / Macro / Visual Basic Editor)

Paste the code from above, see image belowe.

Then use the command VBARUN or make two command buttons, with macros like

^C^C-vbarun;XplodeView

and

^C^C-vbarun;ImplodeView

VBA Editor.jpg

Link to comment
Share on other sites

Actually i must say these works like a charm. Great job really posting these.

 

When i explode a small disortion is presented for some solids (minimum displacement for parts). I guess beacose of mid point and distance frome it.

 

But for presentation purposes these is yust the best.

 

How could i create buttons as you suggested? A command Vbarun works like a charm, but i like to try it with a button to.

 

Edit: I have created a button in customize and add ^C^C-vbarun;XplodeView ... and again it works like a charm.

 

Thanx x 2

Link to comment
Share on other sites

Use the CUI command to create 2 new commands and assign to them the 2 macros reported in the post of Raggi_Thor.

You can edit the buttons names obviously.

Then you can create a new toolbar and drag the 2 new commands into it or just drag them into an already existing toolbar.

 

This link can be usefull and more clear

http://www.ellenfinkelstein.com/AutoCAD_tips_custom_command.html

Link to comment
Share on other sites

  • 5 years later...

I have been looking for some time to find a bit of code to do this!!! Is there a way to get it to explode in the X & Y direction? It only seems to be pulling the parts in one axis. Again, thank you this is great stuff!

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