Hi Hugo,
Ich habe (glaube ich) der fehler entdeckt, versuch bitte mal ob es jetzt funktioniert.
Irgendwie bekomme ich die code nich aufs forum wie ich möchte aber es wird sich ausweisen.
Such nach:
;'(49 . - 0.75) ; This line gives the error
I believe I have found the error, please try.
Somehow the I cannot post the code with colored html as on other forums.
But you'll see my note.
;;--------------------------------------------------------------------------------
(defun c:du (/ curlay width sty)
(kdub:AssertMultiLineStyleDefinitionsExist)
(setq curlay (getvar "clayer"))
(if (not (tblsearch "layer" "__E-Kabeltrasse"))
(command "._-layer" "_make" "__E-Kabeltrasse" "_ltype" "continuous" "" "_color" "4" "" "")
(setvar "clayer" "__E-Kabeltrasse")
)
(command "_-linetype" "_load" "*"
"D:\\ACAD\\Linientypen\\KT.lin")
(while (= "-LINETYPE" (getvar "CMDNAMES"))
(command ""))
;;-----------------------------------
;;; (setq width (getdist "\nSpecify width of Duct: "))
(initget 1 "1 2 3 4 5 6")
(if (and (setq sty (getkword "\nSpecify the MLineStyle [1 2 3 4 5 6]:"))
(Kdub:Mlinestyle-Get sty)
)
(setvar 'cmlstyle sty) ;; (setvar 'CMLSTYLE <MlineStyleName>)
(progn
(alert "The chosen MLStyle is not avaliable")
(exit))
)
;;-----------------------------------
;;;(command "_mline" "_J" "_z" "_scale" width "")
(command "_mline")
(setvar "clayer" "curlay")
(princ)
)
;;--------------------------------------------------------------------------------
;;--------------------------------------------------------------------------------
(defun Kdub:Mlinestyle-Get (Name / mlsty-DICT MLSty)
(if (setq mlsty-DICT (dictsearch (Namedobjdict) "ACAD_MLINESTYLE"))
(while (and mlsty-DICT
(not (setq MLSty (if (and (assoc 3 mlsty-DICT) (= (strcase (cdr (assoc 3 mlsty-DICT))) (strcase Name)))
(list (strcase Name) (cdr (cadr (member (assoc 3 mlsty-DICT) mlsty-DICT))))
)
)
)
)
(setq mlsty-DICT (cdr (member (assoc 3 mlsty-DICT) mlsty-DICT)))
)
)
MLSty
)
;;--------------------------------------------------------------------------------
(defun massoc (key alist / x nlist)
(foreach x alist
(if (eq key (car x))
(setq nlist (cons (cdr x) nlist))
)
)
(reverse nlist)
)
;;--------------------------------------------------------------------------------
;;--------------------------------------------------------------------------------
(defun kdub:AssertMultiLineStyleDefinitionsExist
(/ mlSty-DICT MultiLineStyle_lst StyleName)
;; kdub 20100807
;; Ensure definition of AcDbMlineStyles
;; Closed Opened First-open Last-open
;;-----------------------------------
;;-----------------------------------
(setq mlSty-DICT-ent (cdr (cadr (member '(3 . "ACAD_MLINESTYLE") (entget (namedobjdict)))))
MultiLineStyle_lst (mapcar 'STRCASE (massoc 3 (entget mlSty-DICT-ent)))
)
;|
dxf 70 Flags (bit-coded):
1 =Fill on
2 = Display miters
16 = Start square end (line) cap
32 = Start inner arcs cap
64 = Start round (outer arcs) cap
256 = End square (line) cap
512 = End inner arcs cap
1024 = End round (outer arcs) cap
|;;;-----------------------------------
(setq StyleName "1")
(if (not (member (strcase StyleName) MultiLineStyle_lst))
(dictadd mlSty-DICT-ent
StyleName
(entmakex (list '(0 . "MLINESTYLE")
'(100 . "AcDbMlineStyle")
(cons 2 StyleName)
'(70 . 272) ; End flag
'(3 . "") ; StyleDescription
'(62 . 256) ; fill color
'(51 . 1.5708) ; start angle
'(52 . 1.5708) ; end angle
'(71 . 3) ; qty elements
;
'(49 . 0.25) ; element offset
'(62 . 256)
'(6 . "BYLAYER") ; Element Linetype
'(49 . 0.0)
'(62 . 131)
'(6 . "KT100")
'(49 . -0.25)
'(62 . 256)
'(6 . "BYLAYER")
)
)
)
)
;;-----------------------------------
(setq StyleName "2")
(if (not (member (strcase StyleName) MultiLineStyle_lst))
(dictadd mlSty-DICT-ent
StyleName
(entmakex (list '(0 . "MLINESTYLE")
'(100 . "AcDbMlineStyle")
(cons 2 StyleName)
'(70 . 272) ; End flag
'(3 . "") ; StyleDescription
'(62 . 256) ; fill color
'(51 . 1.5708) ; start angle
'(52 . 1.5708) ; end angle
'(71 . 3) ; qty elements
;
'(49 . 0.50) ; element offset
'(62 . 256)
'(6 . "BYLAYER") ; Element Linetype
'(49 . 0.0)
'(62 . 131)
'(6 . "KT200")
'(49 . -0.50)
'(62 . 256)
'(6 . "BYLAYER")
)
)
)
)
;;-----------------------------------
(setq StyleName "3")
(if (not (member (strcase StyleName) MultiLineStyle_lst))
(dictadd mlSty-DICT-ent
StyleName
(entmakex (list '(0 . "MLINESTYLE")
'(100 . "AcDbMlineStyle")
(cons 2 StyleName)
'(70 . 272) ; End flag
'(3 . "") ; StyleDescription
'(62 . 256) ; fill color
'(51 . 1.5708) ; start angle
'(52 . 1.5708) ; end angle
'(71 . 3) ; qty elements
;
'(49 . 0.75) ; element offset
'(62 . 256)
'(6 . "BYLAYER") ; Element Linetype
'(49 . 0.0)
'(62 . 131)
'(6 . "KT300")
;'(49 . - 0.75) ; This line gives the error
'(62 . 256)
'(6 . "BYLAYER")
)
)
)
)
;;-----------------------------------
(setq StyleName "4")
(if (not (member (strcase StyleName) MultiLineStyle_lst))
(dictadd mlSty-DICT-ent
StyleName
(entmakex (list '(0 . "MLINESTYLE")
'(100 . "AcDbMlineStyle")
(cons 2 StyleName)
'(70 . 272) ; End flag
'(3 . "") ; StyleDescription
'(62 . 256) ; fill color
'(51 . 1.5708) ; start angle
'(52 . 1.5708) ; end angle
'(71 . 3) ; qty elements
;
'(49 . 1.0) ; element offset
'(62 . 256)
'(6 . "BYLAYER") ; Element Linetype
'(49 . 0.0)
'(62 . 131)
'(6 . "KT400")
'(49 . -1.0)
'(62 . 256)
'(6 . "BYLAYER")
)
)
)
)
;;-----------------------------------
(setq StyleName "5")
(if (not (member (strcase StyleName) MultiLineStyle_lst))
(dictadd mlSty-DICT-ent
StyleName
(entmakex (list '(0 . "MLINESTYLE")
'(100 . "AcDbMlineStyle")
(cons 2 StyleName)
'(70 . 272) ; End flag
'(3 . "") ; StyleDescription
'(62 . 256) ; fill color
'(51 . 1.5708) ; start angle
'(52 . 1.5708) ; end angle
'(71 . 3) ; qty elements
;
'(49 . 1.25) ; element offset
'(62 . 256)
'(6 . "BYLAYER") ; Element Linetype
'(49 . 0.0)
'(62 . 131)
'(6 . "KT500")
'(49 . -1.25)
'(62 . 256)
'(6 . "BYLAYER")
)
)
)
)
;;-----------------------------------
(setq StyleName "6")
(if (not (member (strcase StyleName) MultiLineStyle_lst))
(dictadd mlSty-DICT-ent
StyleName
(entmakex (list '(0 . "MLINESTYLE")
'(100 . "AcDbMlineStyle")
(cons 2 StyleName)
'(70 . 272) ; End flag
'(3 . "") ; StyleDescription
'(62 . 256) ; fill color
'(51 . 1.5708) ; start angle
'(52 . 1.5708) ; end angle
'(71 . 3) ; qty elements
;
'(49 . 1.50) ; element offset
'(62 . 256)
'(6 . "BYLAYER") ; Element Linetype
'(49 . 0.0)
'(62 . 131)
'(6 . "KT600")
'(49 . -1.50)
'(62 . 256)
'(6 . "BYLAYER")
)
)
)
)
;;-----------------------------------
(princ)
)