<?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 for reinforcement layout in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-for-reinforcement-layout/m-p/7499946#M112806</link>
    <description>&lt;P&gt;One more mod...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Replace :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;(setq wrec (- (car (apply 'mapcar (cons 'max (car pl)))) (car (apply 'mapcar (cons 'min (car pl))))))&lt;/PRE&gt;
&lt;P&gt;With these two lines :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;(setq pl (vl-sort pl '(lambda ( a b ) (&amp;lt; (distance (cadr cpl) (mapcar '/ (apply 'mapcar (cons '+ a)) (list 4.0 4.0 4.0))) (distance (cadr cpl) (mapcar '/ (apply 'mapcar (cons '+ b)) (list 4.0 4.0 4.0)))))))&lt;BR /&gt;(setq wrec (- (car (apply 'mapcar (cons 'max (car pl)))) (car (apply 'mapcar (cons 'min (car pl))))))&lt;/PRE&gt;</description>
    <pubDate>Sun, 29 Oct 2017 15:12:05 GMT</pubDate>
    <dc:creator>marko_ribar</dc:creator>
    <dc:date>2017-10-29T15:12:05Z</dc:date>
    <item>
      <title>Lisp for reinforcement layout</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-for-reinforcement-layout/m-p/7499765#M112803</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm new with LISP and I really don't know how to create one but can edit (after many trials and errors).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need&amp;nbsp; a LISP making a line with the length as shown on the diagram by picking the polylines (or sometimes circle).&lt;/P&gt;&lt;P&gt;This is a steel reinforcement drawing so it will be having another line on Y direction but i think I can use the same LISP as X if ever.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance and i hope you guys can help me. &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Cheers!&lt;/P&gt;</description>
      <pubDate>Sun, 29 Oct 2017 11:40:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-for-reinforcement-layout/m-p/7499765#M112803</guid>
      <dc:creator>arvhee24</dc:creator>
      <dc:date>2017-10-29T11:40:03Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp for reinforcement layout</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-for-reinforcement-layout/m-p/7499914#M112804</link>
      <description>&lt;P&gt;Untested...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;(defun c:reinfline ( / ss i rec rpl pl cpl x2 x1 wrec len p1 p2 li )
  (prompt "\nSelect 3 rectangles...")
  (setq ss (ssget '((0 . "LWPOLYLINE") (-4 . "&amp;lt;or") (70 . 1) (70 . 129) (-4 . "or&amp;gt;") (-4 . "&amp;lt;not") (-4 . "&amp;lt;&amp;gt;") (42 . 0.0) (-4 . "not&amp;gt;"))))
  (while (or (not ss) (and ss (/= (sslength ss) 3)))
    (prompt "\nEmpty sel. set... Please reselect 3 rectangles again...")
    (setq ss (ssget '((0 . "LWPOLYLINE") (-4 . "&amp;lt;or") (70 . 1) (70 . 129) (-4 . "or&amp;gt;") (-4 . "&amp;lt;not") (-4 . "&amp;lt;&amp;gt;") (42 . 0.0) (-4 . "not&amp;gt;"))))
  )
  (repeat (setq i 3)
    (setq rec (ssname ss (setq i (1- i))))
    (setq rpl (mapcar 'cdr (vl-remove-if '(lambda ( x ) (/= (car x) 10)) (entget rec))))
    (setq pl (cons rpl pl))
  )
  (setq cpl (mapcar '(lambda ( x ) (mapcar '/ (apply 'mapcar (cons '+ x)) (list 4.0 4.0 4.0))) pl))
  (setq cpl (vl-sort cpl '(lambda ( a b ) (&amp;lt; (car a) (car b)))))
  (setq x2 (distance (car cpl) (cadr cpl)) x1 (distance (cadr cpl) (caddr cpl)))
  (setq wrec (- (car (apply 'mapcar (cons 'max (car pl)))) (car (apply 'mapcar (cons 'min (car pl))))))
  (setq len (+ (/ x2 5.0) wrec (/ x1 5.0)))
  (setq p1 (polar (cadr cpl) pi (+ (/ x2 5.0) (/ wrec 2.0))))
  (setq p2 (polar p1 0.0 len))
  (setq li (entmakex (list '(0 . "LINE") (cons 10 p1) (cons 11 p2))))
  (vl-cmdf "_.MOVE" li "" "_non" (cadr cpl))
  (while (&amp;lt; 0 (getvar 'cmdactive)) (vl-cmdf "\\"))
  (princ)
)&lt;/PRE&gt;</description>
      <pubDate>Sun, 29 Oct 2017 14:30:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-for-reinforcement-layout/m-p/7499914#M112804</guid>
      <dc:creator>marko_ribar</dc:creator>
      <dc:date>2017-10-29T14:30:15Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp for reinforcement layout</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-for-reinforcement-layout/m-p/7499930#M112805</link>
      <description>&lt;P&gt;Replace this line :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;(setq x2 (distance (car cpl) (cadr cpl)) x1 (distance (cadr cpl) (caddr cpl)))&lt;/PRE&gt;
&lt;P&gt;With this mod... :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;(setq x2 (distance (car cpl) (list (caadr cpl) (cadar cpl))) x1 (distance (cadr cpl) (list (caaddr cpl) (cadadr cpl))))&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 29 Oct 2017 14:49:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-for-reinforcement-layout/m-p/7499930#M112805</guid>
      <dc:creator>marko_ribar</dc:creator>
      <dc:date>2017-10-29T14:49:22Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp for reinforcement layout</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-for-reinforcement-layout/m-p/7499946#M112806</link>
      <description>&lt;P&gt;One more mod...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Replace :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;(setq wrec (- (car (apply 'mapcar (cons 'max (car pl)))) (car (apply 'mapcar (cons 'min (car pl))))))&lt;/PRE&gt;
&lt;P&gt;With these two lines :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;(setq pl (vl-sort pl '(lambda ( a b ) (&amp;lt; (distance (cadr cpl) (mapcar '/ (apply 'mapcar (cons '+ a)) (list 4.0 4.0 4.0))) (distance (cadr cpl) (mapcar '/ (apply 'mapcar (cons '+ b)) (list 4.0 4.0 4.0)))))))&lt;BR /&gt;(setq wrec (- (car (apply 'mapcar (cons 'max (car pl)))) (car (apply 'mapcar (cons 'min (car pl))))))&lt;/PRE&gt;</description>
      <pubDate>Sun, 29 Oct 2017 15:12:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-for-reinforcement-layout/m-p/7499946#M112806</guid>
      <dc:creator>marko_ribar</dc:creator>
      <dc:date>2017-10-29T15:12:05Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp for reinforcement layout</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-for-reinforcement-layout/m-p/7500162#M112807</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Image_12.gif" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/419122i08EBF280D4DF897B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Image_12.gif" alt="Image_12.gif" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;FONT size="3"&gt;(vl-load-com)
;;============================= c:Test0007 ====================================;;
;; Jose L. García G. -  29/10/17                                               ;;
;;=============================================================================;;
(defun c:Test0007 (/ ss lstSs LstDatCurves Obj1 Obj2 Obj3 D1 D2 Box2
		     Long2 X2 p1L p2L BoxAll PtMidAll
		     ;|Functions|; Aux-GetBoxObj MidPt)
 
	(defun Aux-GetBoxObj (obj / MinPt MaxPt v1 v3  Retval)
	 (cond
	  ((vlax-method-applicable-p obj 'getboundingbox)
	   (vla-getboundingbox obj 'MinPt 'MaxPt)
	   (list (vlax-safearray-&amp;gt;list MinPt)
		 (vlax-safearray-&amp;gt;list MaxPt))
	  )
	 );c.cond
	);c.defun
 
	(defun MidPt (a b)
	 (mapcar (function (lambda (a b) (/ (+ a b) 2.0))) a b)
	)
 ;;--------------------- MAIN -----------------
 (cond
  ((not (setq ss (ssget (list '(0 . "LWPOLYLINE,CIRCLE")))))
   (prompt "\n¡Nothing Selected.!")
  )
  ((/= (sslength ss) 3)
   (prompt "\n¡You can only select 3 objects.!")	
  )
  (T
   (setq lstSs (vl-remove-if 'listp (mapcar 'cadr (ssnamex ss))))
   (mapcar
    (function
     (lambda (eCurve / oCurve Box)
      (setq oCurve (vlax-ename-&amp;gt;vla-object eCurve))
      (cond
       ((setq Box (Aux-GetBoxObj oCurve))
	(setq Tmp (list (apply 'MidPt Box) ;;Center Curve
			Box))
	(setq LstDatCurves (cons Tmp LstDatCurves))
       )
      );c.cond
     )
    )
    lstSs
   );c.mapcar
   (cond
    (LstDatCurves
     (vla-StartUndoMark (vla-get-ActiveDocument (vlax-get-acad-object)))
     (setq BoxAll
	   (mapcar
	    (function
	     (lambda ( a b )
	      (apply 'mapcar (cons a b))
	     )
	    )
	    '(min max)
	    (list (mapcar 'caadr  LstDatCurves)
		  (mapcar 'cadadr  LstDatCurves))
	   )
     )
     (setq PtMidAll (apply 'MidPt BoxAll)) 
     ;;(command "_point" PtMidAll)
     (setq LstDatCurves
      (vl-sort
       LstDatCurves (function (lambda (e1 e2) (&amp;lt; (caar e1) (caar e2)))))
     ) 
     (setq Obj1 (car LstDatCurves)
	   Obj2 (cadr LstDatCurves)
	   Obj3 (last LstDatCurves))
     (setq D2 (- (caar Obj2)(caar Obj1))
	   D1 (- (caar Obj3)(caar Obj2)))
     (setq Box2 (cadr Obj2)
	   Long2 (abs (car (apply 'mapcar (cons '- Box2))))
	   X2 (caar Box2))
     (setq p1L (list (- X2 (/ D2 5.0)) (cadr PtMidAll))
	   p2L (list (+ X2 Long2 (/ D1 5.0)) (cadr PtMidAll)))
     (entmakex (list '(0 . "LINE")(cons 10 p1L)(cons 11 p2L) '(62 . 4)))
     (vla-EndUndoMark (vla-get-ActiveDocument (vlax-get-acad-object)))
    )
   )
  )
 );c.cond
 (princ)
)&lt;/FONT&gt;&lt;/PRE&gt;
&lt;P&gt;regards..&lt;/P&gt;</description>
      <pubDate>Sun, 29 Oct 2017 18:53:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-for-reinforcement-layout/m-p/7500162#M112807</guid>
      <dc:creator>joselggalan</dc:creator>
      <dc:date>2017-10-29T18:53:51Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp for reinforcement layout</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-for-reinforcement-layout/m-p/7500188#M112808</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/940934"&gt;@marko_ribar&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;....&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;....
  (prompt "\nSelect 3 rectangles...")
  (setq ss (ssget '((0 . "LWPOLYLINE") (-4 . "&amp;lt;or") (70 . 1) (70 . 129) (-4 . "or&amp;gt;") (-4 . "&amp;lt;not") (-4 . "&amp;lt;&amp;gt;") (42 . 0.0) (-4 . "not&amp;gt;"))))
  (while (or (not ss) (and ss (/= (sslength ss) 3)))
    (prompt "\nEmpty sel. set... Please reselect 3 rectangles again...")
    (setq ss (ssget '((0 . "LWPOLYLINE") (-4 . "&amp;lt;or") (70 . 1) (70 . 129) (-4 . "or&amp;gt;") (-4 . "&amp;lt;not") (-4 . "&amp;lt;&amp;gt;") (42 . 0.0) (-4 . "not&amp;gt;"))))
....
&lt;/PRE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Not really relevant to the operational part of the question, but just some suggestions about the selection....&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There's a slightly &lt;FONT color="#ff0000"&gt;simpler way&lt;/FONT&gt; to filter for &lt;EM&gt;closed&lt;/EM&gt;&amp;nbsp; Polylines &lt;EM&gt;whether or not&lt;/EM&gt;&amp;nbsp; linetype generation is enabled in them, than checking for whether the (assoc 70) value is &lt;EM&gt;either 1 or 129&lt;/EM&gt; --&amp;nbsp;the one below&amp;nbsp;checks simply for &lt;FONT color="#ff0000"&gt;whether it contains the 1 bit&lt;/FONT&gt;, and whether or not it also contains the 128 bit doesn't matter.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The (42 . 0) filter item would be satisfied with only &lt;EM&gt;one&lt;/EM&gt;&amp;nbsp; no-bulge [line] segment, and so would accept selection of many non-rectangular Polylines.&amp;nbsp; I don't think you can filter for whether &lt;EM&gt;all&lt;/EM&gt;&amp;nbsp; bulge factors are zero, but if it's important [i.e. you can't assume the User is going to select only the right kinds of things], you could check the selected ones for that after selection.&amp;nbsp; You could also check for whether they're actually rectangular [I have code to do that if you're interested], and whether they're aligned in the same direction, with more code, but again, not in the (ssget) filtering.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would also check &lt;FONT color="#3366ff"&gt;for four vertices&lt;/FONT&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And rather than spell out the entire (setq) line with (ssget) filter &lt;EM&gt;twice&lt;/EM&gt;, I would re-arrange things a little to do it only once.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;....&lt;BR /&gt;  (prompt "\nSelect 3 closed rectangular Polylines: ")&lt;BR /&gt;  (while&lt;BR /&gt;    (not&lt;BR /&gt;      (and&lt;BR /&gt;        (setq ss (ssget '((0 . "LWPOLYLINE") &lt;FONT color="#3366ff"&gt;(90 . 4)&lt;/FONT&gt; &lt;FONT color="#ff0000"&gt;(-4 . "&amp;amp;") (70 . 1)&lt;/FONT&gt;)))&lt;BR /&gt;        (= (sslength ss) 3)&lt;BR /&gt;      ); and&lt;BR /&gt;    ); not&lt;BR /&gt;    (prompt "\nIncorrect - try again...")&lt;BR /&gt;  ); while&lt;BR /&gt;....&lt;/PRE&gt;
&lt;P&gt;[By the way, the original's scolding is incorrect in that an empty selection set is not the only reason it would appear.]&lt;/P&gt;</description>
      <pubDate>Sun, 29 Oct 2017 19:30:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-for-reinforcement-layout/m-p/7500188#M112808</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2017-10-29T19:30:54Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp for reinforcement layout</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-for-reinforcement-layout/m-p/7500274#M112809</link>
      <description>&lt;P&gt;Correct, I forgot about (90 . 4) and just copy+pasted that line without that important filter dotted pair... OP can just add it in both places... You are also right that it could be written shortly, but for me it's only copy+paste thing and I used to construct that starting input sentences that way... Still without (42 . 0.0) check user could select those that have bulges and I wanted to avoid that thing, and I know that there is perhaps better way to check for exact rectangle shape, but I suppose OP/user is not so blind not to understand the meaning of complete filter and I assume that according to provided picture only valid attempts would be initiated by user as he/she is knowing what is needed for the task that was requested... Anyway your observation is very welcome and can only benefit to make solution even more perfect...&lt;/P&gt;</description>
      <pubDate>Sun, 29 Oct 2017 20:51:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-for-reinforcement-layout/m-p/7500274#M112809</guid>
      <dc:creator>marko_ribar</dc:creator>
      <dc:date>2017-10-29T20:51:14Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp for reinforcement layout</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-for-reinforcement-layout/m-p/7500401#M112810</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5269261"&gt;@arvhee24&lt;/a&gt; wrote:&lt;BR /&gt;&lt;BR /&gt;....&amp;nbsp;&lt;SPAN&gt;by picking the polylines (&lt;FONT color="#FF0000"&gt;or sometimes circle&lt;/FONT&gt;).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;It is assumed. But it is not indicated that polylines are necessarily rectangles.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 29 Oct 2017 23:41:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-for-reinforcement-layout/m-p/7500401#M112810</guid>
      <dc:creator>joselggalan</dc:creator>
      <dc:date>2017-10-29T23:41:26Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp for reinforcement layout</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-for-reinforcement-layout/m-p/7500651#M112811</link>
      <description>&lt;P&gt;Thanks guys, this helps a lot...&lt;/P&gt;&lt;P&gt;Really appreciate your efforts.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers!&lt;/P&gt;</description>
      <pubDate>Mon, 30 Oct 2017 04:43:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-for-reinforcement-layout/m-p/7500651#M112811</guid>
      <dc:creator>arvhee24</dc:creator>
      <dc:date>2017-10-30T04:43:12Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp for reinforcement layout</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-for-reinforcement-layout/m-p/7500655#M112812</link>
      <description>&lt;P&gt;Thanks Mr. Jose.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can use this lisp for my work and it really helps.&lt;/P&gt;&lt;P&gt;Only thing is if I change my UCS, the line created is still at world.&lt;/P&gt;&lt;P&gt;But I guess i can just rotate the part if I need to.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Really appreciate your help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Oct 2017 04:46:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-for-reinforcement-layout/m-p/7500655#M112812</guid>
      <dc:creator>arvhee24</dc:creator>
      <dc:date>2017-10-30T04:46:25Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp for reinforcement layout</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-for-reinforcement-layout/m-p/7500689#M112813</link>
      <description>&lt;P&gt;Here, for various UCS in 3D...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;(vl-load-com)
;;============================= c:Test0008 ========================================;;
;; Jose L. García G. - 29-30/10/17 - Mod. by Marko M. Ribar - applicable in 3D UCS ;;
;;=================================================================================;;
(defun c:Test0008 ( / ss lstSs LstDatCurves Obj1 Obj2 Obj3 D1 D2 Box2
		     Long2 X2 p1L p2L BoxAll PtMidAll mat lin
		     ;|Functions|; Aux-GetBoxObj MidPt )
 
	(defun Aux-GetBoxObj ( obj / MinPt MaxPt v1 v3  Retval )
	 (cond
	  ((vlax-method-applicable-p obj 'getboundingbox)
	   (vla-getboundingbox obj 'MinPt 'MaxPt)
	   (list (vlax-safearray-&amp;gt;list MinPt)
		        (vlax-safearray-&amp;gt;list MaxPt))
	  )
	 );c.cond
	);c.defun
 
	(defun MidPt ( a b )
	 (mapcar (function (lambda ( a b ) (/ (+ a b) 2.0))) a b)
	)
 ;;--------------------- MAIN -----------------
 (setq mat
  (list
   (list (car (getvar 'ucsxdir)) (car (getvar 'ucsydir)) (car (trans '(0.0 0.0 1.0) 1 0 t)) (car (getvar 'ucsorg)))
   (list (cadr (getvar 'ucsxdir)) (cadr (getvar 'ucsydir)) (cadr (trans '(0.0 0.0 1.0) 1 0 t)) (cadr (getvar 'ucsorg)))
   (list (caddr (getvar 'ucsxdir)) (caddr (getvar 'ucsydir)) (caddr (trans '(0.0 0.0 1.0) 1 0 t)) (caddr (getvar 'ucsorg)))
   (list 0.0 0.0 0.0 1.0)
  )
 )
 (cond
  ((not (setq ss (ssget "_:L" '((0 . "LWPOLYLINE,CIRCLE")))))
   (prompt "\nNothing Selected.!")
  )
  ((/= (sslength ss) 3)
   (prompt "\nYou can only select 3 objects.!")	
  )
  (T
   (vla-StartUndoMark (vla-get-ActiveDocument (vlax-get-acad-object)))
   (setq lstSs (vl-remove-if 'listp (mapcar 'cadr (ssnamex ss))))
   (mapcar
    (function
     (lambda ( eCurve / oCurve Box )
      (setq oCurve (vlax-ename-&amp;gt;vla-object eCurve))
      (cond
       ((setq Box (Aux-GetBoxObj oCurve))
        (setq Tmp (list (apply 'MidPt Box) ;;Center Curve
                        Box))
        (setq LstDatCurves (cons Tmp LstDatCurves))
       )
      );c.cond
     )
    )
    lstSs
   );c.mapcar
   (cond
    (LstDatCurves
     (setq BoxAll
           (mapcar
            (function
             (lambda ( a b )
              (apply 'mapcar (cons a b))
             )
            )
            '(min max)
            (list (mapcar 'caadr  LstDatCurves)
                  (mapcar 'cadadr  LstDatCurves))
           )
     )
     (setq PtMidAll (apply 'MidPt BoxAll)) 
     ;;(command "_point" PtMidAll)
     (setq LstDatCurves
      (vl-sort
       LstDatCurves (function (lambda ( e1 e2 ) (&amp;lt; (caar e1) (caar e2)))))
     ) 
     (setq Obj1 (car LstDatCurves)
           Obj2 (cadr LstDatCurves)
           Obj3 (last LstDatCurves))
     (setq D2 (- (caar Obj2)(caar Obj1))
           D1 (- (caar Obj3)(caar Obj2)))
     (setq Box2 (cadr Obj2)
           Long2 (abs (car (apply 'mapcar (cons '- Box2))))
           X2 (caar Box2))
     (setq p1L (list (- X2 (/ D2 5.0)) (cadr PtMidAll))
           p2L (list (+ X2 Long2 (/ D1 5.0)) (cadr PtMidAll)))
     (setq lin (entmakex (list '(0 . "LINE")(cons 10 p1L)(cons 11 p2L) '(62 . 4))))
     (vla-transformby (vlax-ename-&amp;gt;vla-object lin) (vlax-tmatrix mat))
    )
   )
   (vla-EndUndoMark (vla-get-ActiveDocument (vlax-get-acad-object)))
  )
 );c.cond
 (princ)
)&lt;/PRE&gt;
&lt;P&gt;Regards., M.R.&lt;/P&gt;</description>
      <pubDate>Mon, 30 Oct 2017 05:37:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-for-reinforcement-layout/m-p/7500689#M112813</guid>
      <dc:creator>marko_ribar</dc:creator>
      <dc:date>2017-10-30T05:37:57Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp for reinforcement layout</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-for-reinforcement-layout/m-p/7500725#M112814</link>
      <description>&lt;P&gt;Thanks Mr. Marko.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've tried your routine with the mods and the correction from Mr. Kent and it works well too, but the only thing is i can't use it with circle.&lt;/P&gt;&lt;P&gt;And is there any chance it can work on Y-axis?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers!&lt;/P&gt;</description>
      <pubDate>Mon, 30 Oct 2017 06:02:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-for-reinforcement-layout/m-p/7500725#M112814</guid>
      <dc:creator>arvhee24</dc:creator>
      <dc:date>2017-10-30T06:02:20Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp for reinforcement layout</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-for-reinforcement-layout/m-p/7500729#M112815</link>
      <description>&lt;P&gt;Disregard previous posted code... I was in a hurry... This one is fine for various UCS... So for Y axis, you rotate your UCS 90 degree CCW and apply this mod...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;(vl-load-com)
;;============================= c:Test0008 ========================================;;
;; Jose L. García G. - 29-30/10/17 - Mod. by Marko M. Ribar - applicable in 3D UCS ;;
;;=================================================================================;;
(defun c:Test0008 ( / ss lstSs LstDatCurves Obj1 Obj2 Obj3 D1 D2 Box2
		     Long2 X2 p1L p2L BoxAll PtMidAll matucs matwcs lin
		     ;|Functions|; Aux-GetBoxObj MidPt )
 
	(defun Aux-GetBoxObj ( obj / MinPt MaxPt v1 v3  Retval )
	 (cond
	  ((vlax-method-applicable-p obj 'getboundingbox)
	   (vla-getboundingbox obj 'MinPt 'MaxPt)
	   (list (vlax-safearray-&amp;gt;list MinPt)
		        (vlax-safearray-&amp;gt;list MaxPt))
	  )
	 );c.cond
	);c.defun
 
	(defun MidPt ( a b )
	 (mapcar (function (lambda ( a b ) (/ (+ a b) 2.0))) a b)
	)
 ;;--------------------- MAIN -----------------
 (setq matucs
  (list
   (list (car (getvar 'ucsxdir)) (car (getvar 'ucsydir)) (car (trans '(0.0 0.0 1.0) 1 0 t)) (car (getvar 'ucsorg)))
   (list (cadr (getvar 'ucsxdir)) (cadr (getvar 'ucsydir)) (cadr (trans '(0.0 0.0 1.0) 1 0 t)) (cadr (getvar 'ucsorg)))
   (list (caddr (getvar 'ucsxdir)) (caddr (getvar 'ucsydir)) (caddr (trans '(0.0 0.0 1.0) 1 0 t)) (caddr (getvar 'ucsorg)))
   (list 0.0 0.0 0.0 1.0)
  )
 )
 (setq matwcs
  (list
   (list (car (trans '(1.0 0.0 0.0) 0 1 t)) (car (trans '(0.0 1.0 0.0) 0 1 t)) (car (trans '(0.0 0.0 1.0) 0 1 t)) (car (trans '(0.0 0.0 0.0) 0 1)))
   (list (cadr (trans '(1.0 0.0 0.0) 0 1 t)) (cadr (trans '(0.0 1.0 0.0) 0 1 t)) (cadr (trans '(0.0 0.0 1.0) 0 1 t)) (cadr (trans '(0.0 0.0 0.0) 0 1)))
   (list (caddr (trans '(1.0 0.0 0.0) 0 1 t)) (caddr (trans '(0.0 1.0 0.0) 0 1 t)) (caddr (trans '(0.0 0.0 1.0) 0 1 t)) (caddr (trans '(0.0 0.0 0.0) 0 1)))
   (list 0.0 0.0 0.0 1.0)
  )
 )
 (cond
  ((not (setq ss (ssget "_:L" '((0 . "LWPOLYLINE,CIRCLE")))))
   (prompt "\nNothing Selected.!")
  )
  ((/= (sslength ss) 3)
   (prompt "\nYou can only select 3 objects.!")	
  )
  (T
   (vla-StartUndoMark (vla-get-ActiveDocument (vlax-get-acad-object)))
   (setq lstSs (vl-remove-if 'listp (mapcar 'cadr (ssnamex ss))))
   (foreach e lstSs
    (vla-transformby (vlax-ename-&amp;gt;vla-object e) (vlax-tmatrix matwcs))
   )
   (mapcar
    (function
     (lambda ( eCurve / oCurve Box )
      (setq oCurve (vlax-ename-&amp;gt;vla-object eCurve))
      (cond
       ((setq Box (Aux-GetBoxObj oCurve))
        (setq Tmp (list (apply 'MidPt Box) ;;Center Curve
                        Box))
        (setq LstDatCurves (cons Tmp LstDatCurves))
       )
      );c.cond
     )
    )
    lstSs
   );c.mapcar
   (cond
    (LstDatCurves
     (setq BoxAll
           (mapcar
            (function
             (lambda ( a b )
              (apply 'mapcar (cons a b))
             )
            )
            '(min max)
            (list (mapcar 'caadr  LstDatCurves)
                  (mapcar 'cadadr  LstDatCurves))
           )
     )
     (setq PtMidAll (apply 'MidPt BoxAll)) 
     ;;(command "_point" PtMidAll)
     (setq LstDatCurves
      (vl-sort
       LstDatCurves (function (lambda ( e1 e2 ) (&amp;lt; (caar e1) (caar e2)))))
     ) 
     (setq Obj1 (car LstDatCurves)
           Obj2 (cadr LstDatCurves)
           Obj3 (last LstDatCurves))
     (setq D2 (- (caar Obj2)(caar Obj1))
           D1 (- (caar Obj3)(caar Obj2)))
     (setq Box2 (cadr Obj2)
           Long2 (abs (car (apply 'mapcar (cons '- Box2))))
           X2 (caar Box2))
     (setq p1L (list (- X2 (/ D2 5.0)) (cadr PtMidAll))
           p2L (list (+ X2 Long2 (/ D1 5.0)) (cadr PtMidAll)))
     (setq lin (entmakex (list '(0 . "LINE")(cons 10 p1L)(cons 11 p2L) '(62 . 4))))
     (foreach e lstSs
      (vla-transformby (vlax-ename-&amp;gt;vla-object e) (vlax-tmatrix matucs))
     )
     (vla-transformby (vlax-ename-&amp;gt;vla-object lin) (vlax-tmatrix matucs))
    )
   )
   (vla-EndUndoMark (vla-get-ActiveDocument (vlax-get-acad-object)))
  )
 );c.cond
 (princ)
)&lt;/PRE&gt;
&lt;P&gt;M.R.&lt;/P&gt;</description>
      <pubDate>Mon, 30 Oct 2017 06:08:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-for-reinforcement-layout/m-p/7500729#M112815</guid>
      <dc:creator>marko_ribar</dc:creator>
      <dc:date>2017-10-30T06:08:50Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp for reinforcement layout</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-for-reinforcement-layout/m-p/7500753#M112816</link>
      <description>&lt;P&gt;Oh wow! &lt;img id="smileysurprised" class="emoticon emoticon-smileysurprised" src="https://forums.autodesk.com/i/smilies/16x16_smiley-surprised.png" alt="Smiley Surprised" title="Smiley Surprised" /&gt;&lt;/P&gt;&lt;P&gt;This works like a charm.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is definitely it!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks so much Mr. Marko &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;And to all of you guys who help on this routine Mr. Jose and Mr. Kent...&lt;/P&gt;&lt;P&gt;Your efforts and time are most appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Oct 2017 06:30:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-for-reinforcement-layout/m-p/7500753#M112816</guid>
      <dc:creator>arvhee24</dc:creator>
      <dc:date>2017-10-30T06:30:25Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp for reinforcement layout</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-for-reinforcement-layout/m-p/9837596#M112817</link>
      <description>&lt;P&gt;some thing wrrong , why , center box width add to result line length at each side&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 01 Nov 2020 01:53:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-for-reinforcement-layout/m-p/9837596#M112817</guid>
      <dc:creator>abdulellah.alattab</dc:creator>
      <dc:date>2020-11-01T01:53:25Z</dc:date>
    </item>
  </channel>
</rss>

