 (defmulti generate (fn [x] (:kind x)))
 
 (defn drawing-name [x]
-  (str "10" (nextline)  "$" (upper-case (subs (str x) 1))))
+  (str "10" (nextline) "$" (upper-case (subs (str x) 1))))
 
 (defn drawing-point [name x]
   (str (drawing-name name) (nextline) (point (name x))))

(defn section [name x]
  (let
    [xstr (
           if (or (nil? x) (= (count x) 0))
          ""
           (str (nextline) (join (nextline) x))
           )
     ]
    (str 
      "0" (nextline) "SECTION" (nextline)
      "2" (nextline) (upper-case name)
      xstr (nextline)
      "0" (nextline) "ENDSEC"
    )
  )
)

)

(defmethod generate :layer [l]
  (join (nextline) [
    "0" "LAYER"
    "2" (upper-case (:name l))
    "70" (:flag l)
    "62" (:color l)
    "6" (:lineType l)
  ]))

(defmethod generate :style [s]
    (join (nextline) [
      "0" "STYLE" 
      "2" (upper-case (:name s))
      "70" (:flag s)
      "40" (:flag s)
      "41" (:widthFactor s)
      "50" (:obliqueAngle s)
      "71" (:mirror s) 
      "42" (:lastHeight s)
      "3" (upper-case (:font s))
      "4" (upper-case (:bigFont s))
    ]))

(defmethod generate :linetype [l]
  (join (nextline) [
    "0" "LTYPE"
    "2" (upper-case (:name l))
    "70" (:flag l)
    "3" (:description l)
    "72" "65"
    "73" (count (:elements l))
    "40" "0.0"
  ]))

(defn common [c]
  (let [parent (:parent c c)]
