substitute 41, 42 & 43 of a block

Discussion in 'AutoCAD' started by mnash, Mar 15, 2005.

  1. mnash

    mnash Guest

    I have a pre-defined block name, say (2 . "text-01")
    now, I want to change the value of 41, 42 & 43 to a scale factor that has been defined earlier, i.e. SF. How do i substitute the 41 variable from the original to the new in the block text-01"
    thanks
    MN
     
    mnash, Mar 15, 2005
    #1
  2. Read up on the "entmod" lisp function. The AutoLisp Reference entry shows
    how to use it, including the use of other functions generally used in
    conjunction with it. Also check out "entupd" for updating the appearance of
    the changed block on-screen.
     
    Kent Cooper, AIA, Mar 15, 2005
    #2
  3. mnash

    BillZ Guest

    Something like this:

    (setq ent (car (entsel))) ;select block
    (setq nens (entget ent)) ;get entity list
    (setq nens (subst (cons 41 2.0)(assoc 41 nens) nens))
    (setq nens (subst (cons 42 2.0)(assoc 42 nens) nens))
    (setq nens (subst (cons 43 2.0)(assoc 43 nens) nens))
    (entmod nens)

    Or in VL:
    (setq entobj (vlax-ename->vla-object ent))
    (vla-put-xscalefactor entobj 2.0)
    (vla-put-yscalefactor entobj 2.0)
    (vla-put-zscalefactor entobj 2.0)




    Bill
     
    BillZ, Mar 15, 2005
    #3
  4. mnash

    wkiernan Guest

    Note that this will scale the INSERT itself but it will not scale any ATTRIBs attached to it.
     
    wkiernan, Mar 17, 2005
    #4
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.