Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How can make I create Block?.

14 REPLIES 14
SOLVED
Reply
Message 1 of 15
jinkinglee
614 Views, 14 Replies

How can make I create Block?.

;;How can make I create Block?. Block name=8HEADFIGURE, Select objects: layer "8 HEAD FIGURE"
;;I want to be able to move the whole object together, not seperately, so I need to create a block.
;;See picture - I want to move all the red lines, not 1 by 1. Please help.
 
  (command "layer"    "make"  "8 HEAD FIGURE"       "color"
    "r"       ""  "ltype"    "dot"      ""
    ""
   )
  (SETQ f_0 (POLAR O pi 36.0))
  (SETQ f_0 (POLAR f_0 PIU (/ Height 8.0)))
  (SETQ f_1 (POLAR f_0 PID (/ Height 8.0)))
  (SETQ f_2 (POLAR f_1 PID (/ Height 8.0)))
  (SETQ f_3 (POLAR f_2 PID (/ Height 8.0)))
  (SETQ f_4 (POLAR f_3 PID (/ Height 8.0)))
  (SETQ f_5 (POLAR f_4 PID (/ Height 8.0)))
  (SETQ f_6 (POLAR f_5 PID (/ Height 8.0)))
  (SETQ f_7 (POLAR f_6 PID (/ Height 8.0)))
  (SETQ f_8 (POLAR f_7 PID (/ Height 8.0)))
  (setq f_9 (polar f_1 pid full_length))
   (COMMAND "LINE" f_0 f_8 "")
  (COMMAND "LINE" f_0 "@36,0.0" "")
  (COMMAND "LINE" f_1 "@36,0.0" "")
  (COMMAND "LINE" f_2 "@36,0.0" "")
  (COMMAND "LINE" f_3 "@60,0.0" "")
  (COMMAND "LINE" f_4 "@60,0.0" "")
  (COMMAND "LINE" f_5 "@36,0.0" "")
  (COMMAND "LINE" f_6 "@36,0.0" "")
  (COMMAND "LINE" f_7 "@36,0.0" "")
  (COMMAND "LINE" f_8 "@36,0.0" "")
  (command "line" f_9 "@-20,0.0" "");;Full_length

14 REPLIES 14
Message 2 of 15
hgasty1001
in reply to: jinkinglee

Hi,

 

A simplistic way to go is as follow:

 

1.-Create an empty selection set

2.-After each line created add it to the selection set

3.-Create the block using the selection set

 

something like this:

 ...
  (setq ss (ssadd))
  (COMMAND "LINE" f_0 f_8 "")
  (ssadd (entlast) ss)
  (COMMAND "LINE" f_0 "@36,0.0" "")
  (ssadd (entlast) ss)
  (COMMAND "LINE" f_1 "@36,0.0" "")
  (ssadd (entlast) ss)
  (COMMAND "LINE" f_2 "@36,0.0" "")
  (ssadd (entlast) ss)
  (COMMAND "LINE" f_3 "@60,0.0" "")
  (ssadd (entlast) ss)
  (COMMAND "LINE" f_4 "@60,0.0" "")
  (ssadd (entlast) ss)
  (COMMAND "LINE" f_5 "@36,0.0" "")
  (ssadd (entlast) ss)
  (COMMAND "LINE" f_6 "@36,0.0" "")
  (ssadd (entlast) ss)
  (COMMAND "LINE" f_7 "@36,0.0" "")
  (ssadd (entlast) ss)
  (COMMAND "LINE" f_8 "@36,0.0" "")
  (ssadd (entlast) ss)
  (command "line" f_9 "@-20,0.0" "");;Full_length
  (ssadd (entlast) ss)
  (command "_.block" "8HEADFIGURE" some_point_variable_here ss "")
  ...

 

Gaston Nunez

 

 

Message 3 of 15
jinkinglee
in reply to: hgasty1001

I tried what you suggested. Still lines are moving seperately.

Message 4 of 15
dbroad
in reply to: jinkinglee

1. Why do you need to create a program for this?  Once you draw it, make a block out of it.  Use the convert option.  Then you can move it.

2. If you need it automated, your code needs to be complete within itself before we can help you.  Consider that the following are undefined:  O,PIU,PID,HEIGHT,FULL_LENGTH.

3. Gasty showed you how to make a block, sort of.  He may have assumed you could take it from there.  Generally, you need to insert the just created block.  Then you can move the block reference.

 

Why don't you fill in what you can to complete the missing information (see above) and we'll help you from there?

Architect, Registered NC, VA, SC, & GA.
Message 5 of 15
jinkinglee
in reply to: dbroad

;;Attached is the original file. Please take a look. Look at the code towards the end.

 

;;월간복장 1991-8 월호 참고. 카피 PaperPort 안에 스켄하여 놓음. 이성우선생제도.
;;05-31-2013 새로 정리하기 시작함.
;;Short Data 정보 프트
;;Block
;;ABC S_15 use SQR
;;(setq DL (entlast))   ;TEST OK
;;(command "erase" DL "")  ;last line erase.
;;(COMMAND "ARC" "" P19)
;;(command "arc" p19 "e" h3a "d" p9)
;;(setq ss (entlast))
;;(setq eget (entget ss)
;;?=Need to ? 질문 을 3개로 모아둔다.

;;Ask;;(COMMAND "LINE" B "@10,0.0" "") Ask = area
;;;;;;;(COMMAND "LINE" f_1 "@-36,0.0" "")
;;(COMMAND "LINE" S_D (polar S_D pid 11) "");; + X

(defun dtr (deg /) (* (/ deg 180.0) pi))
;;0.0,pi=180 degrees
(setq piu (/ pi 2.0))
;;angle 90 degrees, "pi up" +pi/2
(setq pid (* pi 1.5))
;;angle 270 degrees, "pi down" = -pi/2

(defun cm_inch (cm /)
  (/ cm 2.54)
)

(setq Text_Size 0.5)
(setvar "cmdecho" 0)
;;(setvar "cmdecho" 1)
;;?Linetype 연구
(defun C:llt ()
  (command "-linetype" "l" "cen*" "acadiso.lin" "")
  (command "-linetype" "l" "hid*" "acadiso.lin" "")
  (command "linetype" "1" "dashed" "1" "_s")
  (princ)
)

;;(lag "33" "dashed" "3" "_s")
;;?  ;;=CoatMuller.lsp
(DEFUN c:COATMuller ()
  (setq TODAY (menucmd "M=$(edtime,$(getvar,date),MO/DD/YYYY)"))
  (setq COMMANDFILENAME (getstring "\nEnter File Name: "))
  (setq FULLNAME (getstring "\nEnter Full Name: "))
  (SETQ CDATE (RTOS (GETVAR "CDATE")))
     ;(SETQ CYEAR (SUBSTR CDATE 1 4))
     ;(SETQ CMONTH (SUBSTR CDATE 5 2))
     ;(SETQ CDAY (SUBSTR CDATE 7 2))
  ;;적용치수.: 는 ACCESS 에서 오는 수치를 사용하여 그려짐.
  (SETQ Height 0.0)
  (setq Height2 Height)

  (setq Height2 (getreal (strcat "\nEnter Height value:< "
     (rtos Height2 2 1)
     " >: "
    )
  )
  )

  (if (/= Height2 nil)
    (setq Height Height2)
  )

  (SETQ Full_Length 64.0)
  (setq Full_Length2 Full_Length)
  (setq Full_Length2
  (getreal (strcat "\nEnter Full_Length value:< "
     (rtos Full_Length2 2 1)
     " >: "
    )
  )
  )
  (if (/= Full_Length2 nil)
    (setq Full_Length Full_Length2)
  )

  (SETQ Neck 16.0)
  (setq Neck2 Neck)
  (setq Neck2 (getreal (strcat "\nEnter Neck value:< "
          (rtos Neck2 2 1)
          " >: "
         )
       )
  )
  (if (/= Neck2 nil)
    (setq Neck Neck2)
  )

  (SETQ Overarm 48.0)
  (setq Overarm2 Overarm)
  (setq Overarm2 (getreal (strcat "\nEnter Overarm value:< "
      (rtos Overarm2 2 1)
      " >: "
     )
   )
  )
  (if (/= Overarm2 nil)
    (setq Overarm Overarm2)
  )

  (SETQ Chest 40)
  (setq Chest2 Chest)
  (setq Chest2
  (getreal
    (strcat "\nEnter Chest value:< " (rtos Chest2 2 1) " >: ")
  )
  )
  (if (/= Chest2 nil)
    (setq Chest Chest2)
  )
  ;;(SETQ Chest (/ Chest 2.0))

  (SETQ Waist 36)
  (setq Waist2 Waist)
  (setq Waist2
  (getreal
    (strcat "\nEnter Waist value:< " (rtos Waist2 2 1) " >: ")
  )
  )
  (if (/= Waist2 nil)
    (setq Waist Waist2)
  )
  ;;(SETQ Waist (/ Waist 2.0))

  (SETQ Seat 41)
  (setq Seat2 Seat)
  (setq Seat2
  (getreal
    (strcat "\nEnter Seat value:< " (rtos Seat2 2 1) " >: ")
  )
  )
  (if (/= Seat2 nil)
    (setq Seat Seat2)
  )
  ;;(SETQ Seat (/ Seat 2.0))

  (SETQ Point 19.0)
  (setq Point2 Point)
  (setq Point2 (getreal (strcat "\nEnter Point value:< "
    (rtos Point2 2 1)
    " >: "
   )
        )
  )
  (if (/= Point2 nil)
    (setq Point Point2)
  )
  (SETQ Chest_Back 16.0)
  (setq Chest_Back2 Chest_Back)
  (setq Chest_Back2
  (getreal (strcat "\nEnter Chest_Back value:< "
     (rtos Chest_Back2 2 1)
     " >: "
    )
  )
  )
  (if (/= Chest_Back2 nil)
    (setq Chest_Back Chest_Back2)
  )
  (SETQ Chest_Front 16.0)
  (setq Chest_Front2 Chest_Front)
  (setq Chest_Front2
  (getreal (strcat "\nEnter Chest_Front value:< "
     (rtos Chest_Front2 2 1)
     " >: "
    )
  )
  )
  (if (/= Chest_Front2 nil)
    (setq Chest_Front Chest_Front2)
  )

  (SETQ Bicep 12.0)
  (setq Bicep2 Bicep)
  (setq Bicep2 (getreal (strcat "\nEnter Bicep value:< "
    (rtos Bicep2 2 1)
    " >: "
   )
        )
  )
  (if (/= Bicep2 nil)
    (setq Bicep Bicep2)
  )

  (SETQ Sleeve_inseam 17.0)
  (setq Sleeve_inseam2 Sleeve_inseam)
  (setq Sleeve_inseam2
  (getreal (strcat "\nEnter Sleeve_inseam value:< "
     (rtos Sleeve_inseam2 2 1)
     " >: "
    )
  )
  )
  (if (/= Sleeve_inseam2 nil)
    (setq Sleeve_inseam Sleeve_inseam2)
  )

  (SETQ Sleeve_Outseam 24.0)
  (setq Sleeve_Outseam2 Sleeve_Outseam)
  (setq Sleeve_Outseam2
  (getreal (strcat "\nEnter Sleeve_Outseam value:< "
     (rtos Sleeve_Outseam2 2 1)
     " >: "
    )
  )
  )
  (if (/= Sleeve_outseam2 nil)
    (setq Sleeve_Outseam Sleeve_Outseam2)
  )
  (princ "1111")
  (SETQ OL1 64.0)
  (setq OL12 OL1)
  (setq OL12 (getreal (strcat "\nEnter OL1 value:< "
         (rtos OL12 2 1)
         " >: "
        )
      )
  )


  (if (/= OL12 nil)
    (setq OL1 OL12)
  )

  (SETQ OL2 68.5)
  (setq OL22 OL2)
  (setq OL22 (getreal (strcat "\nEnter OL2 value:< "
         (rtos OL22 2 1)
         " >: "
        )
      )
  )
  (if (/= OL22 nil)
    (setq OL2 OL22)
  )

  (SETQ Slope_Left 2.25)
  (setq Slope_Left2 Slope_Left)
  (setq Slope_Left2
  (getreal (strcat "\nEnter Slope_Left value:< "
     (rtos Slope_Left2 2 1)
     " >: "
    )
  )
  )
  (if (/= Slope_Left2 nil)
    (setq Slope_Left Slope_Left2)
  )

  (SETQ Slope_Right 2.25)
  (setq Slope_Right2 Slope_Right)
  (setq Slope_Right2
  (getreal (strcat "\nEnter Slope_Right value:< "
     (rtos Slope_Right2 2 1)
     " >: "
    )
  )
  )
  (if (/= Slope_Right2 nil)
    (setq Slope_Right Slope_Right2)
  )

  (SETQ X_Y 2.5)
  (setq X_Y2 X_Y)
  (setq X_Y2 (getreal (strcat "\nEnter X_Y value:< "
         (rtos X_Y2 2 1)
         " >: "
        )
      )
  )
  (if (/= X_Y2 nil)
    (setq X_Y X_Y2)
  )
  (SETQ C_D 1.5)
  (setq C_D2 C_D)
  (setq C_D2 (getreal (strcat "\nEnter C_D value:< "
         (rtos C_D2 2 1)
         " >: "
        )
      )
  )
  (if (/= C_D2 nil)
    (setq C_D C_D2)
  )


  (SETQ Coat_Length 32.0)
  (setq Coat_Length2 Coat_Length)
  (setq Coat_Length2
  (getreal (strcat "\nEnter Coat_Length value:< "
     (rtos Coat_Length2 2 1)
     " >: "
    )
  )
  )
  (if (/= Coat_Length2 nil)
    (setq Coat_Length Coat_Length2)
  )

  ;;Lapel_SB = How can add
  (command "layer" "make" "measurer" "c" "GREEN" "" "")
     ;(command "layer" "make" "Front" "color" "70" "" "ltype" "dot" "" "")
  ;;Start Point = O
  (SETQ O (GETPOINT "ENTER Startin POINT")) ;시발점.

  (if (= O nil)
    (setq O '(-50 0)) ;;Start point 엑세스안에있는 ' origin cordinates    ts.WriteLine ("0,0")
  )
  ;;------------------------------------
  (command "layer"
    "make"
    "measurement"
    "c"
    "GREEN"
    ""
    ""
    "TEXT"
    (polar O 0 25.0)
    0.375
    0.0
    (strcat "Date = " TODAY)
    "TEXT"
    ""
    (strcat "File Name = " COMMANDFILENAME)
    "TEXT"
    ""
    (strcat "Full Name = " FULLNAME)
    "TEXT"
    ""
    (strcat "Height = " (rtos Height 2 2))
    "TEXT"
    ""
    (strcat "Neck = " (rtos Neck 2 2))
    "TEXT"
    ""
    (strcat "Overarm = " (rtos Overarm 2 2))
    "TEXT"
    ""
    (strcat "Chest = " (rtos Chest 5 3))
    "TEXT"
    ""
    (strcat "Waist = " (rtos Waist 5 3))
    "TEXT"
    ""
    (strcat "Seat = " (rtos Seat 5 3))
    "TEXT"
    ""
    (strcat "Point = " (rtos Point 5 3))
    "TEXT"
    ""
    (STRCAT "CHEST_BACK =" (RTOS CHEST_BACK 5 3))
    "TEXT"
    ""
    (STRCAT "CHEST_FRONT =" (RTOS CHEST_FRONT 5 3))
    "TEXT"
    ""
    (STRCAT "BICEP =" (RTOS BICEP 5 3))
    "TEXT"
    ""
    (STRCAT "X_Y =" (RTOS X_Y 2 2))
    "TEXT"
    ""
    (STRCAT "C_D =" (RTOS c_d 2 2))
  )


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;이곳 위로가 문제가 있슴.;;;;;;;;;;;;;;;;


  ;;(command "layer" "make" "measurement" "c" "GREEN" "" "")
  (princ "1abcd")
  (command "layer" "make" "measurement" "c" "5" "" "")

  ;;보조치수.:CAL  
  (SETQ B_O (/ CHEST 2.0))
  (SETQ W_O (/ WAIST 2.0))
  (SETQ H_O (/ SEAT 2.0))
  ;;(SETQ C_L (+ (/ FULL_LENGTH 2.0) (CM_INCH 2.0))) ;C_L=COAT_LENGTH
  ;;(SETQ C_L
  (SETQ W_L (+ (/ FULL_LENGTH 4.0) (cm_inch 6.0)))
  ;;WAIST lENHTG:허리길이.
  (SETQ Hs (+ (* B_O 0.1) (CM_INCH 3.0))) ;깃대
  (SETQ SCYE_DEPTH (+ (/ B_O 4.0) (CM_INCH 11.0)))
  (SETQ OL2 (+ SCYE_DEPTH (CM_INCH 2.0))) ;앞어깨.
  (SETQ CHEST_BACK (+ (/ B_O 3.0) (CM_INCH 5.5)))
  (SETQ CHEST_SIDE (+ (/ B_O 4.0) (CM_INCH 5.0)))
  (SETQ CHEST_FRONT (+ (/ B_O 3.0) (CM_INCH 6.0)))
  ;;Short Data 정보 프린트
  (COMMAND
    "TEXT"
    (polar O (dtr 0.0) 15.0)
    0.375
    0.0
    (strcat "CHEST / 2 =" (RTOS B_O 2 2))

    (COMMAND "TEXT" "" (STRCAT "WAIST / 2 =" (RTOS W_O 2 2)))
    (COMMAND "TEXT" "" (STRCAT "SEAT / 2 =" (RTOS H_O 2 2)))
    (COMMAND "TEXT" "" (STRCAT "WAIST lENGTH =" (RTOS W_L 2 2)))
    (COMMAND "TEXT" "" (STRCAT "Hs =" (RTOS Hs 2 2)))
    (COMMAND "TEXT"
      ""
      (STRCAT "SCYE DEPTH =" (RTOS SCYE_DEPTH 2 2))
    )
    (COMMAND "TEXT" "" (STRCAT "OL2 =" (RTOS OL2 2 2)))
    (COMMAND "TEXT"
      ""
      (STRCAT "CHEST_BACK =" (RTOS CHEST_BACK 2 2))
    )
    (COMMAND "TEXT"
      ""
      (STRCAT "CHEST_SIDE =" (RTOS CHEST_SIDE 2 2))
    )
    (COMMAND "TEXT"
      ""
      (STRCAT "CHEST_FRONT =" (RTOS CHEST_FRONT 2 2))
    )
  )

  ;; (command "layer" "make" "BODY" "c" "5" "" "")

  ;; PID = - Y, PIU = + Y , 0.0 = + x, PI = - X,
  ;; PID = DTR 360, PIU = DTR 90 , DTR 180 = PI
  ;;(SETQ B (POLAR O 0.0 SCYE_DEPTH)) ;0.0 는 + X 우측으로

  ;;(COMMAND "LINE" B "@10,0.0" "")
  ;;신체의 8신

  (SETQ B (POLAR O PID SCYE_DEPTH))
  ;;(SETQ O1 (POLAR O PIU 0.5))
  (SETQ M2 (POLAR O PID (/ SCYE_DEPTH 2.0)))
  (SETQ w (POLAR O PID W_L))  ;WAIST LINE
  (SETQ H (POLAR w PID (CM_INCH 18.0))) ;HIP LINE
  (SETQ L (POLAR O PID COAT_LENGTH)) ;COAT LENGTH
  (SETQ H6 (POLAR H PI (CM_INCH 3.5)))
  (SETQ W7 (POLAR w PI 1.0))
  (SETQ W7 (INTERS M2 H6 w W7 nil))
  ;;(SETQ L8 (POLAR L (DTR 180.0) 1.0))
  (SETQ L8 (POLAR L PI 1.0))
  (SETQ L8 (INTERS W7 H6 L L8 nil))

  (SETQ W9 (POLAR W7 (DTR 180.0) (CM_INCH 1.0)))
  (SETQ C10 (POLAR B (DTR 180.0) 1.0))
  (SETQ C10 (INTERS M2 W9 B C10 nil))
  (SETQ H11 (INTERS W9 L8 H H6 nil))
  (SETQ C12 (POLAR C10 (DTR 180.0) CHEST_BACK))
  (SETQ O13 (LIST (CAR C12) (CADR O)))
  (SETQ O14 (POLAR O (DTR 180.0) Hs))
  (SETQ O15 (POLAR O14 (DTR 90.0) (CM_INCH 2.0)))
     ;(if (<= c_d 1.0)
     ; (setq P11 (polar P9 (DTR 180) (CM_INCH 1.5)))
     😉
     ;(if (and (> c_d 1.0) (<= c_d 1.5))
     ; (setq P11 (polar P9 (DTR 180) (CM_INCH 1.0)))
     😉
  (if (<= slope_left 1.4)
    (setq O16 (polar O13 (DTR 270) (CM_INCH 1.0)))
  )
  (if (>= slope_left 1.5)
    (setq O16 (polar O13 (DTR 270) (CM_INCH 1.5)))
  )
  (if (>= slope_left 2.0)
    (setq O16 (polar O13 (DTR 270) (CM_INCH 2.0)))
  )
  (if (>= slope_left 2.25)
    (setq O16 (polar O13 (DTR 270) (CM_INCH 2.25)))
  )
  (if (>= slope_left 2.5)
    (setq O16 (polar O13 (DTR 270) (CM_INCH 2.5)))
  )
  (if (>= slope_left 3.0)
    (setq O16 (polar O13 (DTR 270) (CM_INCH 3.0)))
  )


     ;(if (and (> slop_left 2.5) (<= slop_left 2.5))
     ; (setq O16 (polar O13 (DTR 270) (CM_INCH 2.5)))
     😉
     ;
     ;(SETQ O16 (POLAR O13 (DTR 270.0) (CM_INCH 2.0)))
  (SETQ O17 (POLAR O16 (DTR 180.0) (CM_INCH 2.0)))
  (SETQ O18 (POLAR O15 (DTR 90.0) (CM_INCH 0.5)))
  (SETQ O18 (POLAR O18 (DTR 180.0) (CM_INCH 0.5)))
  ;;(SETQ O1 (POLAR O (DTR 180.0) (/ (DISTANCE O O18) 3.0)))
  ;;(setq O1 (polar O (angle O O13) (cm_inch 3.5)))

  (SETQ C19 (POLAR C12 PIU (/ (DISTANCE C12 O13) 4.0)))
  (SETQ H20 (POLAR H11 (DTR 180.0) (+ (/ H_O 3.0) (CM_INCH 1.5))))
  (SETQ W21 (INTERS w W7 C12 H20 nil))
  (SETQ W22 (POLAR W21 0.0 (CM_INCH 1.5)))
  (SETQ L23 (POLAR L8 (- (ANGLE W9 L8) PIU) (DISTANCE H11 H20)))
  (SETQ C24 (POLAR C19 PI (CM_INCH 1.5)))
  (SETQ C24A (POLAR C24 0.0 0.375))
  (SETQ C25 (INTERS C10 C12 W22 C24 NIL))

  (SETQ C26 (POLAR C12 PI (+ CHEST_SIDE 3.5))) ;Front Start Point
  (SETQ W27 (POLAR C26 PID (DISTANCE B w)))
  (SETQ H28 (LIST (CAR C26) (CADR H)))
  (SETQ L28A (LIST (CAR C26) (CADR L)))
  (SETQ O29 (POLAR C26 PIU OL2))
  ;;(SETQ c30 (LIST (- (CAR c26) 10) (CADR c26))) ;-X
  (SETQ C30 (POLAR C26 (DTR 180.0) CHEST_FRONT))

  ;;(SETQ w31 (LIST (- (CAR w27) 11) (CADR w27))) ;-X

  (IF (>= (DISTANCE C26 C30) (/ WAIST 4.0))
    (SETQ W31 (POLAR W27 (DTR 180.0) (DISTANCE C26 C30)))
    (SETQ W31 (POLAR W27 pi (/ WAIST 4.0)))
  )
  ;;------------from autodesk communty---
  (cond
    ((<= CHEST 34)
     (setq e1_DIST 0.05)
    )
    ((<= CHEST 36)
     (setq e1_DIST 0.125)
    )
    ((<= CHEST 38)
     (setq e1_DIST 0.25)
    )
    ((<= CHEST 40)
     (setq e1_DIST 0.375)
    )
    ((>= CHEST 40.1)
     (setq e1_DIST 0.125)
    )
    (T
     (setq e1_DIST 0.0175)
    )
  )
  (SETQ C36 (POLAR C26 PI (/ (DISTANCE C26 C30) 2.0)))
  (SETQ C36 (POLAR C36 (dtr 0.0) e1_Dist))
  (COMMAND "TEXT"
    (polar C36 pid 0.375)
    0.25
    0.0
    (strcat "C36,C26 = " (rtos (distance C26 C36) 5 3))
  )
  (SETQ W35 (POLAR W31 0.0 (/ (DISTANCE W27 W31) 2.0))) ;앞판 배품 1/2
  (SETQ H32 (LIST (CAR w31) (CADR H))) ;
  (SETQ H32 (polar H28 pi (distance w27 w31)))
  (SETQ l33 (LIST (CAR w31) (CADR L))) ;
  (SETQ l34 (LIST (CAR l33) (- (CADR l33) 0.375))) ;
  (SETQ O37 (POLAR C36 (ANGLE W35 C36) (DISTANCE C26 O29)))
  (setq O38 (POLAR O37 0.0 (CM_INCH 1.25)))
  (SETQ O39 (POLAR O29 0.0 (DISTANCE O37 O38)))
  (setq O40 (polar o39 (angle o39 c26) (cm_inch 3.5)))
  (COMMAND "TEXT" "J" "_BL" o40 0.2 0 " ?")
  (SETQ O41 (POLAR O38
     (ANGLE O38 O40)
     (- (DISTANCE O17 O18) (CM_INCH 1.0))
     )
  )
  (SETQ W45A (POLAR W31 PI 0.625))
  (SETQ W45B (POLAR W45A PIU 1.0))
  (SETQ W45 (POLAR W45B PID 0.5))
  (SETQ W451 (POLAR W45 PID 1.0)) ;1ST BUTTON
  (SETQ W452 (POLAR W45 PID 4.25)) ;2ND BUTTON
  (SETQ H46 (POLAR H32 (DTR 0.0) (CM_INCH 7.0)))
  (SETQ H48 (POLAR H46 (DTR 0.0) (+ (* (/ H_O 3.0) 2.0) (CM_INCH 2.0))))
  (SETQ C47 (POLAR C26 (DTR 0.0) (+ CHEST_SIDE 2.0)))
  ;;Ad_SIDE겨드랑치수 + 5=자유치수
  (SETQ w49 (INTERS h48 c47 w w7 nil))
  (SETQ W50 (POLAR W49 PI 0.59))
  (SETQ C51 (POLAR C47 PIU (DISTANCE C12 C19)))
  (SETQ C51A (POLAR C51 PI 0.3))
  (SETQ L52 (POLAR W49 (ANGLE W49 H48) (DISTANCE W22 L23)))
  (setq L52A (LIST (+ (CAR L52) 0.75) (CADR L52)))
  (SETQ p (LIST (CAR w27) (- (CAdr w27) 3.75))) ;-Y
  (setq c53 (list (+ (car c26) 1.5748) (cadr c26)))
  (setq p54 (list (+ (car p) 1) (cadr p)))
  (SETQ h55 (POLAR h28 (DTR 0.0) 1.0))
  (setq c56 (list (+ (car c53) 0.74) (cadr c53)))
  (setq p57 (list (+ (car p54) 1.125) (cadr p54)))
  (setq h58 (list (+ (car h55) 0.75) (cadr h55)))
  (SETQ H58A (LIST (+ (CAR H58) 0.2) (CADR H58))) ;ALT
  (setq c59 (POLAR C56 (DTR 0.0) (DISTANCE C12 C25)))

  ;;SLEEVE POINT 이곳에서부터 소매를 위하여.S로 시작하는 point 는 소매.
  ;;(SETQ U (POLAR C26 PIU (CM_INCH 3.0)))
  (SETQ U (POLAR C26 PIU (- (/ CHEST_SIDE 4.0) (CM_INCH 1.0))))
  (SETQ U1 (POLAR C26 (ANGLE C26 O39) (/ SCYE_DEPTH 4.0)))
  (SETQ Z (POLAR O17 (ANGLE O17 O41) (/ (DISTANCE O17 O41) 2.0)))
  (SETQ X_S (POLAR Z PID 1.0))
  (SETQ X_S (INTERS Z X_S C26 C47 NIL))
  (SETQ
    Y (POLAR X_S PIU (+ (/ (DISTANCE Z X_S) 2.0) (CM_INCH 1.5)))
  )
  (SETQ V (POLAR C12 PIU (DISTANCE X_S Y)))
  (SETQ K (POLAR C26 (ANGLE C26 O39) (DISTANCE X_S Y)))
  (SETQ K (POLAR K 0.0 0.5))
  (SETQ
    G (POLAR Y PIU (+ (/ (DISTANCE Y Z) 2.0) (CM_INCH 1.5)))
  )
  (SETQ V_1 (LIST (- (CAR V) 0.11) (CADR V))) ;
  (setq L53 (list (car h58) (cadr L)))

  (setq wa (inters c53 p c26 p54 nil))
  (setq wS (inters C59 L53 w W7 nil))
  (SETQ WS (POLAR WS PI 0.5))
  (SETQ WAS (LIST (+ (CAR WS) 0.25) (CADR WS))) ;SIDE WAIST POINT.

  (setq px (list (car w35) (cadr P)))
  (SETQ p1 (LIST (CAR px) (- (CAdr px) 0.375))) ;-Y 0.125
  (SETQ p2 (LIST (+ (CAR p1) 0.75) (CADR p1))) ;+
  (SETQ p3 (LIST (+ (CAR p2) 0.25) (CADR p2))) ;+
  (SETQ p4 (LIST (+ (CAR p3) 0.25) (CADR p3))) ;+
  (SETQ CS (POLAR C59 (DTR 0.0) (/ (DISTANCE C59 C47) 2.0)))
  (SETQ CS (POLAR CS PIU 0.375))


  (SETQ L35 (INTERS P54 H55 L33 L52 NIL))
  (SETQ l35a (LIST (+ (CAR l35) 0.25) (CADR l35))) ;+X
  (SETQ l35b (LIST (CAR l35a) (+ (CAdr l35a) 0.25))) ;+Y
  (SETQ p55a (LIST (- (CAR p54) 0.5) (CADR p54))) ;-X
  (SETQ p55 (LIST (CAR p55a) (- (CAdr p55a) 0.125))) ;-Y
  (SETQ R (LIST (- (CAR O38) 0.75) (CADR O38))) ;NECK POINT
  (SETQ WS (INTERS L53 C59 w W7 nil))
  (SETQ WS1 (LIST (+ (CAR WS) 0.3) (CADR WS)))
     ;(cm_inch 0.5)
  (SETQ W50AB (LIST (+ (CAR W50) 0.5) (CADR W50)))
  (SETQ H48AB (LIST (+ (CAR H48) 0.4) (CADR H48)))
  (SETQ P57A (LIST (+ (CAR P57) 0.2) (CADR P57)))
  ;;For Lapel *Notched SB Lapel Start
  (SETQ LP_1 (POLAR R (ANGLE R W45B) 3.5))
  (SETQ LP_2 (POLAR LP_1 (+ (ANGLE W45B R) PIU) 3.0)) ;PIU=-PI 1/2
  ;;(SETQ L23 (POLAR L8 (- (ANGLE W9 L8) PIU) (DISTANCE H11 H20)))
  (SETQ LP_3 (POLAR LP_1 (ANGLE LP_1 R) 1.75))
  (SETQ LP_3 (POLAR LP_3 (ANGLE LP_2 LP_3) 1.125))
  (command "layer" "make" "BODY" "c" "5" "" "")
  (command "layer" "make" "BODY_Back" "color" "70" "" "ltype" "dashed"
    "" "")
  (command "layer" "make" "BODY_Side" "color" "70" "" "ltype" "dashed"
    "" "")
  (command "layer"    "make"  "BODY_Front"        "color"
    "70"       ""  "ltype"    "dashed"   ""
    ""
   )

  ;;Draw Lapel area 다음에 옮길것 위치를
  (COMMAND "PLINE" LP_1 LP_2 LP_3 O38 "")
  (COMMAND "_.arc" LP_2 "_e" W45B "_R" 80)
  (setq Text_Size 1.0)
  (COMMAND "TEXT" "J" "_BL" LP_1 Text_Size 0 " LP_1")
  (COMMAND "TEXT" "J" "_BL" LP_2 Text_Size 0 " LP_2")
  (COMMAND "TEXT" "J" "_BL" LP_3 Text_Size 0 " LP_3")
;;;Line Start Body
  (COMMAND "LINE" C12 O13 "")
  (COMMAND "LINE" O L "")
  (COMMAND "LINE" W9 L8 "")
  (COMMAND "LINE" O O13 "")
  (COMMAND "LINE" O14 O15 "")
  (COMMAND "LINE" O16 O17 "")
  (COMMAND "LINE" O17 O15 "")
  (COMMAND "LINE" O17 O18 "")
     ;(princ "1111")
  (COMMAND "ARC" O M2 C10)
  (COMMAND "LINE" C10 W9 "")
  (COMMAND "LINE" W22 H20 "")
  (COMMAND "LINE" L8 L23 "")
  (COMMAND "ARC" O17 V_1 C24A)
  (setq Arc_4 (entlast))
  (setq eget (entget Arc_4))
  (setq
    startang (cdr (assoc 50 eget))
    endang   (cdr (assoc 51 eget))
    arc_len4
      (*
        (if (< startang endang) ; does not cross zero-degree direction?
   (- endang startang) ; then -- simple subtraction
   (+ (- (* pi 2) startang) endang)
     ; else -- compensation
        )   ; if
        (cdr (assoc 40 eget)) ; radius
      )    ; end * & arc_len
  )     ; setq
  (COMMAND "LINE" W22 C24 "")
  (COMMAND "LINE" H11 H20 "")
  (COMMAND "LINE" W9 W22 "")
  (COMMAND "LINE" C10 C12 "")
  (COMMAND "LINE" C24 C24A "")
  (COMMAND "LINE" L23 H20 "")
  (command "line" o39 c26 "")
  (COMMAND "LINE" c26 c30 "")
  (COMMAND "LINE" c30 w31 "")
  (COMMAND "LINE" w31 l34 "")
  (COMMAND "LINE" w35 c36 "")
  (COMMAND "LINE" c36 o38 "")
  (COMMAND "LINE" o38 o39 "")
  (command "line" o29 c26 "")
  (command "line" w27 w31 "")
  (command "line" c26 L28A "")
  (command "line" H32 h55 "")
  (command "line" o40 o41 "")
  (command "line" o38 o41 "")
  (command "line" o41 c26 "")
  (command "line" w27 w49 "")
  (command "line" l52A L53 "")
  (command "line" l52A h48AB "")
  (COMMAND "LINE" C51A C51 "")
  (command "line" p1 p54 "")
  (command "line" c47 c59 "")
  (command "line" c26 c53 "")

  (command "line" p55 p1 "")
  ;;(command "line" w45b l34 "")
  (command "line" l35b l34 "")
  (setq e1 (entlast))
  (command "line" w45b L34 "")
  (COMMAND "ARC" W45B W452 L34)
  (setq e2 (entlast))
  (command "fillet" "r" 2.5)  ;R= radis
  (command "fillet" e1 e2)

  (command "arc" c53 wa p54)
     ;(COMMAND "ARC" O ON O18)
     ;(COMMAND "LINE" O O1 "")
     ;(COMMAND "LINE" O "@-1,0" "")
     ;(COMMAND "ARC" "" O18)
  (COMMAND "_.arc" O "_e" O18 "_D" O17)

  (command "arc" c59 CS c51A)
  (setq Arc_3 (entlast))
  (setq eget (entget Arc_3))
  (setq
    startang (cdr (assoc 50 eget))
    endang   (cdr (assoc 51 eget))
    arc_len3
      (*
        (if (< startang endang) ; does not cross zero-degree direction?
   (- endang startang) ; then -- simple subtraction
   (+ (- (* pi 2) startang) endang)
     ; else -- compensation
        )   ; if
        (cdr (assoc 40 eget)) ; radius
      )    ; end * & arc_len
  )     ; setq

  (COMMAND "ARC" L23 H20 W22)
  (command "arc" l35b h55 p55)
  (COMMAND "ARC" C51 C47 W50AB)
  (COMMAND "ARC" C59 WS1 P57S)
  (COMMAND "ARC" P57S H58 L59)
  (COMMAND "ARC" C59 WAS H58A)
  (COMMAND "ARC" W50AB H48AB L52A)
  (COMMAND "LINE" H58A L53 "")
  (command "line" w45b R "")
  (COMMAND "LINE" O38 O40 "")
  (COMMAND "LINE" V K "")
  (COMMAND "LINE" G X_S "")
  ;;(COMMAND "LINE" P3 "@0,9.25" "")
  (command "line"
    P3
    (polar P3 (angle w35 c36) (- (distance P3 c36) 2.5))
    ""
  )
  (COMMAND "ARC" O41 K U1)
  ;;앞 몸판 소매구리 구함.
  (setq Arc_1 (entlast))
  (setq eget (entget Arc_1))
  (setq
    startang (cdr (assoc 50 eget))
    endang   (cdr (assoc 51 eget))
    arc_len
      (*
        (if (< startang endang) ; does not cross zero-degree direction?
   (- endang startang) ; then -- simple subtraction
   (+ (- (* pi 2) startang) endang)
     ; else -- compensation
        )   ; if
        (cdr (assoc 40 eget)) ; radius
      )    ; end * & arc_len
  )     ; setq


  (COMMAND "ARC" "" C53)
  (setq Arc_2 (entlast))
  (setq eget (entget Arc_2))
  (setq
    startang (cdr (assoc 50 eget))
    endang   (cdr (assoc 51 eget))
    arc_len2
      (*
        (if (< startang endang) ; does not cross zero-degree direction?
   (- endang startang) ; then -- simple subtraction
   (+ (- (* pi 2) startang) endang)
     ; else -- compensation
        )   ; if
        (cdr (assoc 40 eget)) ; radius
      )    ; end * & arc_len
  )     ; setq

  (command "layer" "make" "data" "c" "5" "" "")
  (COMMAND "TEXT"
    (polar Y (dtr 0.0) 4.0)
    0.5
    0.0
    (strcat "O41,C26 = " (rtos (DISTANCE O41 C26) 5 3))
  )
  (SETQ Armhole (+ arc_len arc_len2 arc_len3 arc_len4))
  (COMMAND "TEXT"
    (polar U1 (dtr 0.0) 0.75)
    0.25
    0.0
    (strcat "ARC_LENGTH = " (rtos Armhole 5 3))
  )


  ;;Sleeve 소매만들기 시작 Point Name Use Same Muller.ABC
  ;;(setq P1 (polar O (dtr 270) (- (distance O L) inseam)))
  ;;(SETQ SL_Depth (- (/(+ (distance c26 O41) (distance c25 o17)) 2.0) (CM_INCH 1.0) ))

  (command "layer" "make" "Sleeve" "color" "50" "" "ltype" "dot" "" "")
  (command "layer" "make" "TEXT_Sleeve" "Color" "5" "" "")
  (SETQ SL_Depth (distance X_S G))
  (SETQ S_O (POLAR B (DTR 0.0) 1.5))
  (SETQ S_O (POLAR S_O PIU SL_Depth))
  (COMMAND "TEXT" "J" "_BL" S_O 0.2 0 "S_O")
  ;;(SETQ S_2 (POLAR S_O PID (+ Sleeve_Outseam 0.375)))
  ;;(COMMAND "TEXT" "J" "_BL" S_2 0.2 0 "S_2")

  (SETQ S_3 (POLAR S_O (DTR 0.0) (/ (distance X_S Z) 4.0)))
  (COMMAND "TEXT" "J" "_BL" S_3 0.2 0 "S_3")
  (SETQ S_D (POLAR S_O PID SL_Depth))
  (COMMAND "TEXT" "J" "_BL" S_D 0.2 0 "S_D")

  (SETQ S_U (POLAR S_D PIU (- (DISTANCE C26 U) (cm_inch 1.0))))
  (COMMAND "TEXT" "J" "_BL" S_U 0.2 0 "S_U")
  ;;- 1cm 다음에 확인.
  (SETQ S_1 (POLAR S_D PIU (distance X_S Y)))
  (COMMAND "TEXT" "J" "_BL" S_1 0.2 0 "S_1")
  (SETQ S_L (POLAR S_O PID (- Sleeve_Outseam (cm_inch 0.5))))
  ;;나중에 스퀘어 루트이용하여 다시 만듬.
  (COMMAND "TEXT" "J" "_BL" S_L 0.2 25 "S_L")
  (SETQ S_K (POLAR S_U
     (ANGLE S_U S_3)
     (+ (distance U K) (cm_inch 0.9))
     )
  )
  (SETQ S_4 (POLAR S_L PID (cm_inch 3.0)))
  (COMMAND "TEXT" "J" "_BL" S_4 0.2 0 "S_4")

  (SETQ S_5 (POLAR S_4 (DTR 0.0) (cm_inch 14.5)))
  (COMMAND "TEXT" "J" "_BL" S_5 0.2 0 " S_5")
  (SETQ
    S_6 (POLAR S_D PID (- (/ (distance S_D S_L) 2.0) (cm_inch 1.5)))
  )
  (COMMAND "TEXT" "J" "_BL" S_6 0.2 0 "S_6")
  (SETQ S_7 (POLAR S_D pi (cm_inch 2.0)))
  (COMMAND "TEXT" "J" "_Br" S_7 0.2 0 "S_7")

  (SETQ S_8 (POLAR S_7 PIU (cm_inch 0.8)))
  (COMMAND "TEXT" "J" "_BL" S_8 0.2 0 "S_8")
  (SETQ S_9 (POLAR S_6 pi (cm_inch 0.5)))
  (COMMAND "TEXT" "J" "_TR" S_9 0.2 0 "S_9")
  (SETQ S_10 (POLAR S_L pi (cm_inch 2.0)))
  (COMMAND "TEXT" "J" "_BL" S_10 0.2 -90 "S_10")

  ;;(SETQ AH_S_2 (POLAR S_O (DTR 0.0) (- (sqrt (+ (distance K O41) (cm_inch 1.2))) sqrt (distance S_U S_)))))
  (setq AH_S_2 (/ armhole 2.0))
  (setq AH_U_O (distance S_U S_O))
  (SETQ S_qrt (POLAR S_O
       (dtr 0.0)
       (sqrt (- (* AH_S_2 AH_S_2) (* AH_U_O AH_U_O)))
       )
  )
  ;;(SETQ S_qrt (POLAR S_O (dtr 0.0) (sqrt (- (* 10.75 10.75) (* 6.0514 6.0514) ))))
  (COMMAND "TEXT" "J" "_BL" S_qrt 0.5 90 "S_qrt")
  (command "line" S_qrt S_U "")
  (SETQ TS_X (POLAR S_O (DTR 0.0) (distance S_1 S_K)))
  (setq TS_a (+ (distance K O41) (cm_inch 1.2)))
  (setq TS_a (* TS_a 2.0))
  (setq TS_b (distance S_k TS_x))
  (setq TS_b (* TS_b 2.0))
  (setq TS_c (- TS_a TS_b))
  (SETQ S_TS (POLAR TS_x (DTR 0.0) TS_c))
  (COMMAND "TEXT" "J" "_BL" S_TS 0.2 0 "S_TS")
  (SETQ S_xx (POLAR S_1 (DTR 0.0) (distance S_TS S_O)))
  (COMMAND "TEXT" "J" "_BL" S_xx 0.2 0 "S_xx")
  (SETQ S_X (POLAR S_TS PID (distance S_O S_U)))
  (COMMAND "TEXT" "J" "_BL" S_x 0.2 0 "S_x")
  ;;(setq V_a (+ (distance G X_S) (cm_inch 2.4)))
  (setq V_a (+ (distance O17 V) (cm_inch 1.1)))
  (setq V_a (* V_a 2.0))
  (setq U_a (distance S_1 S_O))
  (setq U_a (* U_a 2.0))
  (setq VU_a (- V_a U_a))

  (setq AH_S63 (+ (distance O17 V) (cm_inch 3.2)))
  (setq AH_U_1 (distance S_1 S_O))
  (SETQ S_V (POLAR S_xx
     (dtr 0.0)
     (sqrt (- (* AH_S63 AH_S63) (* AH_U_1 AH_U_1)))
     )
  )
  ;;(SETQ S_V (POLAR S_xx (dtr 0.0) (sqrt (- (* 4.39 4.39) (* 2.32 2.32) ))))

     ;(SETQ S_V (polar S_xx (dtr 0.0) VU_a))
  (COMMAND "TEXT" "J" "_BL" S_V 0.2 0 "S_V")

  ;;(SETQ S_2 (POLAR S_O (dtr 0.0) (sqrt (- (* AH_S_2 AH_S_2) (* AH_U_O AH_U_O) ))))
  (SETQ S_2 (POLAR S_O (dtr 0.0) (distance S_QRT S_O)))
  (COMMAND "TEXT" "J" "_BL" S_2 0.2 0 "S_2")
  (SETQ S_7x (LIST (CAR S_2) (CADR S_7)))
  (COMMAND "TEXT" "J" "_BL" S_7x 0.2 0 "S_7x")
  (SETQ S_7xx (polar s_d (dtr 0.0) 2.5))
  (SETQ S_7xx (polar s_7xx piu 0.2))
  (COMMAND "TEXT" "J" "_BL" S_7xx 0.2 0 "S_7xx")
  (SETQ S_11 (INTERS S_V S_5 s_9 S_6 nil))
  (COMMAND "TEXT" "J" "_BL" S_11 0.2 90 "S_11")
  (SETQ S_12 (POLAR S_11 (DTR 0.0) (cm_inch 2.7)))
  (COMMAND "TEXT" "J" "_BL" S_12 0.2 0 "S_12")
  (SETQ S_13 (POLAR S_2 PID (/ (DISTANCE S_V S_2) 3)))
  (SETQ S_13 (INTERS S_1 S_V S_X S_13 nil))


  (COMMAND "TEXT" "J" "_BL" S_13 0.2 90 " S_13")
  (SETQ S_14 (polar s_13 (dtr 0.0) (cm_inch 1.5)))
  (COMMAND "TEXT" "J" "_BL" S_14 0.2 90 " S_14")
  (SETQ S_13 (POLAR S_13 (ANGLE S_X S_13) 0.5))
  (SETQ S_15 (POLAR S_12 pi (cm_inch 0.8)))
  (COMMAND "TEXT" "J" "_BL" S_15 0.2 -90 "S_15")
  (SETQ S_16 (POLAR S_D (DTR 0.0) (cm_inch 1.7)))
  (SETQ S_16 (POLAR S_16 PIU 0.75))
  (COMMAND "TEXT" "J" "_BL" S_16 0.2 0 "S_16")
  (SETQ S_17 (POLAR S_9 (DTR 0.0) (cm_inch 3.7)))
  (COMMAND "TEXT" "J" "_BL" S_17 0.2 0 "S_17")
  (SETQ S_18 (POLAR S_L (DTR 0.0) (cm_inch 1.0)))
  (COMMAND "TEXT" "J" "_BL" S_18 0.2 0 " S_18")

  (SETQ S_K (POLAR S_U
     (ANGLE S_U S_3)
     (+ (distance U K) (cm_inch 0.9))
     )
  )
  (COMMAND "TEXT" "J" "_BL" S_K 0.2 0 "S_K")
     ;(SETQ S_x (POLAR S_O (DTR 0.0) (distance S_1 S_K)))


  (setq TS_1 (+ (distance V O17) (cm_inch 1.1)))
  (setq TS_1 (* TS_1 2.0))
  (setq TS_2 (distance S_TS S_xx))
  (setq TS_2 (* TS_2 2.0))
  (setq TS_2 (- TS_1 TS_2))
  (SETQ S_TS2 (POLAR S_xx (DTR 0.0) TS_2))
  (COMMAND "TEXT" "J" "_BL" S_TS2 0.2 90 " S_TS2")
;;;;;
  (setq arc_1 (sqrt (- (* 3.35 3.35) (* 2.47 2.47))))
  ;;이곳을 이용하여 보자.

  ;;(SETQ O29 (POLAR C26 PIU OL2))

  (command "layer" "make" "TEXT_Sleeve" "Color" "5" "" "")


  ;;S_1 from 박종규 북 Page 26

  (command "layer" "make" "Sleeve" "color" "50" "" "ltype" "dot" "" "")
  (command "layer" "make" "Sleeve" "color" "30" "" "ltype" "dashed" ""
    "")
  (COMMAND "CIRCLE" S_TS "0.06")
  (COMMAND "CIRCLE" S_K "0.06")
  ;; Line 을 모아둔곳  ???
;;;(COMMAND "LINE" S_D (polar S_D 0.0 5.0) "")
  ;; + X ;= 이곳에 있는 0.0 은 각도. 5.0 은 거리.
;;;(COMMAND "LINE" S_D (polar S_D pi 5.0) "")
  ;; + X ;= 이곳에 있는 0.0 은 각도.
;;;(COMMAND "LINE" S_D (polar S_D (dtr 180) 11) "")
  ;; - X = Pi 와 같음.
;;;(COMMAND "LINE" S_D (polar S_D pid 11) "")
  ;; - Y
;;;(COMMAND "LINE" S_D (polar S_D piu 11) "")
  ;; + Y
;;;(COMMAND "LINE" S_D (polar S_D (ANGLE S_U S_V) 15) "")
  ;; - X
  ;;(COMMAND "LINE"
     ;    S_D
     ;    (polar S_D (angle S_O S_ts) (distance S_O S_2))
     ;    ""
     ; )
  ;; + X

  (COMMAND "LINE" S_5 S_4 S_O S_2 "")
  (COMMAND "LINE" S_L S_5 "")
  (COMMAND "LINE" S_1 S_V "")
  (COMMAND "LINE" S_U S_V "")
  (COMMAND "LINE" S_6 S_15 "")
  (COMMAND "LINE" S_O S_2 S_V "")
  (COMMAND "LINE" S_7 S_7x "")
  (COMMAND "LINE" S_3 S_U "")
  (COMMAND "ARC" "" S_8)
  (setq Arc_S_8 (entlast))
  (setq eget (entget Arc_S_8))
  (setq
    startang (cdr (assoc 50 eget))
    endang   (cdr (assoc 51 eget))
    arc_S_8
      (*
        (if (< startang endang) ; does not cross zero-degree direction?
   (- endang startang) ; then -- simple subtraction
   (+ (- (* pi 2) startang) endang)
     ; else -- compensation
        )   ; if
        (cdr (assoc 40 eget)) ; radius
      )    ; end * & arc_len
  )     ; setq
  (COMMAND "LINE" S_x S_TS "")
  (COMMAND "LINE" S_TS S_V "")

  (COMMAND "ARC" S_k S_TS S_V)
  (setq Arc_sl (entlast))
  (setq eget (entget Arc_sl))
  (setq
    startang (cdr (assoc 50 eget))
    endang   (cdr (assoc 51 eget))
    arc_SLT
      (*
        (if (< startang endang) ; does not cross zero-degree direction?
   (- endang startang) ; then -- simple subtraction
   (+ (- (* pi 2) startang) endang)
     ; else -- compensation
        )   ; if
        (cdr (assoc 40 eget)) ; radius
      )    ; end * & arc_len
  )     ; setq

  (COMMAND "ARC" S_8 S_9 S_10)
  (setq Arc_S_10 (entlast))
  (setq eget (entget Arc_S_10))
  (setq
    startang (cdr (assoc 50 eget))
    endang   (cdr (assoc 51 eget))
    arc_S_10
      (*
        (if (< startang endang) ; does not cross zero-degree direction?
   (- endang startang) ; then -- simple subtraction
   (+ (- (* pi 2) startang) endang)
     ; else -- compensation
        )   ; if
        (cdr (assoc 40 eget)) ; radius
      )    ; end * & arc_len
  )     ; setq
  (COMMAND "ARC" S_16 S_17 S_18)
  (setq Arc_S_18 (entlast))
  (setq eget (entget Arc_S_18))
  (setq
    startang (cdr (assoc 50 eget))
    endang   (cdr (assoc 51 eget))
    arc_S_18
      (*
        (if (< startang endang) ; does not cross zero-degree direction?
   (- endang startang) ; then -- simple subtraction
   (+ (- (* pi 2) startang) endang)
     ; else -- compensation
        )   ; if
        (cdr (assoc 40 eget)) ; radius
      )    ; end * & arc_len
  )     ; setq
  (COMMAND "ARC" S_14 S_15 S_5)
  (COMMAND "ARC" S_V S_12 S_5)
  (COMMAND "LINE" S_L S_5 S_V "")
  (COMMAND "LINE" S_13 S_14 "")
  (COMMAND "LINE" S_13 S_X "")
  (COMMAND "ARC" S_X S_7xx S_16)
  (setq Arc_S_16 (entlast))
  (setq eget (entget Arc_S_16))
  (setq
    startang (cdr (assoc 50 eget))
    endang   (cdr (assoc 51 eget))
    arc_S_16
      (*
        (if (< startang endang) ; does not cross zero-degree direction?
   (- endang startang) ; then -- simple subtraction
   (+ (- (* pi 2) startang) endang)
     ; else -- compensation
        )   ; if
        (cdr (assoc 40 eget)) ; radius
      )    ; end * & arc_len
  )     ; setq

  (command "layer"     "make"    "Sleeve_DATA_TEXT"    "color"
    "50"        ""    "ltype"     "dot"    ""
    ""
   )
  (COMMAND
    "TEXT"
    (polar S_16 (dtr 0.0) 10.0)
    0.25
    0.0

    (strcat "S631,O41 = " (rtos (DISTANCE K O41) 2 2))
    (COMMAND "TEXT"
      ""
      (strcat "S_K,S_TS = " (rtos (DISTANCE S_K S_TS) 2 2))
    )
    (COMMAND "TEXT"
      ""
      (strcat "O17,S63 = " (rtos (DISTANCE O17 V) 2 2))
    )
    (COMMAND "TEXT"
      ""
      (strcat "S_TS,S_V = " (rtos (DISTANCE S_TS S_V) 2 2))
    )
    (COMMAND "TEXT"
      ""
      (strcat "S_TS,S_TS2 = "
       (rtos (DISTANCE S_TS S_TS2) 2 2)
      )
    )
  )

  (COMMAND "TEXT"
    (polar S_17 (dtr 0.0) 10.0)
    0.375
    0.0
    (strcat "Arc_1 =" (RTOS Arc_1 2 2))

    (COMMAND "TEXT" "" (strcat "TS_a =" (RTOS TS_a 2 2)))
    (COMMAND "TEXT" "" (strcat "TS_b =" (RTOS TS_b 2 2)))
    (COMMAND "TEXT" "" (strcat "TS_c =" (RTOS TS_c 2 2)))
    (COMMAND "TEXT" "" (strcat "TS_1 =" (RTOS TS_1 2 2)))
    (COMMAND "TEXT" "" (strcat "TS_2 =" (RTOS TS_2 2 2)))
    (COMMAND "TEXT" "" (strcat "AH_S_2 =" (RTOS AH_S_2 5 3)))
    (COMMAND "TEXT" "" (strcat "AH_U_O =" (RTOS AH_U_O 2 2)))
    (COMMAND "TEXT"
      ""
      (strcat "S_O, S_qrt ="
       (RTOS (distance S_O S_qrt) 2 2)
      )
    )
    (COMMAND "TEXT"
      ""
      (strcat "TopSleeve_arc ="
       (RTOS (+ arc_SLT
         (distance S_U S_k)
         ARC_S_8
         ARC_S_16
         (distance S_13 S_X)
      )
      2
      2
       )
       ;;Arc_slt
      )
    )
    (COMMAND "TEXT"
      ""
      (strcat "Sleeve_IN_10 =" (RTOS arc_S_10))
    )
    (COMMAND "TEXT"
      ""
      (strcat "Sleeve_IN_18 =" (RTOS arc_S_18))
    )
  )

;;;;Body text 몸판 텍트

  (command "layer" "make" "TEXT_Body" "Color" "5" "" "")
  (COMMAND "TEXT" "J" "_BL" B 0.375 0 " B")
  (COMMAND "TEXT" "J" "_BL" M2 0.2 0 " M2")
  (COMMAND "TEXT" "J" "_BL" w 0.2 0 " W")
  (COMMAND "TEXT" "J" "_BL" H 0.2 0 " H")
  (COMMAND "TEXT" "J" "_BL" L 0.2 0 " L")
  (COMMAND "TEXT" "J" "_BL" H6 0.2 0 " H6")
  (COMMAND "TEXT" "J" "_BL" W7 0.2 0 " W7")
  (COMMAND "TEXT" "J" "_Br" L8 0.2 0 " L8")
  (COMMAND "TEXT" "J" "_Br" W9 0.2 0 " W9")
  (COMMAND "TEXT" "J" "_Bright" C10 0.2 0 "C10")
  (COMMAND "TEXT" "J" "_BR" H11 0.2 0 " H11")
  (COMMAND "TEXT" "J" "_BL" C12 0.2 45 " C12")
  (COMMAND "TEXT" "J" "_BL" O13 0.2 90 " O13")
  (COMMAND "TEXT" "J" "_BL" O14 0.2 -90 " O14")
  (COMMAND "TEXT" "J" "_BL" O15 0.2 45 " O15")
  (COMMAND "TEXT" "J" "_BL" O16 0.2 -45 " O16")
  (COMMAND "TEXT" "J" "_BL" O17 0.2 90 " O17")
  (COMMAND "TEXT" "J" "_BL" O18 0.2 90 " O18")

  (COMMAND "TEXT" "J" "_BL" C19 0.2 0 " C19")
  (COMMAND "TEXT" "J" "_BL" H20 0.2 90 " 9+H20")
  (COMMAND "TEXT" "J" "_Br" W21 0.2 0 " W21")
  (COMMAND "TEXT" "J" "_BL" W22 0.2 0 " W22")
  (COMMAND "TEXT" "J" "_BL" L23 0.2 0 " L23")
  (COMMAND "TEXT" "J" "_BL" C24 0.2 90 " C24")
  (COMMAND "TEXT" "J" "_BL" C24A 0.2 -45 " C24A")
  (COMMAND "TEXT" "J" "_BL" C25 0.2 -45 " C25")

  (COMMAND "TEXT" "J" "_BL" O 0.2 0 " O")
  '(COMMAND "TEXT" "J" "_BL" O1 0.2 0 " O1")
  (COMMAND "TEXT" "J" "_BR" C26 0.2 0 " C26")
  (COMMAND "TEXT" "J" "_BL" W27 0.2 0 " W27")
  (COMMAND "TEXT" "J" "_BL" H28 0.2 0 " H28")
  (COMMAND "TEXT" "J" "_BL" L28A 0.2 -90 " L28A")
  (COMMAND "TEXT" "J" "_Br" O29 0.2 0 " O29")
  (COMMAND "TEXT" "J" "_BL" C30 0.2 0 " 11=C30")
  (COMMAND "TEXT" "J" "_BL" W31 0.2 0 " 12=W31")
  (COMMAND "TEXT" "J" "_BL" C36 0.2 0 " 13=C36")
  (COMMAND "TEXT" "J" "_BL" W35 0.2 0 " 14=W35")
  (COMMAND "TEXT" "J" "_BL" H32 0.2 0 " H32")
  (COMMAND "TEXT" "J" "_BL" L33 0.2 0 " L33")
  (COMMAND "TEXT" "J" "_BL" L34 0.2 0 " L34")
  (COMMAND "TEXT" "J" "_TR" O37 0.2 0 " O37")
  (COMMAND "TEXT" "J" "_BL" O38 0.2 0 " O38")
  (COMMAND "TEXT" "J" "_BL" O39 0.2 0 " O39")
  (COMMAND "TEXT" "J" "_BL" O40 0.2 0 " O40")
  (COMMAND "TEXT" "J" "_BL" O41 0.2 0 " O41")
  (COMMAND "TEXT" "J" "_BR" W45A 0.2 0 " W45A")
  (COMMAND "TEXT" "J" "_BR" W45B 0.2 0 " W45B")
  (COMMAND "TEXT" "J" "_BR" W451 0.2 0 " W451")
  (COMMAND "TEXT" "J" "_BR" W452 0.2 0 " W452")
  (COMMAND "TEXT" "J" "_BL" H46 0.2 0 " H46")
  (COMMAND "TEXT" "J" "_BR" H48 0.2 0 " H48")
  (COMMAND "TEXT" "J" "_Mr" C47 0.2 90 " C47")
  (COMMAND "TEXT" "J" "_BL" W49 0.2 90 " W49")
  (COMMAND "TEXT" "J" "_MR" W50 0.2 90 " W50")
  (COMMAND "TEXT" "J" "_BL" C51 0.2 90 " C51")
  (COMMAND "TEXT" "J" "_BR" L52 0.2 0 " L52")
  (COMMAND "TEXT" "J" "_BL" L52A 0.2 0 " L52A")
  (COMMAND "TEXT" "J" "_BR" P 0.2 0 " P")
  (COMMAND "TEXT" "J" "_BL" C53 0.2 90 " C53")
  (COMMAND "TEXT" "J" "_BL" P54 0.2 0 " P54")
  (COMMAND "TEXT" "J" "_BL" H55 0.2 0 " H55")
  (COMMAND "TEXT" "J" "_BL" C56 0.2 90 " C56")
  (COMMAND "TEXT" "J" "_BL" P57 0.2 0 " P57")
  (COMMAND "TEXT" "J" "_BL" H58 0.2 0 " H58")
  (COMMAND "TEXT" "J" "_BL" H58A 0.2 -90 " H58A")
  (COMMAND "TEXT" "J" "_BL" C59 0.2 90 " C59")
  (COMMAND "TEXT" "J" "_BL" L53 0.2 0 " L53")
  (COMMAND "TEXT" "J" "_BL" C51A 0.2 90 " C51A")
  (COMMAND "TEXT" "J" "_BL" WA 0.2 0 " WA")
  (COMMAND "TEXT" "J" "_BL" WS 0.2 0 " WS")
  (COMMAND "TEXT" "J" "_BR" WAS 0.2 0 " WAS")
  (COMMAND "TEXT" "J" "_BL" PX 0.2 0 " PX")
  (COMMAND "TEXT" "J" "_BR" P1 0.2 90 " P1")
  (COMMAND "TEXT" "J" "_BL" P2 0.2 -90 " P2")
  (COMMAND "TEXT" "J" "_BL" P3 0.2 90 " P3")
  (COMMAND "TEXT" "J" "_BL" P4 0.2 -90 " P4")
  (COMMAND "TEXT" "J" "_Br" CS 0.2 0 " CS")
  (COMMAND "TEXT" "J" "_BR" L35 0.2 0 " L35")
  (COMMAND "TEXT" "J" "_BL" L35A 0.2 -90 " L35A")
  (COMMAND "TEXT" "J" "_BL" L35B 0.2 90 " L35B")
  (COMMAND "TEXT" "J" "_BR" P55A 0.2 45 " P55A")
  (COMMAND "TEXT" "J" "_BL" P55 0.2 -90 " P55")
  (COMMAND "TEXT" "J" "_BL" WS1 0.2 -90 " WS1")
  (COMMAND "TEXT" "J" "_BL" W50AB 0.2 0 " W50AB")
  (COMMAND "TEXT" "J" "_BL" H48AB 0.2 0 " H48AB")
  (COMMAND "TEXT" "J" "_BL" P57A 0.2 -90 " P57A")
  (command "text" "j" "_BR" R 0.2 0 " R")
  (COMMAND "TEXT" "J" "_Br" U 0.2 0 " U")
  (COMMAND "TEXT" "J" "_BL" U1 0.2 0 " U1")
  (COMMAND "TEXT" "J" "_BL" Z 0.2 0 " Z")
  (COMMAND "TEXT" "J" "_BL" X_S 0.2 0 " X_S")
  (COMMAND "TEXT" "J" "_BL" Y 0.2 0 " Y")
  (COMMAND "TEXT" "J" "_Br" V 0.2 0 " V")
  (COMMAND "TEXT" "J" "_BL" K 0.2 0 " K")
  (COMMAND "TEXT" "J" "_BL" G 0.2 0 " G")
  (COMMAND "TEXT" "J" "_BL" V_1 0.2 0 " V_1")

  (command "layer" "make" "C_Circle" "Color" "7" "" "")

  (COMMAND "CIRCLE" O "0.06")
  (COMMAND "CIRCLE" M2 "0.06")
  (COMMAND "CIRCLE" B "0.06")
  (COMMAND "CIRCLE" w "0.06")
  (COMMAND "CIRCLE" H "0.06")
  (COMMAND "CIRCLE" L "0.06")
  (COMMAND "CIRCLE" H6 "0.06")
  (COMMAND "CIRCLE" W7 "0.06")
  (COMMAND "CIRCLE" W9 "0.06")
  (COMMAND "CIRCLE" C10 "0.06")
  (COMMAND "CIRCLE" H11 "0.06")
  (COMMAND "CIRCLE" C12 "0.06")
  (COMMAND "CIRCLE" O13 "0.06")
  (COMMAND "CIRCLE" O14 "0.06")
  (COMMAND "CIRCLE" O15 "0.06")
  (COMMAND "CIRCLE" O16 "0.06")
  (COMMAND "CIRCLE" O17 "0.06")
  (COMMAND "CIRCLE" O18 "0.06")
  (COMMAND "CIRCLE" C19 "0.06")
  (COMMAND "CIRCLE" H20 "0.06")
  (COMMAND "CIRCLE" W21 "0.06")
  (COMMAND "CIRCLE" W22 "0.06")
  ;;(COMMAND "CIRCLE" W223A "0.06")
  (COMMAND "CIRCLE" L23 "0.06")
  (COMMAND "CIRCLE" C24 "0.06")
  (COMMAND "CIRCLE" C25 "0.06")
  (COMMAND "CIRCLE" C26 "0.06")
  (COMMAND "CIRCLE" W27 "0.06")
  (COMMAND "CIRCLE" H28 "0.06")
  (COMMAND "CIRCLE" L28A "0.06")
  (command "circle" o29 "0.06")
  (command "circle" c30 "0.06")
  (command "circle" w31 "0.06")
  (command "circle" h32 "0.06")
  ;;(command "circle" l33 "0.06")
  (command "circle" l34 "0.06")
  (command "circle" w35 "0.06")
  (COMMAND "CIRCLE" WA "0.06")
  (command "circle" c36 "0.06")
  ;;(command "circle" o37 "0.06")
  (command "circle" o38 "0.06")
  (command "circle" o39 "0.06")
  (command "circle" o40 "0.06")
  (command "circle" o41 "0.06")
  (command "circle" w45 "0.06")
  (command "circle" w45a "0.06")
  (command "circle" w451 "0.06")
  (command "circle" w452 "0.06")
  (command "circle" h46 "0.06")
  (command "circle" c47 "0.06")
  (command "circle" h48 "0.06")
  (command "circle" w49 "0.06")
  (command "circle" w50 "0.06")
  (princ "2222")
  (command "circle" c51 "0.06")
  (command "circle" l52 "0.06")
  (command "circle" c53 "0.06")
  (command "circle" p54 "0.06")
  (command "circle" h55 "0.06")
  (command "circle" p57 "0.06")
  (command "circle" h58 "0.06")
  (command "circle" c59 "0.06")
  (command "circle" U "0.06")
  (command "circle" Z "0.06")
  (command "circle" X_S "0.06")
  (command "circle" Y "0.06")
  (command "circle" V "0.06")
  (command "circle" K "0.06")
  (command "circle" G "0.06")
  (command "circle" p1 "0.06")
  (command "circle" p2 "0.06")
  (command "circle" p3 "0.06")
  (command "circle" p4 "0.06")
  (command "circle" wa "0.06")
  (command "circle" l35b "0.06")
  (prin1)
  (command "zoom" "ALL")
;;;;;;;;;;;;Test Fillet and chamfer
     ;(setq p1 (getpoint "ENTER ORIGIN POINT:"))
     ;(if (= P1 nil)
     ; (setq P1 '(-20 10))
     😉
  (setq r1 '(-11 10))
  (setq r2 (polar r1 0 10))
  (setq r3 (polar r2 (/ pi 2.0) 10))
  (setq r4 (polar r3 pi 10))

  (command "line" r1 r2 "")
  (setq el1 (entlast))
  (command "line" r2 r3 "")
  (setq el2 (entlast))
  (command "line" r3 r4 "")
  (setq el3 (entlast))
  (command "line" r4 r1 "")
  (setq el4 (entlast))
  (command "fillet" "r" 1.5)
  ;;r = radius
  (command "fillet" el1 el2)
  (command "fillet" el2 el3)
  (command "fillet" el3 el4)
  (command "fillet" el1 el4)

  (princ)

  ;;How can make I create Block?. Block name=8HEADFIGURE, Select objects: layer "8 HEAD FIGURE"
  ;;I want to be able to move the whole object together, not seperately, so I need to create a block.
  ;;See picture - I want to move all the red lines, not 1 by 1. Please help.
  ;;
  (command "layer"    "make"  "8HEADFIGURE"       "color"
    "r"       ""  "ltype"    "dot"      ""
    ""
   )
  (SETQ f_0 (POLAR O pi 36.0))
  (SETQ f_0 (POLAR f_0 PIU (/ Height 8.0)))
  (SETQ f_1 (POLAR f_0 PID (/ Height 8.0)))
  (SETQ f_2 (POLAR f_1 PID (/ Height 8.0)))
  (SETQ f_3 (POLAR f_2 PID (/ Height 8.0)))
  (SETQ f_4 (POLAR f_3 PID (/ Height 8.0)))
  (SETQ f_5 (POLAR f_4 PID (/ Height 8.0)))
  (SETQ f_6 (POLAR f_5 PID (/ Height 8.0)))
  (SETQ f_7 (POLAR f_6 PID (/ Height 8.0)))
  (SETQ f_8 (POLAR f_7 PID (/ Height 8.0)))
  (setq f_9 (polar f_1 pid full_length))

  (setq ss (ssadd))
  (COMMAND "LINE" f_0 f_8 "")
  (ssadd (entlast) ss)
  (COMMAND "LINE" f_0 "@36,0.0" "")
  (ssadd (entlast) ss)
  (COMMAND "LINE" f_1 "@36,0.0" "")
  (ssadd (entlast) ss)
  (COMMAND "LINE" f_2 "@36,0.0" "")
  (ssadd (entlast) ss)
  (COMMAND "LINE" f_3 "@60,0.0" "")
  (ssadd (entlast) ss)
  (COMMAND "LINE" f_4 "@60,0.0" "")
  (ssadd (entlast) ss)
  (COMMAND "LINE" f_5 "@36,0.0" "")
  (ssadd (entlast) ss)
  (COMMAND "LINE" f_6 "@36,0.0" "")
  (ssadd (entlast) ss)
  (COMMAND "LINE" f_7 "@36,0.0" "")
  (ssadd (entlast) ss)
  (COMMAND "LINE" f_8 "@36,0.0" "")
  (ssadd (entlast) ss)
  (command "line" f_9 "@-20,0.0" "");;Full_length
  (ssadd (entlast) ss)
  (command "_.block" "8HEADFIGURE" ss "")
 
   ;(COMMAND "LINE" f_0 f_8 "")
  ;(COMMAND "LINE" f_0 "@36,0.0" "")
  ;(COMMAND "LINE" f_1 "@36,0.0" "")
  ;(COMMAND "LINE" f_2 "@36,0.0" "")
  ;(COMMAND "LINE" f_3 "@60,0.0" "")
  ;(COMMAND "LINE" f_4 "@60,0.0" "")
  ;(COMMAND "LINE" f_5 "@36,0.0" "")
  ;(COMMAND "LINE" f_6 "@36,0.0" "")
  ;(COMMAND "LINE" f_7 "@36,0.0" "")
  ;(COMMAND "LINE" f_8 "@36,0.0" "")
  ;(command "line" f_9 "@-20,0.0" "");;Full_length
  ;(COMMAND "TEXT" "J" "_BL" f_0 0.2 0 " f_0")
  ;(COMMAND "TEXT" "J" "_BL" f_1 0.2 0 " f_1")
  ;(COMMAND "TEXT" "J" "_BL" f_2 0.2 0 " f_2")
  ;(COMMAND "TEXT" "J" "_BL" f_3 0.2 0 " f_3")
  ;(COMMAND "TEXT" "J" "_BL" f_4 0.2 0 " f_4")
  ;(COMMAND "TEXT" "J" "_BL" f_5 0.2 0 " f_5")
  ;(COMMAND "TEXT" "J" "_BL" f_6 0.2 0 " f_6")
  ;(COMMAND "TEXT" "J" "_BL" f_7 0.2 0 " f_7")
  ;(COMMAND "TEXT" "J" "_BL" f_8 0.2 0 " f_8")
  ;(COMMAND "TEXT" "J" "_BL" f_9 0.2 0 " f_9")
  (command "zoom" "ALL")
  (princ)
);;nd of defund

 

Message 6 of 15
hgasty1001
in reply to: jinkinglee

Hi,

 

You may need to insert the just created block, and erase the individual objects, something like this:

 

 (command "_.block" "8HEADFIGURE" some_point_variable_here ss "")
 (command "_.Insert" "8HEADFIGURE" same_point_as_line_above ...)
 (command "erase" ss "")

 

Other idea, just move the selection set to your convenience (command "move" ss "" p1 p2), doing so you don't lose the individual objects, but if you need to put that objects in a block, just create the block, insert it and erase the old objects.

 

 

 Gaston Nunez

Message 7 of 15
Kent1Cooper
in reply to: jinkinglee


@jinkinglee wrote:

;;How can make I create Block?. ....

....

  (COMMAND "LINE" f_0 f_8 "")
  (COMMAND "LINE" f_0 "@36,0.0" "")
  (COMMAND "LINE" f_1 "@36,0.0" "")
  (COMMAND "LINE" f_2 "@36,0.0" "")
  (COMMAND "LINE" f_3 "@60,0.0" "")
  (COMMAND "LINE" f_4 "@60,0.0" "")
  (COMMAND "LINE" f_5 "@36,0.0" "")
  (COMMAND "LINE" f_6 "@36,0.0" "")
  (COMMAND "LINE" f_7 "@36,0.0" "")
  (COMMAND "LINE" f_8 "@36,0.0" "")
  (command "line" f_9 "@-20,0.0" "");;Full_length


Another way is to mark the last object before you start drawing what will go in the Block, and afterwards find everything after that marked object to put in the Block.  [And you can put multiple commands into one (command) function] :

 

  (setq

    ent (entlast) ; mark last object

    ss (ssadd) ; initially empty

  ); end setq

  (COMMAND

    "LINE" f_0 f_8 ""
    "LINE" f_0 "@36,0.0" ""
    "LINE" f_1 "@36,0.0" ""
    "LINE" f_2 "@36,0.0" ""
    "LINE" f_3 "@60,0.0" ""
    "LINE" f_4 "@60,0.0" ""
    "LINE" f_5 "@36,0.0" ""
    "LINE" f_6 "@36,0.0" ""
    "LINE" f_7 "@36,0.0" ""
    "LINE" f_8 "@36,0.0" ""
    "line" f_9 "@-20,0.0" "" ;;Full_length

  ); end command

  (while (setq ent (entnext ent)) ; find newer objects -- will stop with last Line drawn

    (setq ss (ssadd ent ss)) ; put into selection

  ); while

  (command "_.block" .... [as in other suggestions]

 

BUT consider also making them a GROUP rather than a BLOCK.  That way you can select them all by selecting one of them, and it's much easier to adjust things if you want, for example you can change the length of some of the lines with Stretch, or of one by dragging its end grip, or the level of one with its midpoint grip, without needing to get into the Block editor.

Kent Cooper, AIA
Message 8 of 15
jinkinglee
in reply to: Kent1Cooper

;;I did like this. But still not working. please see below: Thanks

 

(setq ent (entlast) ; mark last object
      ss (ssadd) ; initially empty
  ); end setq

  (COMMAND
    "LINE" f_0 f_8 ""
    "LINE" f_0 "@36,0.0" ""
    "LINE" f_1 "@36,0.0" ""
    "LINE" f_2 "@36,0.0" ""
    "LINE" f_3 "@60,0.0" ""
    "LINE" f_4 "@60,0.0" ""
    "LINE" f_5 "@36,0.0" ""
    "LINE" f_6 "@36,0.0" ""
    "LINE" f_7 "@36,0.0" ""
    "LINE" f_8 "@36,0.0" ""
    "line" f_9 "@-20,0.0" "" ;;Full_length
  ); end command
  (while (setq ent (entnext ent)) ; find newer objects -- will stop with last Line drawn
    (setq ss (ssadd ent ss)) ; put into selection
   ); while
  (command "_.block" "8HEADFIGURE" some_point_variable_here ss "")
  (command "_.Insert" "8HEADFIGURE" same_point_as_line_above ...)
  (command "erase" ss "")

 

Message 9 of 15
Kent1Cooper
in reply to: hgasty1001


@hgasty1001 wrote:

.... 

You may need to insert the just created block, and erase the individual objects, something like this:

 

 (command "_.block" "8HEADFIGURE" some_point_variable_here ss "")
 (command "_.Insert" "8HEADFIGURE" same_point_as_line_above ...)
 (command "erase" ss "")

....


Yes, you will need to Insert the just-created Block.  The "modern" Block command with dialog box has the option to convert the objects into an insertion of the Block in the process of defining it, but the (command)-function Block command works as it did way back, and removes the objects, so you don't need to do the Erasing part.

Kent Cooper, AIA
Message 10 of 15
jinkinglee
in reply to: Kent1Cooper

I removed the line below. But still not working.

 

; (command "erase" ss "")

 

when i remove the line above, this is what comes out below:

 

Command: COATMULLER
Unknown command "COATMULLER".  Press F1 for help.

 

Then in autocad, it works, but not block.

;(command "_.Insert" "8HEADFIGURE" same_point_as_line_above ...)

 

 

Thanks

 

 

Message 11 of 15
Kent1Cooper
in reply to: jinkinglee


@jinkinglee wrote:

;;I did like this. But still not working. please see below: Thanks

 

....

  (command "_.block" "8HEADFIGURE" some_point_variable_here ss "")
  (command "_.Insert" "8HEADFIGURE" same_point_as_line_above ...)
....


The some_point_variable_here and same_point_as_line_above parts need to be replaced with some actual point location for the Block's insertion point, probably one of the point variables you already have.  I'm sure gasty1001 wrote it that way only because they can't know which point you would want to use, or whether you might want one that isn't already defined.

 

And the Insert command needs to be completed:

  (command "_.Insert" "8HEADFIGURE" same_point_as_line_above "" "" "") ; 3 Enters to accept default scale factors of 1 and rotation of 0

Kent Cooper, AIA
Message 12 of 15
smaher12
in reply to: jinkinglee

Keep the (command "erase ss "")

 

Replace lines...

(command "_.block" "8HEADFIGURE" some_point_variable_here ss "")
(command "_.Insert" "8HEADFIGURE" same_point_as_line_above ...)

 

With this...

(command "_.block" "8HEADFIGURE" "0,0" ss "")
(command "_.Insert" "8HEADFIGURE" "0,0" "" "" "")

Message 13 of 15
Kent1Cooper
in reply to: jinkinglee

Not really what you were asking, but there are many other things that could be more efficient.  One example -- all of this, from just before the part you were asking about:

 

  (setq r1 '(-11 10))
  (setq r2 (polar r1 0 10))
  (setq r3 (polar r2 (/ pi 2.0) 10))
  (setq r4 (polar r3 pi 10))

  (command "line" r1 r2 "")
  (setq el1 (entlast))
  (command "line" r2 r3 "")
  (setq el2 (entlast))
  (command "line" r3 r4 "")
  (setq el3 (entlast))
  (command "line" r4 r1 "")
  (setq el4 (entlast))
  (command "fillet" "r" 1.5)
  ;;r = radius
  (command "fillet" el1 el2)
  (command "fillet" el2 el3)
  (command "fillet" el3 el4)
  (command "fillet" el1 el4)

 

could be done with just this, eliminating eight otherwise-unused variables:

 

  (command "_.rectangle" "_fillet" 1.5 "-11,10" "@10,10")

 

followed by Exploding the resulting Polyline if you have any reason to want it left as separate Lines and Arcs.  [Sorry about the underlining -- the system is apparently interpreting that as an e-mail address because of the @ symbol in it.]

Kent Cooper, AIA
Message 14 of 15
Kent1Cooper
in reply to: smaher12


@smaher12 wrote:

Keep the (command "erase ss "")

 

Replace lines...

(command "_.block" "8HEADFIGURE" some_point_variable_here ss "")
(command "_.Insert" "8HEADFIGURE" same_point_as_line_above ...)

 

With this...

(command "_.block" "8HEADFIGURE" "0,0" ss "")
(command "_.Insert" "8HEADFIGURE" "0,0" "" "" "")


You can keep the Erase command in there if you like, but it won't do anything for you -- the objects will already be gone from the process of defining the Block.  Try it with command echoing on, and you'll see that it says "0 found."

 

And [again, you can use 0,0, but] I would strongly suggest using something other than 0,0 as the Block's insertion point, both in this case and as a general rule.  That should always be a point that has some actual relationship to the Block's contents, such as in this case [just a suggestion] the intersection of the vertical Line and the lowest horizontal Line [which must be one of those already-existing point variables].  Then if you want to Insert the Block again, you will be able to position it in some real relationship to things, dragging it visibly into place.  [If you use 0,0, you could very often have nothing at all of the Block showing on the screen as you move the cursor to pick an insertion point.  Then you might have to Zoom to the Extents just to find it, and reposition it somehow.]  And if you select it, for example to move it by dragging its insertion-point grip, that grip will be there to grab, rather than potentially somewhere off in the hinterlands.  [I really wish the Block dialog box would not offer 0,0,0 as the default insertion base point, because too often people unwittingly accept that and don't establish a logical one, and it only causes pain down the line.]

Kent Cooper, AIA
Message 15 of 15
smaher12
in reply to: Kent1Cooper


@Kent1Cooper wrote:
You can keep the Erase command in there if you like, but it won't do anything for you -- the objects will already be gone from the process of defining the Block.  Try it with command echoing on, and you'll see that it says "0 found."

 

And [again, you can use 0,0, but] I would strongly suggest using something other than 0,0 as the Block's insertion point, both in this case and as a general rule.  That should always be a point that has some actual relationship to the Block's contents, such as in this case [just a suggestion] the intersection of the vertical Line and the lowest horizontal Line [which must be one of those already-existing point variables].  Then if you want to Insert the Block again, you will be able to position it in some real relationship to things, dragging it visibly into place.  [If you use 0,0, you could very often have nothing at all of the Block showing on the screen as you move the cursor to pick an insertion point.  Then you might have to Zoom to the Extents just to find it, and reposition it somehow.]  And if you select it, for example to move it by dragging its insertion-point grip, that grip will be there to grab, rather than potentially somewhere off in the hinterlands.  [I really wish the Block dialog box would not offer 0,0,0 as the default insertion base point, because too often people unwittingly accept that and don't establish a logical one, and it only causes pain down the line.]


Oops, thanks for the catch. I totally forgot that objects will already be gone from the process of defining the Block. Thanks for the tip.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost