Get native entities of lwpolyline

Discussion in 'AutoCAD' started by Paul de Boer, Oct 4, 2004.

  1. Paul de Boer

    Paul de Boer Guest

    Hi all, is it possible to explode a polyline and add each native entitie in a selection set.

    Many thanks
    P. de Boer
     
    Paul de Boer, Oct 4, 2004
    #1
  2. Paul de Boer

    Joe Burke Guest

    Paul,

    Exploding a pline or block puts the new objects in the previous selection set.

    If you just want a new selection containing those objects:
    (setq ss (ssget "P"))

    If you have an existing selection set (exss) and you want to add the new objects to
    it:
    (setq ss (ssget "P"))
    (setq idx 0)
    (repeat (sslength ss)
    (ssadd (ssname ss idx) exss)
    (setq idx (1+ idx))
    )

    Joe Burke
     
    Joe Burke, Oct 4, 2004
    #2
  3. Paul de Boer

    Jürg Menzi Guest

    Hi Paul

    This should it do:
    Code:
    ;
    ; -- Function MeExplode
    ; Explodes complex objects.
    ; Copyright:
    ;   ©2001 MENZI ENGINEERING GmbH, Switzerland
    ; Arguments [Typ]:
    ;   Obj = Complex object [VLA-OBJECT]
    ;   Del = True, delete base object
    ;         False, keep base object
    ; Return [Typ]:
    ;   > Selection set [PICKSET]
    ; Notes:
    ;   - Because of a (reported) bug in A2k4/A2k5, the used explode methode will
    ;     fail on NUS blocks. No limitations in A2k, A2ki and A2k2
    ;
    (defun MeExplode (Obj Del / CurSet ExpMde)
    (setq ExpMde (getvar "EXPLMODE")
    CurSet (ssadd)
    )
    (setvar "EXPLMODE" 1)
    (foreach memb (vlax-invoke Obj 'Explode)
    (ssadd (vlax-vla-object->ename memb) CurSet)
    )
    (if Del (vla-delete Obj))
    (setvar "EXPLMODE" ExpMde)
    CurSet
    )
    
    Use:
    (setq ss (MeExplode (vlax-ename->vla-object (car (entsel))) T))

    Don't forget to initialize ActiveX support by (vl-load-com).

    Cheers
     
    Jürg Menzi, Oct 4, 2004
    #3
  4. Paul de Boer

    Paul de Boer Guest

    Jürg,
    Thanks for the reply, i must say, i haven't much experience in the visual aspect, but i work my way true it. By the way I saw your web site couple of weeks ago, impressive site, lots of code.

    P. de Boer
     
    Paul de Boer, Oct 4, 2004
    #4
  5. Paul de Boer

    Paul de Boer Guest

    Joe, thanks for the reply, looks straight forward.

    P. de Boer
     
    Paul de Boer, Oct 4, 2004
    #5
  6. Paul de Boer

    Jürg Menzi Guest

    You are welcome...¦-)

    Cheers
     
    Jürg Menzi, Oct 4, 2004
    #6
  7. Paul de Boer

    Paul de Boer Guest

    Jürg, question about your code what does EXPLMODE do. The AutoCad help is talking about NUS blocks why setting it and what does it do???

    P. de Boer
     
    Paul de Boer, Oct 4, 2004
    #7
  8. Paul de Boer

    Jürg Menzi Guest

    Hi Paul

    EXPLMODE set to 1 allows to explode NonUniformScaled Blocks. Doesn't work
    anymore in A2k4/A2k5 (see note).

    Cheers
     
    Jürg Menzi, Oct 4, 2004
    #8
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.