Author Topic: Explode a Hatch  (Read 2921 times)

0 Members and 1 Guest are viewing this topic.

Lupo76

  • Bull Frog
  • Posts: 343
Explode a Hatch
« on: December 04, 2014, 12:02:02 PM »
Hello everyone,
I have always used this function to explode an object and obtain a selection set with nested objects.
Unfortunately today I realized that does not work with entities HATCH.

Can anyone help me?

Code: [Select]
(defun VxExpode (Ent / CurObj CurSet ObjLst)
  (vl-load-com)
  (setq CurSet (ssadd))
  (setq CurObj (vlax-ename->vla-object Ent))
  (setq ObjExp (vla-Explode (vlax-ename->vla-object Ent)))
  (setq ObjLst (vlax-safearray->list (vlax-variant-value ObjExp)))
  (foreach memb ObjLst
    (setq CurSet (ssadd (vlax-vla-object->ename memb) CurSet))
  )
  (entdel ent)
  CurSet
)

roy_043

  • Water Moccasin
  • Posts: 1895
  • BricsCAD 18
Re: Explode a Hatch
« Reply #1 on: December 04, 2014, 01:26:25 PM »
A hatch object doesn't have the explode method. One of the many strange things about VL. But you can just use the explode command. This works on BricsCAD:
Code: [Select]
(command "_.explode" ent) ; No need for Enter if explode is called from a Lisp routine.
(ssget "_P")

alanjt

  • Needs a day job
  • Posts: 5352
  • Standby for witty remark...
Re: Explode a Hatch
« Reply #2 on: December 04, 2014, 08:02:23 PM »
I knew a guy that exploded a hatch once...once.
Civil 3D 2019 ~ Windohz 7 64bit
Dropbox

danallen

  • Guest
Re: Explode a Hatch
« Reply #3 on: December 04, 2014, 08:29:18 PM »
I think he was married to a gal I worked with, who exploded and flattened a 3d model...once.

roy_043

  • Water Moccasin
  • Posts: 1895
  • BricsCAD 18
Re: Explode a Hatch
« Reply #4 on: December 05, 2014, 07:29:13 AM »
When designing ceilings you often start with a hatch pattern to find the ideal (position of the) grid but later explode the hatch because there are too many interruptions in the grid (lighting, air vents etc.). This approach works well. So IMO exploding a hatch can make sense and is not always something to be frowned upon.
« Last Edit: December 05, 2014, 07:41:50 AM by roy_043 »

Lupo76

  • Bull Frog
  • Posts: 343
Re: Explode a Hatch
« Reply #5 on: December 05, 2014, 08:00:13 AM »
A hatch object doesn't have the explode method. One of the many strange things about VL. But you can just use the explode command. This works on BricsCAD:
Code: [Select]
(command "_.explode" ent) ; No need for Enter if explode is called from a Lisp routine.
(ssget "_P")

ok thanks!

irneb

  • Water Moccasin
  • Posts: 1794
  • ACad R9-2016, Revit Arch 6-2016
Re: Explode a Hatch
« Reply #6 on: December 06, 2014, 09:33:16 AM »
When designing ceilings you often start with a hatch pattern to find the ideal (position of the) grid but later explode the hatch because there are too many interruptions in the grid (lighting, air vents etc.). This approach works well. So IMO exploding a hatch can make sense and is not always something to be frowned upon.
Yeah ... I suppose there is some merit in edge cases. At least it's not like exploding dimensions! 

But I still feel the explode command should only be allowed for those who "know what they're doing". I get all nauseated when I remember how many times I've seen someone explode something like a title block and then want to know why they lost all the text and can't edit text normally instead of through that dialog when they double click the attdef's!
Common sense - the curse in disguise. Because if you have it, you have to live with those that don't.