Results 1 to 4 of 4

Thread: Changing 'Z' coordinate for a MULTILEADER via Entity Association List

  1. #1
    Active Member
    Join Date
    2012-06
    Posts
    59

    Exclamation Changing 'Z' coordinate for a MULTILEADER via Entity Association List

    Hello All,

    I would appreciate help in the following scenario:
    My goal is to move all MULTILEADERS in my modelspace to an elevation of 1000'-0" Sure I could use move command but in my drawing I have lots of mleaders that are in various z elevations.
    Below you will find an association list for a MULTILEADER. I understand that sublist (10 .... is responsible for location and origin of a multileader.
    I can access first sublist (10 -487.755 -62.1661 0.0) using ASSOC function but how do I access the second and third pair of (10 ...)

    ((-1 . <Entity name: 7ffff6aa470>) (0 . "MULTILEADER") (330 . <Entity name:
    7ffff6ad9f0>) (5 . "3D89F") (100 . "AcDbEntity") (67 . 0) (410 . "Model") (8 .
    "0") (100 . "AcDbMLeader") (270 . 2) (300 . "CONTEXT_DATA{") (40 . 1.0) (10
    -487.755 -62.1661 0.0) (41 . 3.75) (140 . 3.75) (145 . 2.375) (174 . 1) (175 .
    1) (176 . 2) (177 . 0) (290 . 1) (304 . "Move to 1000 feet") (11 0.0
    0.0 1.0) (340 . <Entity name: 7ffff663f50>) (12 -407.166 -60.2911 0.0) (13 1.0
    0.0 0.0) (42 . 0.0) (43 . 0.0) (44 . 0.0) (45 . 1.0) (170 . 1) (90 .
    -1073741824) (171 . 3) (172 . 5) (91 . -1073741824) (141 . 0.0) (92 . 0) (291 .
    0) (292 . 0) (173 . 0) (293 . 0) (142 . 0.0) (143 . 0.0) (294 . 0) (295 . 0)
    (296 . 0) (110 -384.848 -89.894 0.0) (111 1.0 0.0 0.0) (112 0.0 1.0 0.0) (297 .
    0) (302 . "LEADER{") (290 . 1) (291 . 1) (10 -401.666 -62.1661 0.0) (11 -1.0
    0.0 0.0) (90 . 0) (40 . 3.125) (304 . "LEADER_LINE{") (10 -384.848 -89.894 0.0)
    (91 . 0) (170 . 1) (92 . -1056964608) (340 . <Entity name: 0>) (171 . -2) (40 .
    0.0) (341 . <Entity name: 0>) (93 . 0) (305 . "}") (271 . 0) (303 . "}") (272 .
    9) (273 . 9) (301 . "}") (340 . <Entity name: 7ffff663f70>) (90 . 279552) (170
    . 1) (91 . -1073741824) (341 . <Entity name: 7ffff6ad950>) (171 . -1) (290 . 1)
    (291 . 1) (41 . 3.125) (42 . 3.75) (172 . 2) (343 . <Entity name: 7ffff663f50>)
    (173 . 1) (95 . 1) (174 . 2) (175 . 2) (92 . -1073741824) (292 . 0) (93 .
    -1056964608) (10 1.0 1.0 1.0) (43 . 0.0) (176 . 0) (293 . 0) (294 . 0) (178 .
    0) (179 . 3) (45 . 1.0) (271 . 0) (272 . 9) (273 . 9))

    Lastly if I use SSGET to select a lot of multileaders and I get a selection set how do I change 'z' elevation for ALL multileaders selected?

    Your help is GREATLY APPRECIATED

  2. #2
    Administrator Opie's Avatar
    Join Date
    2002-01
    Location
    jUSt Here (a lot)
    Posts
    6,854

    Default Re: Changing 'Z' coordinate for a MULTILEADER via Entity Association List

    Have you tried the change command?
    If you have a technical question, please find the appropriate forum and ask it there.
    You will get a quicker response from your fellow AUGI members than if you sent it to me via a PM or email.
    jUSt

  3. #3
    I could stop if I wanted to marko_ribar's Avatar
    Join Date
    2004-06
    Location
    Belgrade, Serbia, Europe
    Posts
    414

    Default Re: Changing 'Z' coordinate for a MULTILEADER via Entity Association List

    I think OP is right ab. this case (MLEADERS) don't have property - elevation... So I combined old hofcad's chnthdxf sub-function with my main function and it worked (I've renamed ChNthDxf to ChNDxf) as it takes Nth+1 index number as start number in function...

    Code:
    (defun assocN (code n lst)
      (if (/= lst nil)
        (progn
          (repeat (- n 1)
            (setq lst (cdr (member (assoc code lst) lst)))
          )
        )
        (princ "\nEntity data list (DXF list) not specified")
      )
      (if lst (assoc code lst))
    )
    
    (defun ChNDxf (e n code value / ed newDxf i oldDxfv k)
      (setq ed (entget e))
      (setq newDxf '())
      (setq oldDxfv '())
      (setq i 0)
      (foreach v ed
        (if (= (car v) code)
          (progn
            (setq i (+ i 1))
            (if (= i n)
              (progn
                (if (= value nil)
                  (setq oldDxfv (cons v oldDxfv))
                  (progn
                    (setq newDxf (cons (cons code value) newDxf))
                    (setq oldDxfv (cons v oldDxfv))
                  )
                )
              )
              (setq newDxf (cons v newDxf))
            )
          )
          (setq newDxf (cons v newDxf))
        )
      )
      (foreach v ed
        (if (= (car v) code)
          (progn
            (setq k (+ i 1))
            (if (= k n)
              (setq newDxf (cons (cons code value) newDxf))
            )
          )
        )
      )
      (if (not (assoc code ed))
        (setq newDxf (cons (cons code value) newDxf))
      )
    
      (entmod (reverse newDxf))
      (entupd e)
    )
    
    ;http://www.autodesk.com/techpubs/autocad/acad2000/dxf/group_codes_in_numerical_order_dxf_01.htm
    
    (defun c:mleader2elev ( / ss elev n ent )
      (prompt "\nSelect mleaders you want to change elevations to be equal")
      (while (not ss)
        (setq ss (ssget ":L" '((0 . "MULTILEADER"))))
      )
      (initget 1)
      (setq elev (getreal "\nEnter new elevation for all mleaders you've selected : "))
      (repeat (setq n (sslength ss))
        (setq ent (ssname ss (setq n (1- n))))
        (chndxf ent 1 10 (list (car (cdr (assocn 10 1 (entget ent)))) (cadr (cdr (assocn 10 1 (entget ent)))) elev))
        (chndxf ent 1 12 (list (car (cdr (assocn 12 1 (entget ent)))) (cadr (cdr (assocn 12 1 (entget ent)))) elev))
        (chndxf ent 1 110 (list (car (cdr (assocn 110 1 (entget ent)))) (cadr (cdr (assocn 110 1 (entget ent)))) elev))
        (chndxf ent 2 10 (list (car (cdr (assocn 10 2 (entget ent)))) (cadr (cdr (assocn 10 2 (entget ent)))) elev))
        (chndxf ent 3 10 (list (car (cdr (assocn 10 3 (entget ent)))) (cadr (cdr (assocn 10 3 (entget ent)))) elev))
      )
      (princ)
    )
    Regards, M.R.
    Last edited by marko_ribar; 2012-07-07 at 02:47 PM. Reason: added assocn non-command function
    Marko Ribar, d.i.a. (graduated engineer of architecture)

    M.R. on Youtube


  4. #4
    Active Member
    Join Date
    2012-06
    Posts
    59

    Default Re: Changing 'Z' coordinate for a MULTILEADER via Entity Association List

    When I try to use the CHANGE command I get this note from AutoCAD:

    Cannot change elevation of MULTILEADER.

    PS Keep in mind my MULTILEADERS on my drawing are located at different elevations, so I guess anything global without getting into object entity would not work.
    Last edited by vladimir.karatsupa982899; 2012-06-29 at 03:19 PM.

Similar Threads

  1. changing multileader style
    By peter.sedlacek in forum AutoCAD Annotation
    Replies: 5
    Last Post: 2012-02-06, 12:58 PM
  2. Changing mtext with grips in annotative multileader style
    By gadjet in forum AutoCAD Annotation
    Replies: 6
    Last Post: 2010-11-17, 01:46 PM
  3. Moving multileader when changing scale.
    By jonathan.a.pitt in forum AutoCAD Annotation
    Replies: 5
    Last Post: 2010-06-04, 01:47 PM
  4. Changing Coordinate Display in 2006 ..
    By Rico in forum AutoCAD General
    Replies: 12
    Last Post: 2006-06-28, 12:53 PM
  5. Changing dimension association on existing Dimensions
    By rmoore in forum AutoCAD General
    Replies: 3
    Last Post: 2004-10-11, 12:35 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •