I'm working in AutoCAD 2012.
I have created and saved 3 individual Mline Styles.
Can these be combined into one .mln file similar to a combined .lin file?
If so, what is the format?
Thanks,
Earl
Solved! Go to Solution.
Solved by pendean. Go to Solution.
Hi Dean,
Instead of having many individual mln files, I would like to combine them into one file, like can be done with combining regular linetype definitions into one .lin file.
Can I simply cut and paste the individual files into one?
Each .mln file starts with "MLSTYLE" on the first line, and "2" on the second line, the third line is the style name.
Do i include or exclude the "MLSTYLE" and "2" when combining them?
What does the "2" represent?
I haven't been able to find any information on combining them, so I thought I would ask here.
Thanks,
Earl
Perfect, (I missed that part).
Thanks Dean!!
And for those following along at home - yes, it just appends the entire definition, including the "MLSTYLE", and "2".
Earl
Dear Mr. Dean,
Can you hepl me a little bit. my Autocad may have a problem, when i'm save a new modify Multiline Style with the same *.mln, it's will erased old line and replace with new one that i'm just created. then i'm use another way, that i'm copy new modify Multiline Style and paste into same *.mln, it seem don't have problem when i'm Load form Multiline Style Dialog Box. But when i'm use lisp to import all Multiline Style to other drawing it just recognized the first one and don't see any else. I'm use this lisp:
(defun c:LoadMlStyles (/ mlFileName)
(setq mlFileName (getstring "\nEnter MLN file name: "))
(if (/= nil mlFileName)
(LoadMln mlFileName)
)
(princ)
)
(defun LoadMln (mlnFile / f mlineDict same newStyle xName)
(setq mlnFile (findfile mlnFile))
(setq f (open mlnFile "r"))
;;(setq f (open mlnFile "r"))
(if (= NIL f)
(princ "\nInvalid MLN file.\n")
(progn
;; Get the MLINESTLYE dictionary.
(setq mlineDict (dictsearch
(namedobjdict) "ACAD_MLINESTYLE"))
;; Create the beginning of an MLINESTYLE object.
(setq same (list (cons 0 "MLINESTYLE")
;;(cons 102 "{ACAD_REACTORS")
;;(cons 330 (cdr (assoc -1 mlineDict)))
;;(cons 102 "}")
;;(cons 330 (cdr (assoc -1 mlineDict)))
(cons 100 "AcDbMlineStyle")
)
)
;;
;; Read the data of the MLINESTYLE
;;
(while (/= nil (setq mlStyle (ReadObject f)))
;; Create the complete MLINESTYLE object.
(setq newStyle (append same mlStyle)
xName (entmakex newStyle)
)
;; Append it to the MLINESTYLE dictionary.
(dictadd (cdr (assoc -1 mlineDict))
(cdr (assoc 2 newStyle))
xName
)
)
)
)
(close f)
(princ)
)
(defun ReadObject (f / ObjectList firstLine code value)
(setq ObjectList nil)
;; Skip the 'MLSTYLE'.
(setq firstLine (read-line f))
(if (/= nil firstLine)
(progn
(while (/= 0 (setq code (atoi (read-line f))))
(setq value (vl-string-trim " " (read-line f)))
(if (or (= code 2)
(= code 3)
(= code 6)
)
(setq ObjectList (append ObjectList
(list (cons code value))))
)
(if (or (= code 70)
(= code 62)
(= code 71)
)
(setq ObjectList (append ObjectList
(list (cons code (atoi value)))))
)
(if (or (= code 51)
(= code 52)
)
;; Code 51 and 52 must be converted into degrees.
(setq ObjectList
(append ObjectList
(list (cons code
(angtof value 0)))))
)
(if (= code 49)
(setq ObjectList
(append ObjectList
(list (cons code (atof value)))))
)
)
)
)
ObjectList
)
Yo
UPDATE to this old thread in case anyone is wondering.
The *.mln file is STILL overwritten using 2024 (Civil 3D).
Can't find what you're looking for? Ask the community or share your knowledge.