<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Copy Attribute definition default Value to an other Attribute definition default value in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/copy-attribute-definition-default-value-to-an-other-attribute/m-p/13362581#M2204</link>
    <description>&lt;P&gt;Could you share a dwg showing these 2 groups of attribute definitions perhaps one group on right that you want to retrieve the default values to place onto the group on the left?&lt;/P&gt;</description>
    <pubDate>Mon, 10 Mar 2025 17:39:03 GMT</pubDate>
    <dc:creator>paullimapa</dc:creator>
    <dc:date>2025-03-10T17:39:03Z</dc:date>
    <item>
      <title>Copy Attribute definition default Value to an other Attribute definition default value</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/copy-attribute-definition-default-value-to-an-other-attribute/m-p/13361959#M2200</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a Lisp file (attached) that is be able to copy a default value from an attribute definition to an other default value. But because I must change a lot of blocks, I like to have a routine that is be able to do it automaticly for me. I copy into a existing drawing a default block and move the right attributes to the right locations, after that the new tool must make a selection (by Window) from all the extisting attributen definitions, copy the default values and the user must select the second window, so the tool can place all the default values to the right attribute definitions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Old tool (one by one)&lt;/P&gt;&lt;P&gt;(defun c:CopyAttDefDefaultValue ()&lt;BR /&gt;(setq ent1 (car (entsel "Select first Attribute Definition: ")))&lt;BR /&gt;(if (and ent1 (eq (cdr (assoc 0 (entget ent1))) "ATTDEF"))&lt;BR /&gt;(progn&lt;BR /&gt;(setq ent1Data (entget ent1))&lt;BR /&gt;(setq tagName (cdr (assoc 2 ent1Data)))&lt;BR /&gt;(setq defaultVal (cdr (assoc 1 ent1Data)))&lt;BR /&gt;(setq ent2 (car (entsel "Select second Attribute Definition: ")))&lt;BR /&gt;(if (and ent2 (eq (cdr (assoc 0 (entget ent2))) "ATTDEF"))&lt;BR /&gt;(progn&lt;BR /&gt;(setq ent2Data (entget ent2))&lt;BR /&gt;(if (equal tagName (cdr (assoc 2 ent2Data)))&lt;BR /&gt;(progn&lt;BR /&gt;(setq ent2Data (subst (cons 1 defaultVal) (assoc 1 ent2Data) ent2Data))&lt;BR /&gt;(entmod ent2Data)&lt;BR /&gt;(princ "\nDefault Value copied."))&lt;BR /&gt;(princ "\nDe Attribute Definitions has not the same tagname.")))&lt;BR /&gt;(princ "\nNo second Attribute Definition selected.")))&lt;BR /&gt;(princ "\nNo first Attribute Definition selected."))&lt;BR /&gt;(princ))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Mar 2025 11:38:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/copy-attribute-definition-default-value-to-an-other-attribute/m-p/13361959#M2200</guid>
      <dc:creator>Hans_Knol</dc:creator>
      <dc:date>2025-03-10T11:38:25Z</dc:date>
    </item>
    <item>
      <title>Re: Copy Attribute definition default Value to an other Attribute definition default value</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/copy-attribute-definition-default-value-to-an-other-attribute/m-p/13362073#M2201</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/546060"&gt;@Hans_Knol&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;hey,&lt;/P&gt;&lt;P&gt;are these intend to be same name blocks with same tags attributes?&lt;/P&gt;</description>
      <pubDate>Mon, 10 Mar 2025 12:50:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/copy-attribute-definition-default-value-to-an-other-attribute/m-p/13362073#M2201</guid>
      <dc:creator>komondormrex</dc:creator>
      <dc:date>2025-03-10T12:50:50Z</dc:date>
    </item>
    <item>
      <title>Re: Copy Attribute definition default Value to an other Attribute definition default value</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/copy-attribute-definition-default-value-to-an-other-attribute/m-p/13362109#M2202</link>
      <description>Hi, the Attribute definitions in both selections are the same, it just must change add the right default values. I must change a lot of blocks before they will be used, so it are just drawings (exploded blocks)&lt;BR /&gt;I will copy a new standard to the existing and want to update the new with the old info.&lt;BR /&gt;</description>
      <pubDate>Mon, 10 Mar 2025 13:19:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/copy-attribute-definition-default-value-to-an-other-attribute/m-p/13362109#M2202</guid>
      <dc:creator>Hans_Knol</dc:creator>
      <dc:date>2025-03-10T13:19:09Z</dc:date>
    </item>
    <item>
      <title>Re: Copy Attribute definition default Value to an other Attribute definition default value</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/copy-attribute-definition-default-value-to-an-other-attribute/m-p/13362363#M2203</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/546060"&gt;@Hans_Knol&lt;/a&gt;&amp;nbsp; hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;we are talking on attributes definition (ATTDEF) - yes?&lt;/P&gt;&lt;P&gt;i do not understand the logic in doing that, cause if you are talking about existing blocks, how do you plan to populate these new values? with attsync? are you sure it update attribute values?!&lt;/P&gt;&lt;P&gt;only if you insert a new instance of the block the default values will appear.&lt;/P&gt;&lt;P&gt;am i wrong here?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;or you are using ATTDEF instead of MTEXT\TEXT?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Moshe&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Mar 2025 15:42:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/copy-attribute-definition-default-value-to-an-other-attribute/m-p/13362363#M2203</guid>
      <dc:creator>Moshe-A</dc:creator>
      <dc:date>2025-03-10T15:42:11Z</dc:date>
    </item>
    <item>
      <title>Re: Copy Attribute definition default Value to an other Attribute definition default value</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/copy-attribute-definition-default-value-to-an-other-attribute/m-p/13362581#M2204</link>
      <description>&lt;P&gt;Could you share a dwg showing these 2 groups of attribute definitions perhaps one group on right that you want to retrieve the default values to place onto the group on the left?&lt;/P&gt;</description>
      <pubDate>Mon, 10 Mar 2025 17:39:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/copy-attribute-definition-default-value-to-an-other-attribute/m-p/13362581#M2204</guid>
      <dc:creator>paullimapa</dc:creator>
      <dc:date>2025-03-10T17:39:03Z</dc:date>
    </item>
    <item>
      <title>Re: Copy Attribute definition default Value to an other Attribute definition default value</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/copy-attribute-definition-default-value-to-an-other-attribute/m-p/13363122#M2205</link>
      <description>&lt;P&gt;I recently did this pick a block and dcl pops up with the tagnames and a blank value, you fill in what ever values you want and can then apply to all blocks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is one version it updates title blocks in layouts, can be changed to update selected blocks. Replace the foreach with a loop of a selection.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;; https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/is-there-a-gatte-equivalent-for-lt2025/td-p/13344776/page/2

; update a block atts in multiple layouts
; By AlanH March 2025

(defun c:upatts ( / ans atts bent bname lay lst lst2 obj ss x)

(setq obj (vlax-ename-&amp;gt;vla-object (car (entsel "\nPick block object "))))
(setq bname (vlax-get obj 'name))
(setq atts (vlax-invoke obj 'Getattributes))

(setq lst '())
(foreach att atts
  (setq lst (cons (vlax-get att 'Tagstring) lst))
)
(setq lst2 '())
(foreach val lst
  (setq lst2 (cons "" lst2))
  (setq lst2 (cons 20 lst2))
  (setq lst2 (cons 21 lst2))
  (setq lst2 (cons val lst2))
)
(setq lst2 (cons "Please choose " lst2))

(if (not AH:getvalsm)(load "Multi Getvals.lsp"))
(setq ans (AH:getvalsm lst2))

(foreach lay (layoutlist)
(setq ss (ssget "X" (list (cons 0 "INSERT")(cons 2 bname)(cons 410 lay))))
(setq x 0)
(setq bent (vlax-ename-&amp;gt;vla-object (ssname ss 0)))
(setq atts (vlax-invoke bent 'Getattributes))
(repeat (length atts)
  (if (= (nth x ans) "")
  (princ)
  (vlax-put (nth x atts) 'textstring (nth x ans))
  )
  (setq x (1+ x))
)
)

(princ)
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Mar 2025 23:29:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/copy-attribute-definition-default-value-to-an-other-attribute/m-p/13363122#M2205</guid>
      <dc:creator>Sea-Haven</dc:creator>
      <dc:date>2025-03-10T23:29:56Z</dc:date>
    </item>
    <item>
      <title>Re: Copy Attribute definition default Value to an other Attribute definition default value</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/copy-attribute-definition-default-value-to-an-other-attribute/m-p/13364119#M2206</link>
      <description>&lt;P&gt;I must work in a drawing like attached and change the attribute vallues from the old to the new. Hope this helps&lt;/P&gt;</description>
      <pubDate>Tue, 11 Mar 2025 11:21:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/copy-attribute-definition-default-value-to-an-other-attribute/m-p/13364119#M2206</guid>
      <dc:creator>Hans_Knol</dc:creator>
      <dc:date>2025-03-11T11:21:55Z</dc:date>
    </item>
    <item>
      <title>Re: Copy Attribute definition default Value to an other Attribute definition default value</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/copy-attribute-definition-default-value-to-an-other-attribute/m-p/13364127#M2207</link>
      <description>&lt;P&gt;Hi Moshe,&lt;/P&gt;&lt;P&gt;yes we tals about Attribute definitions and I must copy the default values from the old to the new. after we have done this we remove the old ond and set the new insertionpoint and we can use the new block, see attached file&lt;/P&gt;</description>
      <pubDate>Tue, 11 Mar 2025 11:25:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/copy-attribute-definition-default-value-to-an-other-attribute/m-p/13364127#M2207</guid>
      <dc:creator>Hans_Knol</dc:creator>
      <dc:date>2025-03-11T11:25:59Z</dc:date>
    </item>
    <item>
      <title>Re: Copy Attribute definition default Value to an other Attribute definition default value</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/copy-attribute-definition-default-value-to-an-other-attribute/m-p/13364434#M2208</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/546060"&gt;@Hans_Knol&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;check this&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="lisp"&gt;(defun c:cpyattdef (/ ss0 ss1 ename0 ename1 elist0 elist1)

 (if (and
       (not (prompt "\nSelect source attdef..."))
       (setq ss0 (ssget '((0 . "attdef"))))
       (not (prompt "\nSelect target attdef..."))
       (setq ss1 (ssget '((0 . "attdef"))))
     )
  (foreach ename0 (vl-remove-if 'listp (mapcar 'cadr (ssnamex ss0)))
   (setq elist0 (entget ename0)) 
   (foreach ename1 (vl-remove-if 'listp (mapcar 'cadr (ssnamex ss1)))
    (setq elist1 (entget ename1))

    (if (eq (strcase (cdr (assoc '2 elist0))) (strcase (cdr (assoc '2 elist1))))
     (progn
      (if (and (assoc '1 elist0) (assoc '1 elist1))
       (setq elist1 (subst (cons '1 (cdr (assoc '1 elist0))) (assoc '1 elist1) elist1))
      )

      (if (and (assoc '3 elist0) (assoc '3 elist1))
       (setq elist1 (subst (cons '3 (cdr (assoc '3 elist0))) (assoc '3 elist1) elist1)) 
      )

      (entmod elist1)
     ); progn
    ); if
   ); foreach
  ); foreach
 ); if

 (princ)
); c:cpyattdef&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Mar 2025 13:35:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/copy-attribute-definition-default-value-to-an-other-attribute/m-p/13364434#M2208</guid>
      <dc:creator>Moshe-A</dc:creator>
      <dc:date>2025-03-11T13:35:10Z</dc:date>
    </item>
    <item>
      <title>Re: Copy Attribute definition default Value to an other Attribute definition default value</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/copy-attribute-definition-default-value-to-an-other-attribute/m-p/13364552#M2209</link>
      <description>&lt;P&gt;That works fine, thanks Moshe!&lt;/P&gt;</description>
      <pubDate>Tue, 11 Mar 2025 14:24:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/copy-attribute-definition-default-value-to-an-other-attribute/m-p/13364552#M2209</guid>
      <dc:creator>Hans_Knol</dc:creator>
      <dc:date>2025-03-11T14:24:07Z</dc:date>
    </item>
  </channel>
</rss>

