Author Topic: How do I explode a block using a script?  (Read 8284 times)

0 Members and 1 Guest are viewing this topic.

Luke

  • Guest
How do I explode a block using a script?
« on: January 10, 2008, 11:27:22 AM »
I thought I already posted this but had some errors...

Anyhow, how do you insert a drawing using a script and explode it through the script also.  I got the insert part handled but can not figure out how to explode.

The drawing appears empty but actually has my dimension styles embedded in it.


David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4075
Re: How do I explode a block using a script?
« Reply #1 on: January 10, 2008, 11:29:31 AM »
explode;last;
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second.
Sometimes the question is more important than the answer. (Thanks Kerry for reminding me)

Luke

  • Guest
Re: How do I explode a block using a script?
« Reply #2 on: January 10, 2008, 11:37:08 AM »
That's what I thought but try it once.

It's like because the drawing I'm trying to insert as a block is "empty" the command last is not recognized...

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4075
Re: How do I explode a block using a script?
« Reply #3 on: January 10, 2008, 11:44:53 AM »
Maybe place a "point" at 0,0 in your insert so it will explode
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second.
Sometimes the question is more important than the answer. (Thanks Kerry for reminding me)

Luke

  • Guest
Re: How do I explode a block using a script?
« Reply #4 on: January 10, 2008, 11:49:35 AM »
Still doesn't find it

T.Willey

  • Needs a day job
  • Posts: 5251
Re: How do I explode a block using a script?
« Reply #5 on: January 10, 2008, 11:52:37 AM »
To use the 'last' option, the object has to be on the screen.  If it's not, then you can use the lisp function '(entlast)'.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

mjfarrell

  • Seagull
  • Posts: 14444
  • Every Student their own Lesson
Re: How do I explode a block using a script?
« Reply #6 on: January 10, 2008, 11:57:49 AM »
If I recall you need to include and asterisks before the file name and it inserts exploded. use the -insert command in your script.
Be your Best


Michael Farrell
http://primeservicesglobal.com/

Luke

  • Guest
Re: How do I explode a block using a script?
« Reply #7 on: January 10, 2008, 11:59:36 AM »
The script I attached is just a small portion of a whole huge script that is doing a bunch of other things.  These are all aready in place and there are a bunch.  

I pasted the '(entlast)' into the script after I added explode but it doesn't work.  Is there something additional I can do to the script to make it work?

Code: [Select]
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;               THIS CODE INSERTS THE DIMENSION STYLE DRAWING                 ;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-insert
LCC_DIMSTYLES.dwg
0,0,0
1
1
0
explode
'(entlast)'
;..........................................................................FINISHED

ronjonp

  • Needs a day job
  • Posts: 7529
Re: How do I explode a block using a script?
« Reply #8 on: January 10, 2008, 12:01:05 PM »
Try (command "._explode" (entlast))....or MJ's solution.

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

Luke

  • Guest
Re: How do I explode a block using a script?
« Reply #9 on: January 10, 2008, 12:10:43 PM »
If I use the * per mjfarrell  code needs to be...
Code: [Select]
-insert
*LCC_DIMSTYLES.dwg
0,0,0
[color=red]1[/color]
0

If I use the (command "._explode" (entlast)) per ronjonp code needs to be...
Code: [Select]
-insert
LCC_DIMSTYLES.dwg
0,0,0
[color=red]1
1[/color]
0
(command "._explode" (entlast))
 

not quite sure why ACAD changes the prompts with the * input but it works.

Thanks!!  Greatly appreciated!

ronjonp

  • Needs a day job
  • Posts: 7529
Re: How do I explode a block using a script?
« Reply #10 on: January 10, 2008, 12:18:49 PM »
you can also keep everything on the same line like so: -insert LCC_DIMSTYLES.dwg 0,0,0 1 1 0

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

T.Willey

  • Needs a day job
  • Posts: 5251
Re: How do I explode a block using a script?
« Reply #11 on: January 10, 2008, 12:20:37 PM »
Acad acts funny if the block is not scaled the same in all directions.  I assume that is why you only need to enter one scale factor when you know the block is going to be exploded on insert.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4075
Re: How do I explode a block using a script?
« Reply #12 on: January 10, 2008, 12:21:58 PM »
changing the thought process a little, I think I did this a while back, and when Acad asked for insert point, I hit ESC with a (command) to cancel out.  Does this ring a bell?
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second.
Sometimes the question is more important than the answer. (Thanks Kerry for reminding me)

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4075
Re: How do I explode a block using a script?
« Reply #13 on: January 10, 2008, 12:23:12 PM »
I tested from the command line and it works
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second.
Sometimes the question is more important than the answer. (Thanks Kerry for reminding me)

T.Willey

  • Needs a day job
  • Posts: 5251
Re: How do I explode a block using a script?
« Reply #14 on: January 10, 2008, 12:26:25 PM »
changing the thought process a little, I think I did this a while back, and when Acad asked for insert point, I hit ESC with a (command) to cancel out.  Does this ring a bell?
This is a technique to insert the block into the drawings block collection, but not actually insert it into the drawing space.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.