<?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: Lisp Routine to change Blocks Line Type in AutoCAD Forum</title>
    <link>https://forums.autodesk.com/t5/autocad-forum/lisp-routine-to-change-blocks-line-type/m-p/10245844#M79802</link>
    <description>&lt;P&gt;You can also try &lt;A href="https://sites.google.com/site/cadkits/home/chz20" target="_self"&gt;CHZ20&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;It can change the block subentities' linetype to ByLayer or ByBlock, also change the Linetype Scale etc.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 351px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/907961i2520E9480D410E36/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 16 Apr 2021 22:34:17 GMT</pubDate>
    <dc:creator>3wood</dc:creator>
    <dc:date>2021-04-16T22:34:17Z</dc:date>
    <item>
      <title>Lisp Routine to change Blocks Line Type</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/lisp-routine-to-change-blocks-line-type/m-p/10245326#M79801</link>
      <description>&lt;P&gt;Hi Everyone, i recently found online (i guess) the most useful LISP Routine ever.&lt;/P&gt;&lt;P&gt;This one allows to change the color of selected blocks to a specific color from &lt;U&gt;1 to 255&lt;/U&gt; &lt;STRONG&gt;or&lt;/STRONG&gt; &lt;U&gt;ByLayer&lt;/U&gt; &lt;STRONG&gt;or&lt;/STRONG&gt; &lt;U&gt;ByBlock&lt;/U&gt;, for all objects inside the block regardless of weather it is a static or dynamic block.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(I have attached it to this post)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;All i want to ask is this:&lt;/P&gt;&lt;P&gt;as i don't know how to write these LISP routines myself, can anyone help me modify this attached LISP so it does a very similar job with &lt;EM&gt;&lt;U&gt;line type&lt;/U&gt;&lt;/EM&gt; instead?&lt;BR /&gt;what i need it to do is:&lt;BR /&gt;- changing the line type to a specific one i chose &lt;STRONG&gt;or&lt;/STRONG&gt; ByLayer &lt;STRONG&gt;or&lt;/STRONG&gt;&amp;nbsp;ByBlock&lt;BR /&gt;- change the scale of the new line type&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;one cool thing that would make it very good is if it can get the &lt;U&gt;line type and scale&lt;/U&gt; data&amp;nbsp;from a selected object and apply it to one or more selected blocks.&lt;/P&gt;</description>
      <pubDate>Fri, 16 Apr 2021 18:56:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/lisp-routine-to-change-blocks-line-type/m-p/10245326#M79801</guid>
      <dc:creator>Irreb</dc:creator>
      <dc:date>2021-04-16T18:56:29Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp Routine to change Blocks Line Type</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/lisp-routine-to-change-blocks-line-type/m-p/10245844#M79802</link>
      <description>&lt;P&gt;You can also try &lt;A href="https://sites.google.com/site/cadkits/home/chz20" target="_self"&gt;CHZ20&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;It can change the block subentities' linetype to ByLayer or ByBlock, also change the Linetype Scale etc.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 351px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/907961i2520E9480D410E36/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Apr 2021 22:34:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/lisp-routine-to-change-blocks-line-type/m-p/10245844#M79802</guid>
      <dc:creator>3wood</dc:creator>
      <dc:date>2021-04-16T22:34:17Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp Routine to change Blocks Line Type</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/lisp-routine-to-change-blocks-line-type/m-p/10245885#M79803</link>
      <description>&lt;P&gt;Thanks for the software.&lt;BR /&gt;Although the software is free it appears it need a "free" subscription for one year, after which you have to subscribe to something else etc etc.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="francesco0berri_0-1618614297063.png" style="width: 454px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/907964iCFE624BFEED97350/image-dimensions/454x738?v=v2" width="454" height="738" role="button" title="francesco0berri_0-1618614297063.png" alt="francesco0berri_0-1618614297063.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I trust you that this program works, though i much prefer something from the community and free and that can be modified easily if necessary (just like the lisp routine i shared)&lt;BR /&gt;&lt;BR /&gt;thanks for the advice anyways&lt;/P&gt;</description>
      <pubDate>Fri, 16 Apr 2021 23:06:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/lisp-routine-to-change-blocks-line-type/m-p/10245885#M79803</guid>
      <dc:creator>Irreb</dc:creator>
      <dc:date>2021-04-16T23:06:41Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp Routine to change Blocks Line Type</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/lisp-routine-to-change-blocks-line-type/m-p/10249937#M79804</link>
      <description>&lt;P&gt;This should do the thing. Possibly you can comment in/out other properties -- see the semicolons.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;(vl-load-com)

(defun c:BFixLT+S (/ *error* :fixblocknested adoc :layers-restore lst_layer lay o l c w lt lts)
  
  (defun *error* (errmsg)
    (if (not (wcmatch errmsg "Function cancelled,quit / exit abort,console break,end"))
      (princ (strcat "\nError: " errmsg)))
    (:layers-restore)
    (vla-endundomark adoc)
    (princ))
  
  (defun :layers-restore ()
    (foreach item lst_layer
      (vla-put-lock (car item) (cdr (assoc "lock" (cdr item))))
      (vl-catch-all-apply '(lambda () (vla-put-freeze (car item) (cdr (assoc "freeze" (cdr item))))))))
  
  (defun :fixblocknested (n / be o)
    (if (not (vl-position n lst))
      (progn
	(setq lst (cons n lst)
	      be (tblobjname "BLOCK" n))
	(while (setq be (entnext be))
	  (if (= (cdr (assoc 0 (entget be))) "INSERT")
	    (:fixblocknested (cdr (assoc 2 (entget be)))))
	  (setq o (vlax-ename-&amp;gt;vla-object be))
;;;	  (vl-catch-all-apply 'vla-put-layer (list o l))
;;;	  (vl-catch-all-apply 'vla-put-color (list o c))
;;;	  (vl-catch-all-apply 'vla-put-lineweight (list o w))
	  (vl-catch-all-apply 'vla-put-linetype (list o lt))
	  (vl-catch-all-apply 'vla-put-linetypescale (list o lts))
	  ))))
  
  ;; -------------------------------------------------------------------------------------------
  
  (setq adoc (vla-get-activedocument (vlax-get-acad-object)))
  (vla-startundomark adoc)
  (vlax-for item (vla-get-layers adoc)
    (setq lst_layer (cons (list item
				(cons "lock" (vla-get-lock item))
				(cons "freeze" (vla-get-freeze item)))
			  lst_layer))
    (vla-put-lock item :vlax-false)
    (vl-catch-all-apply '(lambda () (vla-put-freeze item :vlax-false))))
  
  (setq s (ssget '((0 . "INSERT"))))
  
  (if (and (setq o (car (entsel "\nSelect a source for LT and LTS: ")))
	   (setq o (vlax-ename-&amp;gt;vla-object o))
	   (setq l (vla-get-layer o))
	   (setq c (vla-get-color o))
	   (setq w (vla-get-lineweight o))
	   (setq lt (vla-get-linetype o))
	   (setq lts (vla-get-linetypescale o))
	   )
    (if s
      (repeat (setq i (sslength s))
	(setq name (cdr (assoc 2 (entget (ssname s (setq i (1- i)))))))
	(:fixblocknested name))
;;;      (progn
;;;	(princ "\nFixing all blocks...")
;;;	(vlax-for blk (vla-get-blocks adoc)
;;;	  (if (and (equal (vla-get-islayout blk) :vlax-false)
;;;		   (equal (vla-get-isxref blk) :vlax-false)
;;;		   )
;;;	    (vlax-for o blk
;;;	      (vl-catch-all-apply 'vla-put-layer (list o l))
;;;	      (vl-catch-all-apply 'vla-put-color (list o c))
;;;	      (vl-catch-all-apply 'vla-put-lineweight (list o w))
;;;	      (vl-catch-all-apply 'vla-put-linetype (list o lt))
;;;	      (vl-catch-all-apply 'vla-put-linetypescale (list o lts))
;;;	      ))))
    ))
  (:layers-restore)
  (vla-endundomark adoc)
  (command "_.regenall")
  (princ)
  )
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Apr 2021 10:36:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/lisp-routine-to-change-blocks-line-type/m-p/10249937#M79804</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2021-04-19T10:36:23Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp Routine to change Blocks Line Type</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/lisp-routine-to-change-blocks-line-type/m-p/10250519#M79805</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;thanks for the routine. not sure it is working..or maybe i am not doing it correctly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I loaded the lisp and run the command:&lt;/P&gt;&lt;P&gt;-&amp;gt; "BFIXLT+S"&lt;/P&gt;&lt;P&gt;-&amp;gt; select the block reference&lt;/P&gt;&lt;P&gt;-&amp;gt; hit enter&lt;/P&gt;&lt;P&gt;-&amp;gt; select the line of reference with the the line type and scale i am looing for&lt;/P&gt;&lt;P&gt;-&amp;gt;&amp;nbsp;the model regenerate automatically and nothing has changed..&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;am i doing something wrong?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="francesco0berri_0-1618839654758.png" style="width: 524px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/908696i27FD0FBB8ACBA8B7/image-dimensions/524x148?v=v2" width="524" height="148" role="button" title="francesco0berri_0-1618839654758.png" alt="francesco0berri_0-1618839654758.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;edit:&lt;BR /&gt;only the line scale has changed, line type stays the same as the original.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Apr 2021 14:00:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/lisp-routine-to-change-blocks-line-type/m-p/10250519#M79805</guid>
      <dc:creator>Irreb</dc:creator>
      <dc:date>2021-04-19T14:00:15Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp Routine to change Blocks Line Type</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/lisp-routine-to-change-blocks-line-type/m-p/10250894#M79806</link>
      <description>&lt;P&gt;Yeah, I can imagine. It takes object properties, not layer properties.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Apr 2021 15:32:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/lisp-routine-to-change-blocks-line-type/m-p/10250894#M79806</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2021-04-19T15:32:49Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp Routine to change Blocks Line Type</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/lisp-routine-to-change-blocks-line-type/m-p/10251215#M79807</link>
      <description>&lt;P&gt;I don't think i understand your answer.&lt;BR /&gt;Maybe i didn't explain properly what i am looking for.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;what I would like is something that works like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-&amp;gt; insert command in command line&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;-&amp;gt; select the line or other object which has the line type and scale i want to match the block reference to&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;-&amp;gt; hit enter&lt;/P&gt;&lt;P&gt;-&amp;gt;&amp;nbsp;&lt;SPAN style="font-family: inherit;"&gt;select one or more block references of which i want to change all line type and scales of all&amp;nbsp;objects in it&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;-&amp;gt; done&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;basically the "MATCHPROP" command, but that works toward any block reference instead of single elements.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Apr 2021 17:24:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/lisp-routine-to-change-blocks-line-type/m-p/10251215#M79807</guid>
      <dc:creator>Irreb</dc:creator>
      <dc:date>2021-04-19T17:24:07Z</dc:date>
    </item>
  </channel>
</rss>

