Community
AutoCAD Forum
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Multiline Styles

6 REPLIES 6
SOLVED
Reply
Message 1 of 7
Earl.Morrill
2515 Views, 6 Replies

Multiline Styles

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

6 REPLIES 6
Message 2 of 7
pendean
in reply to: Earl.Morrill

Combine how? There is no built-in ability, so describe your intent in detail.
Message 3 of 7
Earl.Morrill
in reply to: pendean

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

 

Message 4 of 7
pendean
in reply to: Earl.Morrill

AFAIK if you use the SAVE button in the MLSTYLE pop-up and select an existing MLN file, it will append the new definition to whatever is there. From HELP:
"Load
Displays the Load Multiline Styles dialog box, in which you can load multiline styles from a specified MLN file.

Save
Saves or copies a multiline style to a multiline library (MLN) file. If you specify an MLN file that already exists, the new style definition is added to the file and existing definitions are not erased."
Message 5 of 7
Earl.Morrill
in reply to: pendean

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

Message 6 of 7
Windsteel
in reply to: pendean

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

Message 7 of 7
Anonymous
in reply to: pendean

Not true in AutoCAD 2017 - the existing multiline is overwritten

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

Post to forums  

Autodesk Design & Make Report

”Boost