Change attribute insertpoint values

Discussion in 'AutoCAD' started by simon.weel, Nov 1, 2004.

  1. simon.weel

    simon.weel Guest

    Hi,

    We have trouble with blocks containing attributes. If you use ATTREDEF to redefine a block with attributes, the attributes in mirrored blocks become mirrored as well. Not what we want, ofcourse. So I checked out this forum and found a routine that changes the rotation angle of attributes to zero. Great!

    Now I want to adjust this routine to 'un-mirror' attributes. I found out that attributes in a mirrored block have a negative insertionpoint-value. Make it positive and the attribute is displayed as it should.

    But I just cannot find out how to change the LISP routine to do the trick. The original LISP routine is displayed below. Groupcode 50 is the rotationangle of an attribute. Groupcode 10 is the insertionpoint of an attribute.

    The problem is, this groupcode has three values defining the insertionpoint (x, y, z), so just changeing 50 to 10 won't work. It's probably very simple to change the code, but I just don't know what to do.... Can anyone point me in the right direction?

    Btw, we use AutoCAD 2000i

    Greetings,

    Simon Weel

    (defun C:ATTLVL ( /); att)
    (while (and (= (type (setq att (car (nentsel "\nPick attribute: ")))) 'ENAME)
    (= (cdadr (setq att (entget att))) "ATTRIB"))

    (entupd (cdar (entmod (subst '(50 . 0.0) (assoc 50 att) att))))
    )
    (princ)
    )

    (princ)
     
    simon.weel, Nov 1, 2004
    #1
  2. I not sure your in the right direction. I believe it to be coincidence that
    you had negative insertion values on your mirrored blocks. Insertion is
    insertion. Now....unless the block is replaced in the drawing and attribute
    values extracted to a list and repopulated into the new block at the same
    insertion point, I do not believe there is a dxf code that will tell you the
    history of a blocks mirroring. I am open to be corrected though.

    But, If your talking about the attributes of a block , and possibly they are
    backwards or upsidedown because the mirrtext variable was set to 1 - you
    could essentially change the value of "backwards" or "upsidedown" for that
    attribute. Somebody could probably step in here, and point that attribute
    out. It has something to do with vlax-false / vlax-true...but I don't know
    how to assign these to the attributes, only view.
    You could try vla-get-attributes, then use the watch to drill down and find
    your setting.

    I know,...not much help without real code......

    Ricky M. Medley
    Houston

    redefine a block with attributes, the attributes in mirrored blocks become
    mirrored as well. Not what we want, ofcourse. So I checked out this forum
    and found a routine that changes the rotation angle of attributes to zero.
    Great!
    that attributes in a mirrored block have a negative insertionpoint-value.
    Make it positive and the attribute is displayed as it should.
    The original LISP routine is displayed below. Groupcode 50 is the
    rotationangle of an attribute. Groupcode 10 is the insertionpoint of an
    attribute.
    insertionpoint (x, y, z), so just changeing 50 to 10 won't work. It's
    probably very simple to change the code, but I just don't know what to
    do.... Can anyone point me in the right direction?
     
    Ricky M. Medley, Nov 2, 2004
    #2
  3. simon.weel

    James Allen Guest

    Hi Simon,

    Have you already checked the 210 group code? You may find that adjusting
    this group code gives you the result you are looking for.
    --
    James Allen, EIT
    Malicoat-Winslow Engineers, P.C.
    Columbia, MO

    redefine a block with attributes, the attributes in mirrored blocks become
    mirrored as well. Not what we want, ofcourse. So I checked out this forum
    and found a routine that changes the rotation angle of attributes to zero.
    Great!
    that attributes in a mirrored block have a negative insertionpoint-value.
    Make it positive and the attribute is displayed as it should.
    The original LISP routine is displayed below. Groupcode 50 is the
    rotationangle of an attribute. Groupcode 10 is the insertionpoint of an
    attribute.
    insertionpoint (x, y, z), so just changeing 50 to 10 won't work. It's
    probably very simple to change the code, but I just don't know what to
    do.... Can anyone point me in the right direction?
     
    James Allen, Nov 2, 2004
    #3
  4. simon.weel

    simon.weel Guest

    Ah, groupcode 210 also does the trick. But... I still don't know how to get the routine working? Code 210 has three values as well. In case of a mirrored attribute, the last value is negative.

    But I just can't figure out how to change the last value of groupcode 210; I get lost in all the CAR, CDR's etc. If I try something like this, I get an error:

    (entupd (cdar (entmod (subst (cons 210 "0.0" "0.0" "1.0") (assoc 210 att) att))))

    This is probably easy to solve, but I'm not a programmer; my knowledge of LISP is simply too limited....

    Greetings,

    Simon
     
    simon.weel, Nov 2, 2004
    #4
  5. simon.weel

    James Allen Guest

    Remove the quotes and I think you've got it. :)

    James

    get the routine working? Code 210 has three values as well. In case of a
    mirrored attribute, the last value is negative.
    I get lost in all the CAR, CDR's etc. If I try something like this, I get an
    error:
     
    James Allen, Nov 2, 2004
    #5
  6. simon.weel

    simon.weel Guest

    It thought it would be simple, but not THAT simple ;)

    Anyway, it works - but not the way I want. Weird things happen when fiddling the extrusion direction.

    If you modify the z-coordinate from negative to positive, the attribute displays as normal, but on a different place. It's mirrored on the y-axis of the insertionpoint where the block was created?

    Don't know how to solve this one....

    Greetings,

    Simon
     
    simon.weel, Nov 3, 2004
    #6
  7. simon.weel

    James Allen Guest

    Hmmm, okay. Did you already try the 71 group code? If that doesn't do what
    you want, maybe you should post a drawing with one of your blocks that needs
    fixed and we can be more helpful. There are a number of ways that text can
    appear mirrored, and the way to fix it might depend on how it is "mirrored".
    --
    James Allen, EIT
    Malicoat-Winslow Engineers, P.C.
    Columbia, MO


    fiddling the extrusion direction.
    displays as normal, but on a different place. It's mirrored on the y-axis of
    the insertionpoint where the block was created?
     
    James Allen, Nov 3, 2004
    #7
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.