Author Topic: Another Exlode Method Issue  (Read 2965 times)

0 Members and 1 Guest are viewing this topic.

Jeff_M

  • King Gator
  • Posts: 3957
  • C3D user & customizer
Another Exlode Method Issue
« on: January 13, 2006, 04:01:07 PM »
Why is it that Autodesk insists on giving us things that don't work as expected? I have a client that wants to reduce his drawings into nothing but lines/arcs/text on Layer 0. I have a routine that does this quite nicely until today he sent a problem drawing. It has some arrows in it that are simply a block with about 8 lines in it, no problem.....except it was created as a drawing with the objects drawn away from the drawing's origin (3.0,4.0) then the INSBASE was set to the tip of the arrow.

Explode works correctly on this block. The ActiveX Explode method does not, it explodes it but the resulting entities are displaced. I thought that moving them by using the vector of the block's origin to 0,0 would fix this....no such luck.

Any ideas on how to work around this?

On another note, I do know that blocks created like this will also not work correctly when trying to Trim/Extend to items within that inserted block.

T.Willey

  • Needs a day job
  • Posts: 5218
Re: Another Exlode Method Issue
« Reply #1 on: January 13, 2006, 04:09:52 PM »
Can you get the insertion point relative to the bounding box method, and then if after you explode it, the group of objects that are created do not have the same relation, move them so they do?

Just an idea.
Tim

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

Please think about donating if this post helped you.

Jeff_M

  • King Gator
  • Posts: 3957
  • C3D user & customizer
Re: Another Exlode Method Issue
« Reply #2 on: January 13, 2006, 04:43:07 PM »
Well, as a temporary work around I am checking each BlockDefinition's Origin value. If it is not at 0,0 I move all of the objects in the block relative to 0,0 and reset the origin to 0,0. This seems to work for now.
« Last Edit: January 13, 2006, 04:49:46 PM by Jeff_M »

T.Willey

  • Needs a day job
  • Posts: 5218
Re: Another Exlode Method Issue
« Reply #3 on: January 13, 2006, 05:00:40 PM »
Well, as a temporary work around I am checking each BlockDefinition's Origin value. If it is not at 0,0 I move all of the objects in the block relative to 0,0 and reset the origin to 0,0. This seems to work for now.
I'm glad that works for you.  When I tried the same thing with lisp, it didn't get the right point.
Tim

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

Please think about donating if this post helped you.

Jeff_M

  • King Gator
  • Posts: 3957
  • C3D user & customizer
Re: Another Exlode Method Issue
« Reply #4 on: January 13, 2006, 05:20:40 PM »
Tim, here is a lisp derivative of what I used. Would you mind testing it with your test drawing?
Code: [Select]
;;resets a block's insertion (origin) point to 0,0,0
;;supply a vla-object for the block definition
(defun blk2zero (blk)
  (setq origin (vlax-get blk 'origin))
  (if (not (and (zerop (car origin))
(zerop (cadr origin))
(zerop (caddr origin))))
    (progn
      (vlax-for ent blk
(vlax-invoke ent 'move origin '(0.0 0.0 0.0))
)
      (vlax-put blk 'origin '(0.0 0.0 0.0))
      )
    )
  )
;;;;Test routine for above, select a block that you know has a FUBAR'ed origin
(defun c:test0 (/ ent)
  (if (and (setq ent (car (entsel)))
   (= "INSERT" (cdr (assoc 0 (entget ent))))
   )
    (progn
      (blk2zero (vla-item
  (vla-get-blocks
    (vla-get-activedocument
      (vlax-get-acad-object)
      )
    )
  (vla-get-name (vlax-ename->vla-object ent))
  ))
      )
    )
  (princ)
  )

T.Willey

  • Needs a day job
  • Posts: 5218
Re: Another Exlode Method Issue
« Reply #5 on: January 13, 2006, 07:43:20 PM »
Sorry Jeff.  Didn't get a chance to test it today, real work came up.  I will test it on Monday, as I don't have cad at home.  Have a great weekend.
Tim

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

Please think about donating if this post helped you.

fxcastil

  • Guest
Re: Another Exlode Method Issue
« Reply #6 on: January 14, 2006, 04:22:22 PM »
Jeff,

Out of curiosity why would someone want to explode all the blocks in drawing and put everthing on layer 0.

It is funny to me because I allways here complaints about blocks being exploded and objects not being drawn on the proper layers.
I get requests to automate the process to NOT allow blocks to be exploded and check objects for proper layers.

Fred C

Jeff_M

  • King Gator
  • Posts: 3957
  • C3D user & customizer
Re: Another Exlode Method Issue
« Reply #7 on: January 14, 2006, 04:49:44 PM »
Fred, I agree that this was an odd request. But this client evidently has had this arrangement with one of their clients for many years. An electronic copy of a drawing that looks EXACTLY like the plotted hard copy is provided. I don't know what is used to view the drawing, but they are rather insistent on NO blocks/dimensions/mtext/hatching/plines/layers, etc. All attributes are converted to Text.

Perhaps this is to discourage the editing of the file? I know I wouldn't want to work on one of these.....

I do know that they didn't even hesitate when I told them my fee for writing this. My contact there has just recently told me that he would spend 4-5 hours a day doing nothing but converting these files, but now spends less than half an hour a day....now I know why they weren't too concerned about my fee.

T.Willey

  • Needs a day job
  • Posts: 5218
Re: Another Exlode Method Issue
« Reply #8 on: January 16, 2006, 05:19:31 PM »
I can't seem to get a block now to have an origin different than (0 0 0).  I have made a block with a different insertion point than (0 0 0), and it reports that the origin is (0 0 0).  I have tried to make a nested block, and it returned the same values.  I then made that drawing a block, where I changed the InsBase system variable, and that didn't work.

I have run out of ideas.  I can't test your routine because I can't create a block whose origin is different than (0 0 0).  Maybe that was my problem before.  I was trying to get points based on the "real" insertion point, and I couldn't get it.  It would always return (0 0 0).

If this comes up again, I will post to let you know.

Guess I wasn't as much help as I hoped to be. :cry:
Tim

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

Please think about donating if this post helped you.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Another Exlode Method Issue
« Reply #9 on: January 16, 2006, 05:29:45 PM »
FWIW,
I have worked contract on several projects where the Spec' requirement is to Explode Blocks, Mtext, any objects with in-built intelligence, regions, etc etc etc and incorporate "unusual" requirements regarding layering.

We just generated the Project docs "our" way, and ran a conversion <similar to Jeff's> on the released documents.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

--> Donate to theSwamp<--

Jeff_M

  • King Gator
  • Posts: 3957
  • C3D user & customizer
Re: Another Exlode Method Issue
« Reply #10 on: January 16, 2006, 05:45:21 PM »
Hi Tim, Thanks for trying. I just went and tried to create one of these blocks and couldn't either. I think that these blocks are all old ones were created in a much older version. I know a bunch that a co-worker created for our office are like this, and they were created in version 9 or 10....our standard symbols don't change much :-)

Joe Burke

  • Guest
Re: Another Exlode Method Issue
« Reply #11 on: January 26, 2006, 11:19:01 AM »
Hi Tim, Thanks for trying. I just went and tried to create one of these blocks and couldn't either. I think that these blocks are all old ones were created in a much older version. I know a bunch that a co-worker created for our office are like this, and they were created in version 9 or 10....our standard symbols don't change much :-)

Jeff,

I mentioned this to Tim recently in private mail related to a separate issue. AFAIK the only way a block definition origin can be anything other than (0 0 0) is by code modification.

Example: there was a topic in the Autodesk customization NG back around 10/15/2004 which posed this question. How to modify a block's insertion point without affecting the position of existing block references. James Allen posted a solution called "rcb2", based party on some of my thoughts.

Anyway, the net result was James' code modified the block def origin to accomplish the task. I wondered at the time what implications that might have.

CmdrDuh

  • Automatic Duh Generator
  • King Gator
  • Posts: 4039
Re: Another Exlode Method Issue
« Reply #12 on: August 14, 2008, 04:58:18 PM »
what about insbase?
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

CmdrDuh

  • Automatic Duh Generator
  • King Gator
  • Posts: 4039
Re: Another Exlode Method Issue
« Reply #13 on: August 14, 2008, 04:58:46 PM »
how are you guys automating the mtext 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

Jeff_M

  • King Gator
  • Posts: 3957
  • C3D user & customizer
Re: Another Exlode Method Issue
« Reply #14 on: August 14, 2008, 05:49:12 PM »
Nothing like digging up the past, huh Duh?

MTEXT exploding is no fun....I resorted to using the EXPLODE command in a lisp front end....