What I am doing wrong?

Discussion in 'AutoCAD' started by A Diaz, Jul 1, 2004.

  1. A Diaz

    A Diaz Guest

    Hello All,

    I have to translate 300 dwgs from AutoCAD to Microstation using DGNLink. I
    am having problems with the MTEXT. I'll explode all the MTEXT to Single Line
    Text and I want to use something like this to speed up the process. What I
    am missing? Any help will be appreciated.

    (defun MTX ( / sset num itm hnd ent lay)
    (setq sset (ssget "X" '((0 . "MTEXT"))))
    (if sset
    (progn
    (setq num (sslength sset)
    itm 0
    )
    (while (< itm num)
    (setq hnd (ssname sset itm))
    (setq ent (entget hnd))
    (setq lay (cdr (assoc 8 ent)))
    (setvar "clayer" lay)
    (command "_.explode" hnd)
    (setq itm (1+ itm))
    )
    )
    )
    (princ)
    )
     
    A Diaz, Jul 1, 2004
    #1
  2. A Diaz

    Jim Claypool Guest

    This works for me in 2004
     
    Jim Claypool, Jul 1, 2004
    #2
  3. A Diaz

    ECCAD Guest

    Just a wild guess, perhaps a:
    (command "_regen")
    near end..

    Bob
     
    ECCAD, Jul 1, 2004
    #3
  4. A Diaz

    A Diaz Guest

    I am using Acad 2000i and it do not explode my MTEXTs.
     
    A Diaz, Jul 1, 2004
    #4
  5. A Diaz

    A Diaz Guest

    It worked but only explode the mtext on current space. How to explode all
    the MTEXT no matter what space it is on?

    TIA
     
    A Diaz, Jul 1, 2004
    #5
  6. A Diaz

    A Diaz Guest

    Rudy,

    Is not that what I am doing?.


     
    A Diaz, Jul 1, 2004
    #6
  7. A Diaz

    Rudy Tovar Guest

    Rudy Tovar, Jul 1, 2004
    #7
  8. A Diaz

    ECCAD Guest

    It should grab ALL the Mtext ..unless it is associated with a ' QLeader' - is that the case ?

    Bob
     
    ECCAD, Jul 1, 2004
    #8
  9. A Diaz

    A Diaz Guest

    ECCAD,

    No, that is not the case. I don't have any MTEXT associated to Qleaders.
     
    A Diaz, Jul 1, 2004
    #9
  10. A Diaz

    A Diaz Guest

    If I run the code in PS and my MTEXT is on MS I got this mesage:

    Command: mtx
    _.explode
    Select object:
    The object is not in current space.

    None found.
    Select object: _.explode

    *Invalid selection*
    Expects a point or Last/ALL/Group
    ; error: Function cancelled

    Select object:

    Uhmm.
     
    A Diaz, Jul 1, 2004
    #10
  11. A Diaz

    ECCAD Guest

    If you switch to MS, then run, does it get all the Mtext ?
    Bob
     
    ECCAD, Jul 1, 2004
    #11
  12. A Diaz

    T.Willey Guest

    I think your going to have to set it up so that it only grabs the mtext entitys in the space you are in (ie model, paper) then run your lisp. Then change space and run again. You can't explode things that are not in your current space.

    Tim
     
    T.Willey, Jul 1, 2004
    #12
  13. A Diaz

    T.Willey Guest

    (defun MTX ( / sset num itm hnd ent lay)
    (setq sset (ssget "X" (list (cons 410 (getvar "ctab")) '(0 . "MTEXT"))))
    (if sset
    (progn
    (setq num (sslength sset)
    itm 0
    )
    (while (< itm num)
    (setq hnd (ssname sset itm))
    (setq ent (entget hnd))
    (setq lay (cdr (assoc 8 ent)))
    (setvar "clayer" lay)
    (command "_.explode" hnd)
    (setq itm (1+ itm))
    )
    )
    )
    (princ)
    )

    (defun MTextX(/ ct1)

    (setq ct1 (getvar "ctab"))
    (setvar "tilemode" 1)
    (mtx)
    (foreach Item (layoutlist)
    (setvar "ctab" Item)
    (mtx)
    )
    (setvar "ctab" ct1)
    (princ)
    )

    Try this. It's a quick little dirty one, but it worked when tested.

    Tim
     
    T.Willey, Jul 1, 2004
    #13
  14. Try:

    (defun MTX ( / sset)
    (if (setq sset (ssget "X" '((0 . "MTEXT"))))
    (progn
    (setvar "QAFLAGS" 1)
    (command "_.explode" sset "")
    (setvar "QAFLAGS" 0)
    )
    )
    (princ)
    )
     
    Marc'Antonio Alessi, Jul 2, 2004
    #14
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.